[英]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.