Skip to content

[0.48.1] [Android] Bug: no "Lcom/facebook/jni/HybridData;" field "mHybridData" in class #15621

Closed
@iegik

Description

@iegik

Is this a bug report?

yes

Have you read the Contributing Guidelines?

yes

Environment

  1. react-native -v:
    react-native-cli: 2.0.1
    react-native: 0.48.1
  2. node -v:
    v8.4.0
  3. npm -v:
    5.3.0
  4. yarn --version:

Then, specify:

  • Target Platform: Android 7.1.1 android-25
classpath 'com.android.tools.build:gradle:2.3.3' // For Android 7 (O)
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-bin.zip
android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"
    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 25
        ndk {
            // Test all dependences on x64 devices (might not work)
            // https://github.com/facebook/react-native/issues/2814
            abiFilters "armeabi-v7a", "x86"
        }
        multiDexEnabled true
        packagingOptions {
            exclude "lib/arm64-v8a/librealm-jni.so"
        }
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            // include "armeabi-v7a", "x86"
            include 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'mips', 'x86', 'x86_64'
        }
    }
    buildTypes {
        debug {
            shrinkResources true
            debuggable true
            minifyEnabled true
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro", "devsupport.pro"
            applicationIdSuffix ".debug"
        }
        release {
            shrinkResources true
            minifyEnabled true
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }
}

...

    compile "com.android.support:appcompat-v7:26.0.0-alpha1"

  • Development Operating System: macOS 10.12.6
  • Build tools:

Steps to Reproduce

(Write your steps here:)

  1. cd android && ./gradlew clean && cd ..
  2. node node_modules/react-native/local-cli/cli.js run-android
  3. Open app in Emulator

Expected Behavior

App works as in react-native v0.45.1

Actual Behavior

App crashes at start

Reproducible Demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

Fail to build an application on android-25 with ProGuard enabled

java.lang.NoSuchFieldError: no "Lcom/facebook/jni/HybridData;" field "mHybridData" in class "Lcom/facebook/react/bridge/JavaScriptExecutor;" or its superclasses
	at com.facebook.react.bridge.CatalystInstanceImpl.initializeBridge(Native Method)
	at com.facebook.react.bridge.CatalystInstanceImpl.<init>(SourceFile:114)
	at com.facebook.react.bridge.CatalystInstanceImpl.<init>(SourceFile:42)
	at com.facebook.react.bridge.CatalystInstanceImpl$b.a(SourceFile:574)
	at com.facebook.react.l.a(SourceFile:999)
	at com.facebook.react.l.a(SourceFile:109)
	at com.facebook.react.l$4.run(SourceFile:802)
	at java.lang.Thread.run(Thread.java:818)
SFEffectCache:clear(), mSize = 0

react-native-cli: 2.0.1
react-native:

latest
0.48.1
0.47.2
0.47.1
0.47.0
0.47.0-rc.3
0.46.4

Works on:
#0.45.1

Relative: #15619

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions