0
  1. Android Release apk has stopen when open it in react -native

    *****E/AndroidRuntime: FATAL EXCEPTION: Thread-3
        Process: com.reactapp, PID: 4023
        java.lang.ExceptionInInitializerError
            at com.facebook.react.bridge.p.a(Unknown Source)
            at com.facebook.react.k$5.run(Unknown Source)
            at java.lang.Thread.run(Thread.java:761)
         ****Caused by: java.lang.ClassNotFoundException: Didn't find class "com.facebook.react.bridge.ProxyJavaScriptExecutor" on path: DexPathList[[zip file "/data/app/com.reactapp-2/base.apk"],nativeLibraryDirectories=[/data/app/com.reactapp-2/lib/arm, /data/app/com.reactapp-2/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib, /system/vendor/lib]]****
            at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
            at java.lang.Runtime.nativeLoad(Native Method)
            at java.lang.Runtime.doLoad(Runtime.java:1060)
            at java.lang.Runtime.load0(Runtime.java:895)
            at java.lang.System.load(System.java:1505)
            at com.facebook.l.b.a(Unknown Source)
            at com.facebook.l.b.a(Unknown Source)
            at com.facebook.l.g.a(Unknown Source)
            at com.facebook.l.g.a(Unknown Source)
            at com.facebook.react.bridge.ao.a(Unknown Source)
            at com.facebook.react.bridge.NativeMap.<clinit>(Unknown Source)
            at com.facebook.react.bridge.p.a(Unknown Source) 
            at com.facebook.react.k$5.run(Unknown Source) 
            at java.lang.Thread.run(Thread.java:761)***** 
    
    1. What Should I do For That can Any One Help Me For that

I am use here react-native-fcm and react-native-device-info in this project

#

  • List item Build.gradle gere

    #

    `android { compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion

    defaultConfig {
        applicationId "com.reactapp"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    
        packagingOptions {
            exclude "lib/arm64-v8a/librealm-jni.so"
            exclude 'META-INF/services/javax.annotation.processing.Processor'
        }
    
    
    }
    
    signingConfigs {
        release {
            storeFile file(MYAPP_RELEASE_STORE_FILE)
            storePassword MYAPP_RELEASE_STORE_PASSWORD
            keyAlias MYAPP_RELEASE_KEY_ALIAS
            keyPassword MYAPP_RELEASE_KEY_PASSWORD
        }
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk true  // If true, also generate a universal APK
    
        }
    }
    sourceSets {
        main {
            jniLibs.srcDirs = ['src/main/jniLibs']
        }
    }
    /* packagingOptions {
         exclude '/lib/mips64/**'
         exclude '/lib/arm64-v8a/**'
         exclude '/lib/x86_64/**'
     }*/
    
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    
    }
    
    // applicationVariants are e.g. debug, release
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
            def versionCodes = ["armeabi-v7a":1, "x86":2]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }
        }
    }
    

    }

    dependencies { implementation project(':react-native-fcm') implementation fileTree(dir: "libs", include: ["*.jar"]) // implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" implementation "com.android.support:appcompat-v7:27.1.1" implementation "com.facebook.react:react-native:+" // From node_modules implementation project(':react-native-device-info')

    /*implementation 'com.android.support:multidex:1.0.0'*/
    implementation 'com.google.code.gson:gson:2.8.5'
    

    }

    // Run this once to be able to run the application with BUCK // puts all compile dependencies into folder libs for BUCK to use task copyDownloadableDepsToLibs(type: Copy) { from configurations.compile into 'libs' } apply plugin: "com.google.gms.google-services"

QC innodel
  • 33
  • 6
  • 2
    Welcome. Please read [making an MCVE](https://stackoverflow.com/help/mcve) then click `edit` to pare your code down to that users can help you, and future users can easily determine if your Q will help them. Also read [how to ask](https://stackoverflow.com/help/how-to-ask). As written, your code had serious formatting errors, and your question is unclear. Remember, everyone here is a volunteer. **Help us help you** With thousands of unanswered questions, users naturally spend their time on clear, easy to read Q's where the OP has made it easy to see and *understand the issue*. Best of Luck – SherylHohman Sep 11 '18 at 18:36
  • probably it is because of android wrong proguard – nima moradi Sep 12 '18 at 05:18
  • @nima_moradi here is my Proguard buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"} } And ProGuard rules here (ProGuard-rules.pro) -ignorewarnings -keep class com.facebook.react.cxxbridge.ModuleRegistryHolder { *; } -keep class com.facebook.react.cxxbridge.CatalystInstanceImpl { *; } -keep class com.facebook.react.cxxbridge.JavaScriptExecutor { *; } -keep class com.facebook.react.bridge.queue.NativeRunnable { *; } – QC innodel Sep 12 '18 at 05:22
  • show me proguard-android.txt – nima moradi Sep 12 '18 at 05:24
  • buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } } -@nima_moradi – QC innodel Sep 12 '18 at 05:28

0 Answers0