1

When I test my React Native app on Android 4.4.2, I get the stack trace at the bottom of this post. This is my build config:

compileSdkVersion 23
    buildToolsVersion '25.0.3'

    defaultConfig {
        applicationId "... my app name ..."
        multiDexEnabled true
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 30000
        versionName "3.0.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }

This is the stacktrace:

05-31 11:20:05.692  5789  5789 E AndroidRuntime: java.lang.NoClassDefFoundError: com.facebook.R$style
05-31 11:20:05.692  5789  5789 E AndroidRuntime:    at com.facebook.FacebookSdk.<clinit>(FacebookSdk.java:87)
05-31 11:20:05.692  5789  5789 E AndroidRuntime:    at com.facebook.internal.FacebookInitProvider.onCreate(FacebookInitProvider.java:20)
05-31 11:20:05.692  5789  5789 E AndroidRuntime:    at android.content.ContentProvider.attachInfo(ContentProvider.java:1591)
05-31 11:20:05.692  5789  5789 E AndroidRuntime:    at android.content.ContentProvider.attachInfo(ContentProvider.java:1562)
05-31 11:20:05.692  5789  5789 E AndroidRuntime:    at android.app.ActivityThread.installProvider(ActivityThread.java:5118)
05-31 11:20:05.692  5789  5789 E AndroidRuntime:    at android.app.ActivityThread.installContentProviders(ActivityThread.java:4713)
05-31 11:20:05.692  5789  5789 E AndroidRuntime:    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4596)
05-31 11:20:05.692  5789  5789 E AndroidRuntime:    at android.app.ActivityThread.access$1600(ActivityThread.java:169)
05-31 11:20:05.692  5789  5789 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1340)
05-31 11:20:05.692  5789  5789 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:102)
05-31 11:20:05.692  5789  5789 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:146)
05-31 11:20:05.692  5789  5789 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:5487)
05-31 11:20:05.692  5789  5789 E AndroidRuntime:    at java.lang.reflect.Method.invokeNative(Native Method)
05-31 11:20:05.692  5789  5789 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Method.java:515)
05-31 11:20:05.692  5789  5789 E AndroidRuntime:    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
05-31 11:20:05.692  5789  5789 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
05-31 11:20:05.692  5789  5789 E AndroidRuntime:    at dalvik.system.NativeStart.main(Native Method)

I already tried to add com.android.support:multidex:1.0.0 to my gradle dependencies (mentioned here: Why My android app crashes as soon as I open it in device 4.4.3 but not in device 5.0 or above), but that did not help.

Gersom
  • 651
  • 3
  • 19
  • Could you try and align your `compileSdkVersion` and `buildToolsVersion`? Set the latter to `23.0.3` – G0dsquad Jun 07 '17 at 09:04
  • > The SDK Build Tools revision (23.0.3) is too low for project ':app'. Minimum required is 25.0.0 – Gersom Jun 07 '17 at 09:17
  • Is your project 'app'? That usually occurs when dependencies have a higher version requirement, these are normally lower down in the build.gradle -> e.g. `compile "com.android.support:appcompat-v7:23.0.1"`. If you have any relevant ones try changing them. – G0dsquad Jun 07 '17 at 09:20
  • Does not solve it unfortunately... To what do you suggest changing those versions? I also tried to set everything to highest version. It does work on everything android 6+ – Gersom Jun 07 '17 at 10:50
  • This is class not found exception. Have you followed all steps correctly for adding facebook sdk. https://github.com/facebook/react-native-fbsdk – Ankit Aggarwal Jun 07 '17 at 19:30
  • I tried it now in debug mode in an emulator... This is more descriptive: `Caused by: java.lang.ClassNotFoundException: Didn't find class "com.my.appname.MainActivity" on path: DexPathList[[zip file "/data/app/com.my.appname-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.my.appname-1, /system/lib]]` This is my manifest.xml: `... package="com.my.appname" ...` `... android:name=".MainApplication" ...` – Gersom Jun 12 '17 at 12:35
  • @Gersom did you fix it? i have same issue. – Ömer Faruk Aplak Nov 02 '17 at 07:56

0 Answers0