Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React native android application has stopped

I've stuck with an android version of an application (this one with "Welcome to React Native!" text). After this, I did exact steps as a documentation says. After build android version of this application, i copied signed version of APK file on my device and install it - when i'm trying to launch it then i receiving message "Unfortunately, FirstProject has stopped". Debug version of this application working fine. I've spent almost a week trying to run this, and i didn't find any solution. Do any one have any idea what i'm doing wrong?

Regards

like image 557
Artur L. Avatar asked Feb 15 '16 10:02

Artur L.


2 Answers

I think the problem lies here. In the latest releases, pro guard is enabled by default. Try disabling it in android/app/build.gradle :

buildTypes {
  release {
      minifyEnabled enableProguardInReleaseBuilds
      proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
  }
}

Change this :

def enableProguardInReleaseBuilds = true 

to this :

def enableProguardInReleaseBuilds = false 

Then run the steps again to create you APK.

like image 121
G. Hamaide Avatar answered Oct 24 '22 02:10

G. Hamaide


Well, that's really not a lot of info to use.. but, if the difference is just debug ou signed, I would search for obfuscation problems in the signed version.

But this is just a wild guess. If you want to really get help you need to put the stack error here, as well as more info of the part of the code that crashes.

like image 39
neteinstein Avatar answered Oct 24 '22 03:10

neteinstein