Сбой при попытке подключения к реагирующему-отладчику или Chrome - PullRequest
0 голосов
/ 10 июля 2019

После обновления нашего реактивного проекта до реактивного-родного 0.59.10 Я испытываю сбой при работе с версией Android. Приложение собирает, устанавливает и работает нормально, но вылетает при попытке подключиться к удаленному отладчику (act-native-debugger или Chrome). Это касается только Android, iOS работает нормально. Вот что adb logcat '*:E' сообщает о сбое:

7-09 18:01:10.822  9024  9115 E AndroidRuntime: Process: com.acme.ifa.debug, PID: 9024
07-09 18:01:10.822  9024  9115 E AndroidRuntime: java.lang.NoClassDefFoundError: Failed resolution of: Lio/branch/referral/util/BRANCH_STANDARD_EVENT;
07-09 18:01:10.822  9024  9115 E AndroidRuntime:        at io.branch.rnbranch.RNBranchModule.getConstants(RNBranchModule.java:262)
07-09 18:01:10.822  9024  9115 E AndroidRuntime:        at com.facebook.react.bridge.JavaModuleWrapper.getConstants(JavaModuleWrapper.java:136)
07-09 18:01:10.822  9024  9115 E AndroidRuntime:        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
07-09 18:01:10.822  9024  9115 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:873)
07-09 18:01:10.822  9024  9115 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:99)
07-09 18:01:10.822  9024  9115 E AndroidRuntime:        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
07-09 18:01:10.822  9024  9115 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:193)
07-09 18:01:10.822  9024  9115 E AndroidRuntime:        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:232)
07-09 18:01:10.822  9024  9115 E AndroidRuntime:        at java.lang.Thread.run(Thread.java:764)
07-09 18:01:10.822  9024  9115 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "io.branch.referral.util.BRANCH_STANDARD_EVENT" on path: DexPathList[[zip file "/data/app/com.acme.ifa.debug-lIhzIdDgqfx74SieP8wwnw==/base.apk"],nativeLibraryDirectories=[/data/app/com.acme.ifa.debug-lIhzIdDgqfx74SieP8wwnw==/lib/x86, /data/app/com.acme.ifa.debug-lIhzIdDgqfx74SieP8wwnw==/base.apk!/lib/x86, /system/lib]]
07-09 18:01:10.822  9024  9115 E AndroidRuntime:        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
07-09 18:01:10.822  9024  9115 E AndroidRuntime:        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
07-09 18:01:10.822  9024  9115 E AndroidRuntime:        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)

Вот некоторая информация об окружающей среде от package.json

"dependencies": {
...
"react-native-branch": "3.0.1",
...

С android/app/build.gradle

defaultConfig {
        applicationId "com.acme.ifa"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 176
        versionName "2.6.5"
        resValue "string", "build_config_package", "com.acme.ifa"
    }
    ...

buildTypes {
        debug {
            applicationIdSuffix "debug"
            multiDexEnabled false
            signingConfig signingConfigs.debug 
            resValue "string", "deployment_key", "" 
        }
        ...

С android/build.gradle:

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 21
        compileSdkVersion = 28
        targetSdkVersion = 28
        supportLibVersion = '28.0.0'
    }
    repositories {
        jcenter()
        mavenCentral()
        google()
    }
    dependencies {
        classpath('com.android.tools.build:gradle:3.4.0')
        classpath('com.google.gms:google-services:3.1.1')
    }
}

С gradle-wrapper.properties:

...
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
...

ответная информация:

  React Native Environment Info:
    System:
      OS: macOS 10.14.5
      CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
      Memory: 601.60 MB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 12.4.0 - /usr/local/bin/node
      Yarn: 1.16.0 - /usr/local/bin/yarn
      npm: 6.9.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
      Android SDK:
        API Levels: 23, 24, 25, 26, 27, 28
        Build Tools: 23.0.1, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.0, 28.0.0, 28.0.1, 28.0.2, 28.0.3
        System Images: android-25 | Google APIs Intel x86 Atom, android-25 | Google Play Intel x86 Atom, android-26 | Google APIs Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom
    IDEs:
      Android Studio: 3.4 AI-183.6156.11.34.5692245
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.3 => 16.8.3 
      react-native: 0.59.10 => 0.59.10 
    npmGlobalPackages:
      create-react-native-app: 1.0.0
      react-native-cli: 2.0.1
      react-native-git-upgrade: 0.2.7
      react-native-rename: 2.2.2

ПРИМЕЧАНИЯ:

  • перед обновлением (response-native 0.57.8 и Reaction-native-branch ^2.3.3) этого сбоя не было.
  • сбой происходит как при работе в эмуляторе, так и при работе на устройстве, подключенном через USB

ОБНОВЛЕНИЕ: зависимости от android / app / build.gradle:

dependencies {
    implementation project(path:':@react-native-community_netinfo', configuration:'default')
    implementation project(path:':react-native-webview', configuration:'default')
    implementation project(path:':mobile-orientation-lock', configuration:'default')
    implementation project(path:':react-native-detect-navbar-android', configuration:'default')
    implementation project(path:':mobile-custom-webview', configuration:'default')
    implementation project(path:':react-native-fs', configuration:'default')
    implementation project(path:':react-native-reanimated', configuration:'default')
    implementation project(path:':react-native-branch', configuration:'default')
    implementation project(path:':react-native-vector-icons', configuration:'default')
    implementation project(path:':react-native-splash-screen', configuration:'default')
    implementation project(path:':react-native-gesture-handler', configuration:'default')
    implementation project(path:':react-native-config', configuration:'default')
    implementation project(path:':react-native-linear-gradient', configuration:'default')
    implementation project(path:':react-native-immersive', configuration:'default')
    implementation project(path:':react-native-i18n', configuration:'default')
    implementation project(path:':react-native-device-info', configuration:'default')
    implementation project(path:':react-native-code-push', configuration:'default')
    implementation project(path:':react-native-camera', configuration:'default')
    implementation('com.google.zxing:core:3.3.2')
    implementation('org.jetbrains.kotlin:kotlin-stdlib:1.2.71')
    implementation('com.google.code.gson:gson:2.8.5')
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation('androidx.appcompat:appcompat:${rootProject.ext.supportLibVersion}')
    implementation('com.facebook.fresco:fresco:1.10.0')
    implementation('com.facebook.fresco:animated-gif:1.10.0')
    implementation('com.facebook.react:react-native:+')  // From node_modules
    implementation('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') {
        transitive = true
    }
    implementation('com.google.android.gms:play-services-analytics:12.0.1')
    implementation('androidx.multidex:multidex:2.0.0')
}

1 Ответ

0 голосов
/ 16 июля 2019

Я "исправил" это, удалив react-native-branch из проекта.Оказывается, мы его больше не используем, так что счастливое совпадение:)

...