Closed egonzalez-T closed 4 years ago
Can you please provide some more information in regards to your build pipeline? How did you add the Android platform and the plugin? Are you using Ionic, Ionic AppFlow, Fastlane or something similar?
I am using Ionic. I add the plugin using ionic cordova plugin add cordova-plugin-lottie-splashscreen
. Plugin version is 0.7.1
and the android prerequisites are installed
"cordova-plugin-androidx": "^1.0.2",
"cordova-plugin-androidx-adapter": "^1.0.2"
after ionic cordova build android try run: node plugins/cordova-plugin-lottie-splashscreen/hooks/android/copy_build_extras.js
That’s my idea what could be missing, too. I still have to debug, if ionic does omit the necessary hooks.
Besides that, I’m adding some more testing to the project (something like #129 but with ionic instead)
@castelar007 @timbru31 I got the same result after installing the plugin clean and then running node plugins/cordova-plugin-lottie-splashscreen/hooks/android/copy_build_extras.js
Could you possibly create a debug project which shows the issue and either push it as a git repo or provide the project as a zip file?
Ok so I think I have more clarification on the issue. I tried to create new repo and couldn't reproduce the problem. I started installing my plugins one by one thinking that it was a conflict with one of the other plugins. The problem ends up being the build-extras.gradle
with contents
android {
defaultConfig {
multiDexEnabled true
}
}
dependencies {
compile 'com.android.support:multidex:1.0.1'
}
With this file copied into app/build-extras.gradle
I encounter the issue with lottie. Any advice?
What’s the plugin name that installs these dependencies? I’ll take a look at this combo of plugins then 👍
ionic-conference-app 2.zip Here is the zip file of the test repo with the lottie plugin installed.
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
Thanks for the help!
Alright, so the problem is caused because you specify the build-extras.gradle
as a resource file. The lottie-plugin needs to enable Kotlin support in this file, too. However, during a Cordova build the file is replaced by yours, because you specify it as a resource file which the build process replaces.
Could you instead try to use, e.g., this plugin over manually enabling the multidex support via a resource-file? https://github.com/phonegap/phonegap-plugin-multidex In my test with your debug app, it worked.
That worked. Thanks for the help!
Glad that solved the issue!
@timbru31 Hi, I keep getting this error on the following environment instead:
cordova 10.0.0
cordova-android: 9.0.0
cordova-plugin-lottie-splashscreen: 0.9.1
I also tried installing plugin-enable-multidex, but nothing.
First of all, read the FAQ.md (https://github.com/timbru31/cordova-plugin-lottie-splashscreen/blob/master/FAQ.md#failure-build-failed-with-an-exception) especially the last two entries. If you can't solve it, please open a new issue and follow the issue template, thanks!
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
Version information
Please provide any additional information below.
Plugin preferences:
Checklist