timbru31 / cordova-plugin-lottie-splashscreen

🐣 🎬 📱 Apache Cordova plugin to show Lottie animations as the splash screen with Airbnb's Lottie wrapper
https://www.npmjs.com/package/cordova-plugin-lottie-splashscreen
MIT License
131 stars 55 forks source link

Running lottie splashscreen plugin on IONIC 5 #234

Closed briquetech closed 4 years ago

briquetech commented 4 years ago

Bug report

I have installed this plugin for IONIC5. The app crashes.

What steps will reproduce the problem?

In a new IONIC project

  1. Installed the lottie splashscreen plugin
  2. Added the platform->android
  3. Tried to build

Expected output

Successful build

What do you see instead?

Error as stated

Log file of the issue/error

08-21 00:21:05.495 5143 5143 W System.err: java.lang.ClassNotFoundException: de.dustplanet.cordova.lottie.LottieSplashScreen 08-21 00:21:05.496 5143 5143 W System.err: at java.lang.Class.classForName(Native Method) 08-21 00:21:05.497 5143 5143 W System.err: at java.lang.Class.forName(Class.java:454) 08-21 00:21:05.497 5143 5143 W System.err: at java.lang.Class.forName(Class.java:379) 08-21 00:21:05.497 5143 5143 W System.err: at org.apache.cordova.PluginManager.instantiatePlugin(PluginManager.java:489) 08-21 00:21:05.497 5143 5143 W System.err: at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:169) 08-21 00:21:05.497 5143 5143 W System.err: at org.apache.cordova.PluginManager.startupPlugins(PluginManager.java:97) 08-21 00:21:05.497 5143 5143 W System.err: at org.apache.cordova.PluginManager.init(PluginManager.java:86) 08-21 00:21:05.497 5143 5143 W System.err: at org.apache.cordova.CordovaWebViewImpl.init(CordovaWebViewImpl.java:117) 08-21 00:21:05.497 5143 5143 W System.err: at org.apache.cordova.CordovaActivity.init(CordovaActivity.java:149) 08-21 00:21:05.497 5143 5143 W System.err: at org.apache.cordova.CordovaActivity.loadUrl(CordovaActivity.java:224) 08-21 00:21:05.497 5143 5143 W System.err: at in.happynessfactory.hfappuat.MainActivity.onCreate(MainActivity.java:39) 08-21 00:21:05.497 5143 5143 W System.err: at android.app.Activity.performCreate(Activity.java:7815) 08-21 00:21:05.497 5143 5143 W System.err: at android.app.Activity.performCreate(Activity.java:7804) 08-21 00:21:05.497 5143 5143 W System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1318) 08-21 00:21:05.497 5143 5143 W System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3349) 08-21 00:21:05.497 5143 5143 W System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3513) 08-21 00:21:05.497 5143 5143 W System.err: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) 08-21 00:21:05.497 5143 5143 W System.err: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 08-21 00:21:05.497 5143 5143 W System.err: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 08-21 00:21:05.497 5143 5143 W System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2109) 08-21 00:21:05.497 5143 5143 W System.err: at android.os.Handler.dispatchMessage(Handler.java:107) 08-21 00:21:05.497 5143 5143 W System.err: at android.os.Looper.loop(Looper.java:214) 08-21 00:21:05.497 5143 5143 W System.err: at android.app.ActivityThread.main(ActivityThread.java:7682) 08-21 00:21:05.497 5143 5143 W System.err: at java.lang.reflect.Method.invoke(Native Method) 08-21 00:21:05.497 5143 5143 W System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516) 08-21 00:21:05.497 5143 5143 W System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) 08-21 00:21:05.501 5143 5143 W System.err: Caused by: java.lang.ClassNotFoundException: Didn't find class "de.dustplanet.cordova.lottie.LottieSplashScreen" on path: DexPathList[[zip file "/data/app/in.happynessfactory.hfappuat-OW3cu4pwRq6Q32sOi7CKCw==/base.apk"],nativeLibraryDirectories=[/data/app/in.happynessfactory.hfappuat-OW3cu4pwRq6Q32sOi7CKCw==/lib/arm64, /system/lib64, /system/product/lib64]] 08-21 00:21:05.501 5143 5143 W System.err: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196) 08-21 00:21:05.501 5143 5143 W System.err: at java.lang.ClassLoader.loadClass(ClassLoader.java:379) 08-21 00:21:05.501 5143 5143 W System.err: at java.lang.ClassLoader.loadClass(ClassLoader.java:312) 08-21 00:21:05.501 5143 5143 W System.err: ... 26 more 08-21 00:21:05.501 5143 5143 I System.out: Error adding plugin de.dustplanet.cordova.lottie.LottieSplashScreen. 08-21 00:21:05.501 5143 5143 D AndroidRuntime: Shutting down VM 08-21 00:21:05.502 5143 5143 E AndroidRuntime: FATAL EXCEPTION: main 08-21 00:21:05.502 5143 5143 E AndroidRuntime: Process: in.happynessfactory.hfappuat, PID: 5143 08-21 00:21:05.502 5143 5143 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{in.happynessfactory.hfappuat/in.happynessfactory.hfappuat.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CordovaPlugin.privateInitialize(java.lang.String, org.apache.cordova.CordovaInterface, org.apache.cordova.CordovaWebView, org.apache.cordova.CordovaPreferences)' on a null object reference 08-21 00:21:05.502 5143 5143 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3374) 08-21 00:21:05.502 5143 5143 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3513) 08-21 00:21:05.502 5143 5143 E AndroidRuntime: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) 08-21 00:21:05.502 5143 5143 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 08-21 00:21:05.502 5143 5143 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 08-21 00:21:05.502 5143 5143 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2109) 08-21 00:21:05.502 5143 5143 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:107) 08-21 00:21:05.502 5143 5143 E AndroidRuntime: at android.os.Looper.loop(Looper.java:214) 08-21 00:21:05.502 5143 5143 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7682) 08-21 00:21:05.502 5143 5143 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 08-21 00:21:05.502 5143 5143 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516) 08-21 00:21:05.502 5143 5143 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) 08-21 00:21:05.502 5143 5143 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CordovaPlugin.privateInitialize(java.lang.String, org.apache.cordova.CordovaInterface, org.apache.cordova.CordovaWebView, org.apache.cordova.CordovaPreferences)' on a null object reference 08-21 00:21:05.502 5143 5143 E AndroidRuntime: at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:171) 08-21 00:21:05.502 5143 5143 E AndroidRuntime: at org.apache.cordova.PluginManager.startupPlugins(PluginManager.java:97) 08-21 00:21:05.502 5143 5143 E AndroidRuntime: at org.apache.cordova.PluginManager.init(PluginManager.java:86) 08-21 00:21:05.502 5143 5143 E AndroidRuntime: at org.apache.cordova.CordovaWebViewImpl.init(CordovaWebViewImpl.java:117) 08-21 00:21:05.502 5143 5143 E AndroidRuntime: at org.apache.cordova.CordovaActivity.init(CordovaActivity.java:149) 08-21 00:21:05.502 5143 5143 E AndroidRuntime: at org.apache.cordova.CordovaActivity.loadUrl(CordovaActivity.java:224) 08-21 00:21:05.502 5143 5143 E AndroidRuntime: at in.happynessfactory.hfappuat.MainActivity.onCreate(MainActivity.java:39) 08-21 00:21:05.502 5143 5143 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:7815) 08-21 00:21:05.502 5143 5143 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:7804) 08-21 00:21:05.502 5143 5143 E AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1318) 08-21 00:21:05.502 5143 5143 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3349) 08-21 00:21:05.502 5143 5143 E AndroidRuntime: ... 11 more

