0
  1. Android リリース apk は、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. そのために私は何をすべきか

このプロジェクトでは、ここで react-native-fcm と react-native-device-info を使用しています

#

  • リスト アイテム 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}" 実装 "com.android.support:appcompat-v7:27.1.1" 実装 "com.facebook.react:react-native:+" // node_modules 実装から project(':react-native-device -情報')

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

    }

    // BUCK でアプリケーションを実行できるように、これを 1 回実行します // すべてのコンパイル依存関係を BUCK のフォルダ libs に入れ、タスク copyDownloadableDepsToLibs(type: Copy) { from configurations.compile into 'libs' } apply plugin: "com. google.gms.google-services"

4

0 に答える 0