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
130 stars 51 forks source link

lottie-splashscreen is not working with Ionic5 Capacitor 2.0.0-beta.1 #188

Closed zraees closed 4 years ago

zraees commented 4 years ago

Bug report

Androidx project crash after including this plugin, Is this compatible with Ionic5 Capacitor 2.0.0-beta.1?

What steps will reproduce the problem?

create blank Ionic5 project with capacitor 2.0.0-beta.1 and install plugin using following commands npm install cordova-plugin-lottie-splashscreen npm install @ionic-native/lottie-splash-screen ionic cap sync

What do you see instead?

Application crashed.

Log file of the issue/error

error

Launching 'app' on Nexus 5X API 29 x86. $ adb shell am start -n "io.ionic.starter/io.ionic.starter.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Connected to process 18156 on device 'Nexus_5X_API_29_x86 [emulator-5554]'. Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page. W/FirebaseApp: Default FirebaseApp failed to initialize because no default options were found. This usually means that com.google.gms:google-services was not applied to your gradle project. I/FirebaseInitProvider: FirebaseApp initialization unsuccessful D/libEGL: Emulator has host GPU support, qemu.gles is set to 1. W/libc: Unable to set property "qemu.gles" to "1": connection failed; errno=13 (Permission denied) W/RenderThread: type=1400 audit(0.0:44): avc: denied { write } for name="property_service" dev="tmpfs" ino=8412 scontext=u:r:untrusted_app:s0:c136,c256,c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0 app=io.ionic.starter D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so E/o.ionic.starte: Invalid ID 0x00000000. W/o.ionic.starte: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed) W/o.ionic.starte: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed) I/WebViewFactory: Loading com.google.android.webview version 74.0.3729.185 (code 373018518) I/o.ionic.starte: The ClassLoaderContext is a special shared library. I/o.ionic.starte: The ClassLoaderContext is a special shared library. I/cr_LibraryLoader: Time to load native libraries: 22 ms (timestamps 2982-3004) E/o.ionic.starte: Invalid ID 0x00000000. E/o.ionic.starte: Invalid ID 0x00000000. I/chromium: [INFO:library_loader_hooks.cc(50)] Chromium logging enabled: level = 0, default verbosity = 0 I/cr_LibraryLoader: Expected native library version number "74.0.3729.185", actual native library version number "74.0.3729.185" W/cr_ChildProcLH: Create a new ChildConnectionAllocator with package name = com.google.android.webview, sandboxed = true W/o.ionic.starte: Accessing hidden method Landroid/content/Context;->bindServiceAsUser(Landroid/content/Intent;Landroid/content/ServiceConnection;ILandroid/os/Handler;Landroid/os/UserHandle;)Z (greylist, reflection, allowed) I/cr_BrowserStartup: Initializing chromium process, singleProcess=false W/o.ionic.starte: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker;->(Landroid/content/Context;I)V (greylist, reflection, allowed) W/o.ionic.starte: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker;->logEvent(Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;)V (greylist, reflection, allowed) Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionStarted(I)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (greylist, reflection, allowed) Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionModified(II)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (greylist, reflection, allowed) Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionModified(IILandroid/view/textclassifier/TextClassification;)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (greylist, reflection, allowed) Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionModified(IILandroid/view/textclassifier/TextSelection;)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (greylist, reflection, allowed) Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionAction(III)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (greylist, reflection, allowed) Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionAction(IIILandroid/view/textclassifier/TextClassification;)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (greylist, reflection, allowed) D/Capacitor: Starting BridgeActivity W/System.err: java.lang.ClassNotFoundException: de.dustplanet.cordova.lottie.LottieSplashScreen at java.lang.Class.classForName(Native Method) at java.lang.Class.forName(Class.java:454) at java.lang.Class.forName(Class.java:379) at org.apache.cordova.PluginManager.instantiatePlugin(PluginManager.java:489) at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:169) at org.apache.cordova.PluginManager.startupPlugins(PluginManager.java:97) at org.apache.cordova.PluginManager.init(PluginManager.java:86) at com.getcapacitor.cordova.MockCordovaWebViewImpl.init(MockCordovaWebViewImpl.java:62) W/System.err: at com.getcapacitor.BridgeActivity.load(BridgeActivity.java:75) at com.getcapacitor.BridgeActivity.init(BridgeActivity.java:58) at io.ionic.starter.MainActivity.onCreate(MainActivity.java:16) at android.app.Activity.performCreate(Activity.java:7802) at android.app.Activity.performCreate(Activity.java:7791) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409) W/System.err: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) W/System.err: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) W/System.err: at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) W/System.err: Caused by: java.lang.ClassNotFoundException: Didn't find class "de.dustplanet.cordova.lottie.LottieSplashScreen" on path: DexPathList[[zip file "/data/app/io.ionic.starter-yHMXLiK_IEzB6nqAyvgSxg==/base.apk"],nativeLibraryDirectories=[/data/app/io.ionic.starter-yHMXLiK_IEzB6nqAyvgSxg==/lib/x86, /system/lib, /system/product/lib]] W/System.err: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196) at java.lang.ClassLoader.loadClass(ClassLoader.java:379) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) ... 26 more I/System.out: Error adding plugin de.dustplanet.cordova.lottie.LottieSplashScreen. D/AndroidRuntime: Shutting down VM E/AndroidRuntime: FATAL EXCEPTION: main Process: io.ionic.starter, PID: 18156 java.lang.RuntimeException: Unable to start activity ComponentInfo{io.ionic.starter/io.ionic.starter.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 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) 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 at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:171) at org.apache.cordova.PluginManager.startupPlugins(PluginManager.java:97) at org.apache.cordova.PluginManager.init(PluginManager.java:86) at com.getcapacitor.cordova.MockCordovaWebViewImpl.init(MockCordovaWebViewImpl.java:62) at com.getcapacitor.BridgeActivity.load(BridgeActivity.java:75) at com.getcapacitor.BridgeActivity.init(BridgeActivity.java:58) at io.ionic.starter.MainActivity.onCreate(MainActivity.java:16) at android.app.Activity.performCreate(Activity.java:7802) at android.app.Activity.performCreate(Activity.java:7791) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)  at android.os.Handler.dispatchMessage(Handler.java:107)  at android.os.Looper.loop(Looper.java:214)  at android.app.ActivityThread.main(ActivityThread.java:7356)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) 

