针对android–ReactNativeMaps错误编译debugJavaWithJavac和react-native-maps这两个问题,本篇文章进行了详细的解答,同时本文还将给你拓展>任务:re
针对android – React Native Maps错误编译debugJavaWithJavac和react-native-maps这两个问题,本篇文章进行了详细的解答,同时本文还将给你拓展>任务:react-native-reanimated:compileDebugJavaWithJavac FAILED、Android Error:Execution failed for task '':app:compileDebugJavaWithJavac'' 解决方案 总结、Android Java 8 使用 Lamda 报错:Execution failed for task :app:transformJackWithJackForDebug - Android?、android – React Native:未设置JAVA_HOME,并且在PATH中找不到“java”命令等相关知识,希望可以帮助到你。
本文目录一览:- android – React Native Maps错误编译debugJavaWithJavac(react-native-maps)
- >任务:react-native-reanimated:compileDebugJavaWithJavac FAILED
- Android Error:Execution failed for task '':app:compileDebugJavaWithJavac'' 解决方案 总结
- Android Java 8 使用 Lamda 报错:Execution failed for task :app:transformJackWithJackForDebug - Android?
- android – React Native:未设置JAVA_HOME,并且在PATH中找不到“java”命令
android – React Native Maps错误编译debugJavaWithJavac(react-native-maps)
我是React-native的新手.我尝试使用npm在我的应用程序上添加谷歌地图i react-native-maps –save
我推荐这个https://github.com/react-community/react-native-maps/blob/master/docs/installation.md并按照所有步骤进行操作.我获得了Google Api并将其放入AndroidManifest.我的Google Play服务版本为14.5.74.我还添加了android / app / build.gradle.这里是
ext {
buildToolsversion = “27.0.3”
minSdkVersion = 16
compileSdkVersion = 27
targetSdkVersion = 26
supportLibVersion = “27.1.1”
googlePlayServicesversion = “14.5.74”
androidMapsUtilsversion = “0.5+”
}
我曾经
“dependencies”: {
“@babel/runtime”: “^7.1.5”,
“react”: “16.5.0”,
“react-native”: “0.57.0”,
“react-native-maps”: “^0.22.1” },
但是我收到了一个错误
ask :react-native-maps:compileDebugJavaWithJavac Failed
D:_reactNative\MSB\LocationMap\node_modules\react-native-maps\lib\android\src\main\java\com\airbnb\android\react\maps\AirMappolyline.java:8:
error: cannot find symbol
import
com.google.android.gms.maps.model.Cap;
^ symbol: class Cap location: package com.google.android.gms.maps.model
D:_reactNative\MSB\LocationMap\node_modules\react-native-maps\lib\android\src\main\java\com\airbnb\android\react\maps\AirMappolyline.java:12:
error: cannot find symbol import
com.google.android.gms.maps.model.RoundCap;
^ symbol: class RoundCap location: package com.google.android.gms.maps.model
D:_reactNative\MSB\LocationMap\node_modules\react-native-maps\lib\android\src\main\java\com\airbnb\android\react\maps\AirMappolyline.java:27:
error: cannot find symbol private Cap lineCap = new RoundCap();
^ symbol: class Cap location: class AirMappolyline D:_reactNative\MSB\LocationMap\node_modules\react-native-maps\lib\android\src\main\java\com\airbnb\android\react\maps\AirMappolyline.java:73:
error: cannot find symbol public void setLineCap(Cap cap) {
^ symbol: class Cap location: class AirMappolyline
D:_reactNative\MSB\LocationMap\node_modules\react-native-maps\lib\android\src\main\java\com\airbnb\android\react\maps\AirMappolylineManager.java:15:
error: cannot find symbol import
com.google.android.gms.maps.model.ButtCap;
^ symbol: class ButtCap location: package com.google.android.gms.maps.model
D:_reactNative\MSB\LocationMap\node_modules\react-native-maps\lib\android\src\main\java\com\airbnb\android\react\maps\AirMappolylineManager.java:16:
error: cannot find symbol import
com.google.android.gms.maps.model.Cap;
^ symbol: class Cap location: package com.google.android.gms.maps.model
D:_reactNative\MSB\LocationMap\node_modules\react-native-maps\lib\android\src\main\java\com\airbnb\android\react\maps\AirMappolylineManager.java:17:
error: cannot find symbol import
com.google.android.gms.maps.model.RoundCap;
^ symbol: class RoundCap location: package com.google.android.gms.maps.model
D:_reactNative\MSB\LocationMap\node_modules\react-native-maps\lib\android\src\main\java\com\airbnb\android\react\maps\AirMappolylineManager.java:18:
error: cannot find symbol import
com.google.android.gms.maps.model.SquareCap;
^ symbol: class SquareCap location: package com.google.android.gms.maps.model
D:_reactNative\MSB\LocationMap\node_modules\react-native-maps\lib\android\src\main\java\com\airbnb\android\react\maps\AirMappolyline.java:27:
error: cannot find symbol private Cap lineCap = new RoundCap();
^ symbol: class RoundCap location: class AirMappolyline
D:_reactNative\MSB\LocationMap\node_modules\react-native-maps\lib\android\src\main\java\com\airbnb\android\react\maps\AirMappolylineManager.java:77:
error: cannot find symbol
Cap cap = null;
^ symbol: class Cap location: class AirMappolylineManager D:_reactNative\MSB\LocationMap\node_modules\react-native-maps\lib\android\src\main\java\com\airbnb\android\react\maps\AirMappolylineManager.java:80:
error: cannot find symbol
cap = new ButtCap();
^ symbol: class ButtCap location: class AirMappolylineManager
D:_reactNative\MSB\LocationMap\node_modules\react-native-maps\lib\android\src\main\java\com\airbnb\android\react\maps\AirMappolylineManager.java:83:
error: cannot find symbol
cap = new RoundCap();
^ symbol: class RoundCap location: class AirMappolylineManager
D:_reactNative\MSB\LocationMap\node_modules\react-native-maps\lib\android\src\main\java\com\airbnb\android\react\maps\AirMappolylineManager.java:86:
error: cannot find symbol
cap = new SquareCap();
^ symbol: class SquareCap location: class AirMappolylineManager
D:_reactNative\MSB\LocationMap\node_modules\react-native-maps\lib\android\src\main\java\com\airbnb\android\react\maps\AirMappolylineManager.java:89:
error: cannot find symbol
cap = new RoundCap();
^ symbol: class RoundCap location: class AirMappolylineManager Note: Some input files use or override a
deprecated API. Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations. Note:
Recompile with -Xlint:unchecked for details. 14 errors
- What went wrong: Execution Failed for task ‘:react-native-maps:compileDebugJavaWithJavac’.
Compilation Failed; see the compiler error output for details.
请告诉我怎么解决这个问题?
解决方法:
react-native-maps依赖不适用于react-native版本0.57.0.请将其更新为0.57.4或最新版本.
>任务:react-native-reanimated:compileDebugJavaWithJavac FAILED
今天我也遇到了同样的错误,而我所做的修复是
替换
new GuardedRunnable(mContext.getExceptionHandler())
使用
new GuardedRunnable(mContext)
尝试一下,看看是否适合您。
,如果您使用本机0.59,请将react-native-reanimated
升级到'v1.13.0'
他们解决了一个问题: https://github.com/software-mansion/react-native-reanimated/issues/1109
Android Error:Execution failed for task '':app:compileDebugJavaWithJavac'' 解决方案 总结
1、升级更新buildToolsVersion 到最新版本
2、升级Android Studio 2.2.2版本,JDK 1.8版本
3、配置JAVA_HOME路径
然并卵没有解决我个人的问题
gradlew compileDebug --stacktrace 可以用于查看堆栈的错误信息,然后再去网上继续找寻错误信息。
把命令gradlew compileDebug --stacktrace 改成 gradlew compileDebugJavaWithJavac
居然把具体的错误信息打印出来了
然后更改,解决问题
像我遇到的问题是,刷新的时候都没有问题,运行的时候就出现我们标题的问题,然而解决了几次这样错误以后,发现一般来说只有manefest的权限重复这种类型错误,不打印错误信息出来,是看不到真正的错误的。gradle和studio升级版本越来越高以后,对权限要求都不能重复了,感觉算不算坑,有点追求完美?以前版本是可以兼容,内部应该帮你合并了的。
环境:studio3.0.1 gradle 4.1版本
Android Java 8 使用 Lamda 报错:Execution failed for task :app:transformJackWithJackForDebug - Android?

Remove jackOption from defaultConfig in build.gradle
Add following lines in Application gradle
dependencies {
classpath ''com.android.tools.build:gradle:2.3.1''
classpath ''me.tatarka:gradle-retrolambda:3.2.3''
}
And add following line in build.gradle as below:
apply plugin: ''me.tatarka.retrolambda''
Hope this will help.
android – React Native:未设置JAVA_HOME,并且在PATH中找不到“java”命令
这是我运行react-native run-android时的错误:
Starting JS server... Building and installing the app on the device (cd android && ./gradlew installDebug)... ERROR: JAVA_HOME is not set and no 'java' command Could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation. Could not install the app on the device,read the error above for details. Make sure you have an Android emulator running or a device connected and have set up your Android development environment: https://facebook.github.io/react-native/docs/android-setup.html
它没有找到JAVA_HOME,因为最新版本的Android Studio不需要在系统中安装Java.而是使用内部JRE.
重复免责声明:我已经阅读了this question.这不是我想要的.我知道如何设置Java主页.我只想运行react项目而不必安装单独的Java.
问题:
>我怎样才能在Android Studio文件夹中找到内部Java,以便我可以将JAVA_HOME指向它?
>如果不可能,我可以使用Android Studio在android文件夹中打开并运行项目吗?在修改父文件夹中的React JavaScript代码后,如何刷新此项目?
解决方法
1-要将JAVA_HOME指向Android Studio附带的JRE,首先找到Android Studio安装文件夹,然后找到/ jre目录.该目录的完整路径是您需要将JAVA_PATH设置为(感谢@TentenPonce为他的answer).
在linux上,您可以通过将此行添加到.bashrc或.bash_profile文件来设置JAVA_HOME:
export JAVA_HOME=<Your Android Studio path here>/jre
如果您遵循针对Linux的React Native入门,则此文件(一个或另一个)与您添加ANDROID_HOME的文件相同.两者都默认隐藏,可以在您的主目录中找到.添加行后,您需要重新加载终端,以便它可以获取新的环境变量.所以输入:
source $HOME/.bash_profile
要么
source $HOME/.bashrc
现在你可以在同一个终端运行react-native run-android.另一种选择是重新启动操作系统.其他终端可能有不同的工作
注意:要使项目实际运行,您需要提前启动Android模拟器,或者连接真实设备.最简单的方法是打开一个已经存在的Android Studio项目并从那里启动模拟器,然后关闭Android Studio.
2-因为反应本机run-android似乎只是这样:
cd android && ./gradlew installDebug
您实际上可以使用Android Studio打开嵌套的Android项目并手动运行它.如果您在模拟器中使用enable live reload,则可以重新加载JS更改.键入CTRL M(MacOS上为CMD M),然后在出现的菜单中选择“启用实时重新加载”选项(对于his answer,请给@BKO致敬)
关于android – React Native Maps错误编译debugJavaWithJavac和react-native-maps的问题就给大家分享到这里,感谢你花时间阅读本站内容,更多关于>任务:react-native-reanimated:compileDebugJavaWithJavac FAILED、Android Error:Execution failed for task '':app:compileDebugJavaWithJavac'' 解决方案 总结、Android Java 8 使用 Lamda 报错:Execution failed for task :app:transformJackWithJackForDebug - Android?、android – React Native:未设置JAVA_HOME,并且在PATH中找不到“java”命令等相关知识的信息别忘了在本站进行查找喔。
本文标签: