简体   繁体   English

Android发行版上的react-native-firebase NullPointerException

[英]react-native-firebase NullPointerException on android release build

I am getting below error in android when I have changed my MacBook. 更换MacBook后,我在android中报错。 The app is running perfectly in the emulator/ real device. 该应用程序可以在模拟器/真实设备中完美运行。 But I am facing this issue in making a release with ./gradlew assembleRelease command. 但是我在使用./gradlew assembleRelease命令进行发行时遇到了这个问题。

A problem occurred configuring project ‘:react-native-firebase’.
> java.lang.NullPointerException (no error message)

I also tried the solution given on this link . 我也尝试了此链接上给出的解决方案。 But didn't work. 但是没有用。

After spending two days on this issue, I have found that there was a problem of Java version. 在此问题上花了两天后,我发现Java版本存在问题。

I added this two line in gradle.properites 我在gradle.properites中添加了这两行

org.gradle.java.home=/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home
org.gradle.daemon=true

And In Project Structure option -> SDK Location -> Enable Use embedded JDK 在项目结构选项中-> SDK位置->启用使用嵌入式JDK

This solution is worked for me. 此解决方案为我工作。

Try to make release build from android studio. 尝试从android studio发行版本。

Before doing that go to android folder and run ./gradlew clean 在此之前,请转到android文件夹并运行./gradlew clean

Follow below steps: 请按照以下步骤操作:

Open you project in android studio and search for build -> generate release apk -> follow steps for keystore and all then select release option at last window. 打开您在Android Studio中项目和搜索build - > generate release apk - > follow steps for keystore and all的最后一个窗口,然后选择发布选项。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 React-native-firebase 后台通知(Android) - React-native-firebase notification in background (Android) 添加 react-native-firebase crashlytics 后,Android 应用程序在第二个构建中崩溃,MainApplication 出现 classNotFound 异常 - After add react-native-firebase crashlytics the Android App crashes in the second build with classNotFound Exception for MainApplication react-native-firebase自定义声音在android 8,android 9上不起作用 - react-native-firebase Custom sound not working on android 8, android 9 构建用于Android的react-native-firebase时的依赖性冲突(多个dex文件定义Lcom / google / firebase / iid / zzb $ 1) - dependency conflict when build react-native-firebase for Android (Multiple dex files define Lcom/google/firebase/iid/zzb$1) 使用 react-native-firebase 时添加对 Android 通知的回复 - Add replies to Android notifications while using react-native-firebase 无法在 Android 中设置 @react-native-firebase/messaging - Can't setup @react-native-firebase/messaging in Android android设置中的react-native-firebase依赖问题 - react-native-firebase dependency issue in android setup 在现有项目 ( react-native@.54 ) 中不可能实现 react-native-firebase 。 gradle 构建失败 - react-native-firebase implementation is not possible in existing project ( react-native@.54 ). gradle build failed 任务 :react-native-firebase:compileReleaseJavaWithJavac 失败 - Task :react-native-firebase:compileReleaseJavaWithJavac FAILED react-native-firebase 通知崩溃 - react-native-firebase notification crash
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM