oblador/react-native-vector-image

Android Build Error

1mehdifaraji opened this issue · 3 comments

I installed the packages and did all the config for Android but I still get an error when npm run android :

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':klarna_react-native-vector-drawable:generateDebugRFile'.

Could not resolve all files for configuration ':klarna_react-native-vector-drawable:debugCompileClasspath'.
Could not find androidx.appcompat:appcompat:1.2.0.
Required by:
project :klarna_react-native-vector-drawable
Could not find androidx.appcompat:appcompat:1.2.0.
Required by:
project :klarna_react-native-vector-drawable > com.facebook.react:react-native:0.66.1

"dependencies": {
"@klarna/react-native-vector-drawable": "^0.3.0",
"react": "17.0.2",
"react-native": "0.66.1",
"react-native-vector-icons": "^9.0.0",
"react-native-vector-image": "^0.3.2"
},

lyqht commented

Same problem here.

Dependencies

"@klarna/react-native-vector-drawable": "^0.3.0",
"react": "17.0.2",
"react-native": "0.66.4",
"react-native-vector-image": "^0.3.2",

Here's a longer log for anyone who could help to investigate this problem.

> Task :react-native-safe-area-context:compileDebugJavaWithJavac

> Transform classes.jar (project :klarna_react-native-vector-drawable) with DexingWithClasspathTransform

> Transform classes.jar (project :react-native-flipper) with DexingWithClasspathTransform

> Transform classes.jar (project :react-native-safe-area-context) with DexingWithClasspathTransform

> Transform classes.jar (project :react-native-screens) with DexingWithClasspathTransform

> Transform classes.jar (project :react-native-async-storage_async-storage) with DexingWithClasspathTransform

> Task :app:mergeLibDexDebug FAILED

ERROR:/Users/lyqht/self-study/real-dev-squad/centauri-react-native/UserGreeter/node_modules/@klarna/react-native-vector-drawable/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar: D8: java.lang.NullPointerException
ERROR:/Users/lyqht/self-study/real-dev-squad/centauri-react-native/UserGreeter/node_modules/react-native-flipper/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar: D8: java.lang.NullPointerException
ERROR:/Users/lyqht/self-study/real-dev-squad/centauri-react-native/UserGreeter/node_modules/react-native-safe-area-context/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar: D8: java.lang.NullPointerException
ERROR:/Users/lyqht/self-study/real-dev-squad/centauri-react-native/UserGreeter/node_modules/react-native-screens/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar: D8: java.lang.NullPointerException
ERROR:/Users/lyqht/self-study/real-dev-squad/centauri-react-native/UserGreeter/node_modules/@react-native-async-storage/async-storage/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar: D8: java.lang.NullPointerException

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeLibDexDebug'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Failed to transform classes.jar (project :react-native-flipper) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, com.android.build.api.attributes.BuildTypeAttr=debug, com.android.build.api.attributes.VariantAttr=debug, dexing-enable-desugaring=true, dexing-incremental-transform=true, dexing-is-debuggable=true, dexing-min-sdk=21, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
      > Execution failed for DexingWithClasspathTransform: /Users/lyqht/self-study/real-dev-squad/centauri-react-native/UserGreeter/node_modules/react-native-flipper/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar.
         > Error while dexing.
   > Failed to transform classes.jar (project :klarna_react-native-vector-drawable) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, com.android.build.api.attributes.BuildTypeAttr=debug, com.android.build.api.attributes.VariantAttr=debug, dexing-enable-desugaring=true, dexing-incremental-transform=true, dexing-is-debuggable=true, dexing-min-sdk=21, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
      > Execution failed for DexingWithClasspathTransform: /Users/lyqht/self-study/real-dev-squad/centauri-react-native/UserGreeter/node_modules/@klarna/react-native-vector-drawable/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar.
         > Error while dexing.
   > Failed to transform classes.jar (project :react-native-async-storage_async-storage) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, com.android.build.api.attributes.BuildTypeAttr=debug, com.android.build.api.attributes.VariantAttr=debug, dexing-enable-desugaring=true, dexing-incremental-transform=true, dexing-is-debuggable=true, dexing-min-sdk=21, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
      > Execution failed for DexingWithClasspathTransform: /Users/lyqht/self-study/real-dev-squad/centauri-react-native/UserGreeter/node_modules/@react-native-async-storage/async-storage/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar.
         > Error while dexing.
   > Failed to transform classes.jar (project :react-native-safe-area-context) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, com.android.build.api.attributes.BuildTypeAttr=debug, com.android.build.api.attributes.VariantAttr=debug, dexing-enable-desugaring=true, dexing-incremental-transform=true, dexing-is-debuggable=true, dexing-min-sdk=21, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
      > Execution failed for DexingWithClasspathTransform: /Users/lyqht/self-study/real-dev-squad/centauri-react-native/UserGreeter/node_modules/react-native-safe-area-context/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar.
         > Error while dexing.
   > Failed to transform classes.jar (project :react-native-screens) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, com.android.build.api.attributes.BuildTypeAttr=debug, com.android.build.api.attributes.VariantAttr=debug, dexing-enable-desugaring=true, dexing-incremental-transform=true, dexing-is-debuggable=true, dexing-min-sdk=21, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=androidJvm}.
      > Execution failed for DexingWithClasspathTransform: /Users/lyqht/self-study/real-dev-squad/centauri-react-native/UserGreeter/node_modules/react-native-screens/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar.
         > Error while dexing.

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

* Get more help at https://help.gradle.org

BUILD FAILED in 32s

There is a newer version available of @klarna/react-native-vector-drawable, does this problem persist with it? If so can you provide a minimal reproduction?

Closing due to lack of replies