Version information

Ionic:

Ionic CLI : 5.4.16 (/usr/local/lib/node_modules/ionic) Ionic Framework : @ionic/angular 5.3.1 @angular-devkit/build-angular : 0.901.12 @angular-devkit/schematics : 9.1.12 @angular/cli : 9.1.12 @ionic/angular-toolkit : 2.3.1

Cordova:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1) Cordova Platforms : android 8.1.0 Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 15 other plugins)

Utility:

cordova-res : not installed native-run : not installed

System:

Android SDK Tools : 26.1.1 (/home/neeta/android-sdk) NodeJS : v14.0.0 (/usr/local/bin/node) npm : 6.14.6 OS : Linux 4.15

Please provide any additional information below.

Checklist

timbru31 commented 4 years ago

Have you configured AndroidX support?

timbru31 commented 4 years ago

Also, please note the following:

Android (with cordova-android >= 9.0.0 only)

It seems you are using an old Cordova-Android version.

ajay-a1 commented 4 years ago

Will this plugin work with capacitor?

timbru31 commented 4 years ago

If Capacitor fixes their bugs: maybe.

ajay-a1 commented 4 years ago

Any workaround till they fix the issues? Any specific issue which needs fixing?

Getting below error: "java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CordovaPlugin.privateInitialize(java.lang.String, org.apache.cordova.CordovaInterface, org.apache.cordova.CordovaWebView, org.apache.cordova.CordovaPreferences)' on a null object reference"

timbru31 commented 4 years ago

Please do not hijack this issue - create a new one and follow the issue template.

timbru31 commented 4 years ago

Closing due to lack of feedback.