[英]React-Native can't run Android - react-native-maps:compileReleaseJavaWithJavac
I have a react-native
project and everything works great on ios
but when I try to run it on android
I get this error ':react-native-maps:compileReleaseJavaWithJavac' > Could not find tools.jar
. 我有一个
react-native
项目,并且所有内容在ios
上都运行良好,但是当我尝试在android
上运行它时,出现此错误':react-native-maps:compileReleaseJavaWithJavac' > Could not find tools.jar
。 I'm not sure what it means and I have done some research and found this Stackoverflow Question However, it doesn't seem to be my case. 我不确定这意味着什么,我做了一些研究,发现了这个Stackoverflow问题。但是,这似乎不是我的情况。
Does anyone know what this error means? 有人知道这个错误是什么意思吗?
build.gradle build.gradle
dependencies {
compile project(':react-native-push-notification')
compile project(':react-native-prompt-android')
compile project(':react-native-maps')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile(project(':react-native-maps')){
exclude group: 'com.google.android.gms', module: 'play-services-base'
exclude group: 'com.google.android.gms', module: 'play-services-maps'
}
compile 'com.google.android.gms:play-services-base:10.0.1'
compile 'com.google.android.gms:play-services-maps:10.0.1'
compile "com.facebook.react:react-native:+" // From node_modules
}
Android development requires to have the JDK installed on your computer. Android开发需要在计算机上安装JDK。 You have to set the environment variable
JAVA_HOME
to a valid JDK. 您必须将环境变量
JAVA_HOME
为有效的JDK。 The error could be because you don't have a JDK on your computer. 该错误可能是因为您的计算机上没有JDK。 Try to Launch Android Studio and check that the JDK is here by creating an empty project, go to
File-> Project Structure
and look at the JDK location. 尝试启动Android Studio,并通过创建一个空项目来检查JDK是否在此处,转到
File-> Project Structure
然后查看JDK位置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.