当我尝试使用这些命令进行 android 构建时 yarn run android
或 react-native run-android
然后我已经显示了这个错误。请帮助 mw 解决此错误。
这是 package.json
"@react-native-firebase/admob": "^11.5.0",
"@react-native-firebase/app": "^11.5.0",
"@react-native-firebase/messaging": "^11.5.0",
错误:> Configure project :react-native-firebase_messaging
:react-native-firebase_messaging package.json found at /Users/apple/Desktop/xnd-react-native/node_modules/@react-native-firebase/messaging/package.json
:@react-native-firebase_app package.json found at /Users/apple/Desktop/xnd-react-native/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_messaging:firebase.bom using default value: 26.8.0
:react-native-firebase_messaging package.json found at /Users/apple/Desktop/xnd-react-native/node_modules/@react-native-firebase/messaging/package.json
:react-native-firebase_messaging:version set from package.json: 11.5.0 (11,5,0 - 11005000)
:react-native-firebase_messaging:android.compileSdk using custom value: 31
:react-native-firebase_messaging:android.targetSdk using custom value: 31
:react-native-firebase_messaging:android.minSdk using custom value: 21
:react-native-firebase_messaging:reactNativeAndroidDir /Users/apple/Desktop/xnd-react-native/node_modules/react-native/android
> Task :@react-native-firebase_messaging:compileDebugJavaWithJavac FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
17 actionable tasks: 1 executed, 16 up-to-date
最佳答案
我在 jdk 8 中也有同样的问题。当我将 jdk 8 更改为 11 时,它对我有用。
要从 jdk 8 更新到 11,请查看 https://github.com/invertase/react-native-firebase/issues/1988#issuecomment-1070831039
关于javascript -> 任务 :@react-native-firebase_messaging:compileDebugJavaWithJavac FAILED,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69862012/