cordova-plugin-lottie-splashscreen: Android build crashes on startup

Bug report

What steps will reproduce the problem?

Install the plugin and try to run it on android device

Expected output

What do you see instead?

App crashes

Log file of the issue/error

01-03 11:34:36.548 17915 17915 W System.err: java.lang.ClassNotFoundException: de.dustplanet.cordova.lottie.LottieSplashScreen
01-03 11:34:36.548 17915 17915 W System.err: 	at java.lang.Class.classForName(Native Method)
01-03 11:34:36.548 17915 17915 W System.err: 	at java.lang.Class.forName(Class.java:400)
01-03 11:34:36.548 17915 17915 W System.err: 	at java.lang.Class.forName(Class.java:326)
01-03 11:34:36.548 17915 17915 W System.err: 	at org.apache.cordova.PluginManager.instantiatePlugin(PluginManager.java:489)
01-03 11:34:36.548 17915 17915 W System.err: 	at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:169)
01-03 11:34:36.548 17915 17915 W System.err: 	at org.apache.cordova.PluginManager.startupPlugins(PluginManager.java:97)
01-03 11:34:36.548 17915 17915 W System.err: 	at org.apache.cordova.PluginManager.init(PluginManager.java:86)
01-03 11:34:36.548 17915 17915 W System.err: 	at org.apache.cordova.CordovaWebViewImpl.init(CordovaWebViewImpl.java:117)
01-03 11:34:36.548 17915 17915 W System.err: 	at org.apache.cordova.CordovaActivity.init(CordovaActivity.java:149)
01-03 11:34:36.548 17915 17915 W System.err: 	at org.apache.cordova.CordovaActivity.loadUrl(CordovaActivity.java:224)
01-03 11:34:36.548 17915 17915 W System.err: 	at com.tranzport.sit.MainActivity.onCreate(MainActivity.java:39)
01-03 11:34:36.548 17915 17915 W System.err: 	at android.app.Activity.performCreate(Activity.java:6915)
01-03 11:34:36.548 17915 17915 W System.err: 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
01-03 11:34:36.549 17915 17915 W System.err: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2746)
01-03 11:34:36.549 17915 17915 W System.err: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2864)
01-03 11:34:36.549 17915 17915 W System.err: 	at android.app.ActivityThread.-wrap12(ActivityThread.java)
01-03 11:34:36.549 17915 17915 W System.err: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1567)
01-03 11:34:36.549 17915 17915 W System.err: 	at android.os.Handler.dispatchMessage(Handler.java:105)
01-03 11:34:36.549 17915 17915 W System.err: 	at android.os.Looper.loop(Looper.java:156)
01-03 11:34:36.549 17915 17915 W System.err: 	at android.app.ActivityThread.main(ActivityThread.java:6517)
01-03 11:34:36.549 17915 17915 W System.err: 	at java.lang.reflect.Method.invoke(Native Method)
01-03 11:34:36.549 17915 17915 W System.err: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
01-03 11:34:36.549 17915 17915 W System.err: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)
01-03 11:34:36.549 17915 17915 W System.err: Caused by: java.lang.ClassNotFoundException: Didn't find class "de.dustplanet.cordova.lottie.LottieSplashScreen" on path: DexPathList[[zip file "/data/app/com.tranzport.sit-1/base.apk"],nativeLibraryDirectories=[/data/app/com.tranzport.sit-1/lib/arm64, /data/app/com.tranzport.sit-1/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /system/vendor/lib64, /product/lib64]]
01-03 11:34:36.549 17915 17915 W System.err: 	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
01-03 11:34:36.549 17915 17915 W System.err: 	at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
01-03 11:34:36.549 17915 17915 W System.err: 	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
01-03 11:34:36.549 17915 17915 W System.err: 	... 23 more
01-03 11:34:36.549 17915 17915 I System.out: Error adding plugin de.dustplanet.cordova.lottie.LottieSplashScreen.
01-03 11:34:36.552 17915 17915 E AndroidRuntime: FATAL EXCEPTION: main
01-03 11:34:36.552 17915 17915 E AndroidRuntime: Process: com.tranzport.sit, PID: 17915
01-03 11:34:36.552 17915 17915 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tranzport.sit/com.tranzport.sit.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

Version information

Ionic:

   Ionic CLI                     : 5.4.4 
   Ionic Framework               : @ionic/angular 4.7.0
   @angular-devkit/build-angular : 0.801.1
   @angular-devkit/schematics    : 8.1.1
   @angular/cli                  : 8.1.1
   @ionic/angular-toolkit        : 2.0.0

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 8.1.0, browser 5.0.4, ios 5.1.1
   Cordova Plugins   : cordova-plugin-ionic-webview 2.5.3, (and 28 other plugins)

Utility:

   cordova-res : 0.8.1
   native-run  : 0.2.9 (update available: 0.3.0)

System:

   Android SDK Tools : 26.1.1
   ios-deploy        : 1.9.4
   ios-sim           : 6.1.3
   NodeJS            : v10.16.0 (/usr/local/bin/node)
   npm               : 6.11.3
   OS                : macOS Mojave
   Xcode             : Xcode 11.2 Build version 11B52

Please provide any additional information below.

Plugin preferences:

   <preference name="LottieAnimationLocation" value="www/assets/splash.json" />
    <preference name="LottieWidth" value="350" />
    <preference name="LottieHeight" value="350" />
    <preference name="LottieHideTimeout" value="5" />
    <preference name="LottieAutoHideSplashScreen" value="false" />
    <preference name="SwiftVersion" value="4.2" />

Checklist

  • If there is a (potential) plugin conflict, I’ve identified the conflicting plugin
  • I have added a valid version output
  • I have attached necessary information like a screenshot, example project or videos

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

ionic-conference-app 2.zip Here is the zip file of the test repo with the lottie plugin installed. Screen Shot 2020-01-10 at 3 14 43 PM

Note the app crashes when the build-extras.gradle is included through <resource-file src="build-extras.gradle" target="app/build-extras.gradle" />

The only thing the build.gradle-extras file is doing is enabling multidex