Version information

@ionic-native/lottie-splash-screen: 5.23.0 cordova-plugin-lottie-splashscreen: 0.8.0 @capacitor/core:2.0.0-beta.1 capacitor/cli: 2.0.0-beta.1 @capacitor/android: ^2.0.0-beta.1 @ionic-native/core: 5.0.0 Android Studio 3.6.1

Checklist

timbru31 commented 4 years ago

Capacitor is not supported.

alex-steinberg commented 4 years ago

Any pointers on how to get Lottie to work with Capacitor 2.0 as a splash screen?

timbru31 commented 4 years ago

I haven't tried Capacitor yet. No clue if they support installing native dependencies (lottie-ios and lottie-android) which are required for this plugin to function. Kotlin and Swift are supported out of the box AFAIK, so the hooks for Android are no problem. Since this is a Cordova plugin, it should work, at least the documentation says so.

On a personal side note: Capacitor has a very low priority for me, given that I really dislike Ionic's business model and behavior within the Cordova ecosystem and community. This means: selling an overpriced product made by a non-profit organization while giving nothing back to the original open source projects. This includes delegating their paying customers to Apache's support channels expecting that the maintainers (all unpaid volunteers) fix the bugs, while Ionic makes a sh*ton of 💰💰.

qqaimh commented 4 years ago

It should have solution

Snowbases commented 3 years ago

@timbru31 is this capable of being fixed in capacitor?

timbru31 commented 3 years ago

@timbru31 is this capable of being fixed in capacitor?

There is a bug in Capacitor: https://github.com/timbru31/cordova-plugin-lottie-splashscreen/issues/224#issuecomment-646003412

timbru31 commented 3 years ago

Good news, I've fixed the capacitor bug and it's included in v3.0.0-alpha.13 and v2.4.6 (at least for iOS)

Jrbebel commented 3 years ago

hi @timbru31,

Is the android part functional too with capacitor ?

timbru31 commented 3 years ago

@Jrbebel It should compile, yes. But it's untested from my side. Feel free to open a new issue if things are broken

Jrbebel commented 3 years ago

@timbru31 i will create a ticket for my problem on android

cemck commented 3 years ago

having the same issue on android. Is there any solution to make it work with capacitor?

TekiLakshmanSundeep commented 2 years ago

Having same issue any solution to work in android

mouse9 commented 2 years ago

Facing the same issue still. Any Updates?

rastafan commented 2 years ago

Hi, we are facing the same issue. Any news on this? Or a workaround?

katche70 commented 2 years ago

Hi, too bad, the project seems to be dead ...

vovka-s commented 2 years ago

I found the solution

Webprogr commented 10 months ago

timbru31 Thank you folks for the great work! We also never use Ionic-capacitor, always sticking to cordova last 9 years! And sometimes native. Does the lottie work for Android 33? I am trying now.