lottie-react-native: Build failed after update

After update to 2.5.0 version (from 2.3.2) build is failing.

I followed the suggestions in #204, but it did not help

unlink lottie-ios unlink lottie-react-native clean the build clean the build folder close XCode remove node modules reinstall node modules relink the 2 lotties

Here is my error:

:app:transformClassesWithDexForDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.io.IOException: Unable to create parent directories of C:\MY-PATH\MY-App\android\app\build\intermediates\pre-dexed\debug\debug_880a1d403a26662e8fd01c1b2464619f21568126.jar

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Any ideas?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 3
  • Comments: 24 (4 by maintainers)

Most upvoted comments

In app/build.gradle

add this πŸ‘

    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }

Works fine

In app/build.gradle

add this πŸ‘

    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }

Works fine

It should be inside android {…}, Thanks man πŸ‘πŸ»πŸ‘πŸ»πŸ‘πŸ»

@alexsmartens Can you try adding either one of the below to your android/app/build.gradle inside the android { ... } block and check if it works

defaultConfig {
    multiDexEnabled true
}

or

dexOptions {
    jumboMode = true
}

I had recently updated the library from 2.3.2 to the latest version 2.5.0 but didn’t face this issue. But i have the dexOptions in my gradle file.

This problem should be solved using these two lines only at least for me πŸ˜„ android/app/build.gradle

implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.android.support:design:${rootProject.ext.supportLibVersion}"
  • Insread of ${rootProject.ext.supportLibVersion} put 27.1.0 as the library I think require that version

@alexsmartens check your android/settings.gradle to make sure you don’t have duplicated entries for lottie-react-native, you should only have these two lines(for lottie):

include ':lottie-react-native'
project(':lottie-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/lottie-react-native/src/android')