davidohayon669 / react-native-youtube

A <YouTube/> component for React Native.
MIT License
1.16k stars 472 forks source link

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/inprogress/reactnativeyoutube/ReactNativeYouTube #242

Open GeoffreyPlitt opened 6 years ago

GeoffreyPlitt commented 6 years ago

All of our recent (Android 7.0) devices we test on work great, but with some older devices we test using AWS Device Farm that are on Android 5.0, we see a pattern that 20% of the 100 or so devices test seem to not have system libs for YouTube or something?

We're on 1.0.0-beta3, is this fixed in 1.0.1?

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/inprogress/reactnativeyoutube/ReactNativeYouTube;
    at com.stardust.MainApplication$1.getPackages(MainApplication.java:54)
    at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:74)
    at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:41)
    at com.facebook.react.ReactActivityDelegate.loadApp(ReactActivityDelegate.java:111)
    at com.facebook.react.ReactActivityDelegate.onCreate(ReactActivityDelegate.java:100)
    at com.facebook.react.ReactActivity.onCreate(ReactActivity.java:54)
    at com.stardust.MainActivity.onCreate(MainActivity.java:58)
    at android.app.Activity.performCreate(Activity.java:6013)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2359)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2466)
    at android.app.ActivityThread.access$1200(ActivityThread.java:152)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1341)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5538)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.inprogress.reactnativeyoutube.ReactNativeYouTube" on path: DexPathList[[zip file "/data/app/com.stardust-1/base.apk"],nativeLibraryDirectories=[/data/app/com.stardust-1/lib/arm, /vendor/lib, /system/lib]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
    ... 20 more
    Suppressed: java.lang.ClassNotFoundException: com.inprogress.reactnativeyoutube.ReactNativeYouTube
        at java.lang.Class.classForName(Native Method)
        at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
        at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
        ... 21 more
    Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
GeoffreyPlitt commented 6 years ago

Related from logs:

{  
   "attachment_id":null,
   "parent_id":null,
   "timestamp":"2017-12-04T22:48:25.460061Z",
   "level":"Error",
   "pid":4674,
   "data":"Error inserting source=4 tag=offline_library_browse_fetch requires_charging=0 target_package=com.google.android.youtube source_version=11011000 required_network_type=0 flex_time=1800000 target_class=com.google.android.libraries.youtube.common.gcore.gcoreclient.gcm.impl.GcmTaskServiceDelegator runtime=1512416904401 retry_strategy={\"maximum_backoff_seconds\":{\"3600\":0},\"initial_backoff_seconds\":{\"30\":0},\"retry_policy\":{\"0\":0}} last_runtime=0 period=86400000 task_type=1 job_id=-1 user_id=0",
   "source":"Device",
   "tag":"SQLiteDatabase",
   "subtype":"Text",
   "tid":4783,
   "type":"Message",
   "id":950
},
GeoffreyPlitt commented 6 years ago

So... it crashes our app on startup when downloading youtube if the app is not installed... even if the user isn't doing anything with the lib.

GeoffreyPlitt commented 6 years ago

Noticed the requirements on the readme... but what about users who don't have youtube (other countries etc)? Is there any bandaid to prevent the crash?

GeoffreyPlitt commented 6 years ago

Related? https://stackoverflow.com/questions/30101825/youtubeplayer-together-with-appcompat-v7-library

GeoffreyPlitt commented 6 years ago

We're using compileSdkVersion=26, maybe this is the issue? https://developer.android.com/about/versions/oreo/android-8.0-changes.html#o-cl

koswarabilly commented 6 years ago

i am having the same issue which the app crash when it open, previously it doesn't happen i do not understand what is wrong