BlinkID / blinkid-react-native

ID scanning for cross-platform apps built with ReactNative.
172 stars 59 forks source link

Cannot build Sample app on Android due to > Task :app:mergeDebugAssets FAILED #201

Closed hiftikha closed 1 year ago

hiftikha commented 1 year ago

I am unable to build the Sample app on Android after running the script initReactNativeSampleApp.sh to download all dependencies. The command I am using is yarn react-native run-android

`FAILURE: Build failed with an exception. What went wrong: Execution failed for task ':app:mergeDebugAssets'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Failed to transform react-native-0.71.0-rc.0-debug.aar (com.facebook.react:react-native:0.71.0-rc.0) to match attributes {artifactType=android-assets, com.android.build.api.attributes.BuildTypeAttr=debug, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}. Execution failed for JetifyTransform: /Users/hiftikhar/.gradle/caches/modules-2/files-2.1/com.facebook.react/react-native/0.71.0-rc.0/7a7f5a0af6ebd8eb94f7e5f7495e9d9684b4f543/react-native-0.71.0-rc.0-debug.aar. Java heap space`

hiftikha commented 1 year ago

Looks like the build failures for Android was due to the publish of the React Native version 0.71.0-rc0

Adding this under to project level build.gradle file resolved the issue for me:


    repositories {
        exclusiveContent {
            filter {
                includeGroup "com.facebook.react"
            }
            forRepository {
                maven {
                    url "$rootDir/../node_modules/react-native/android"
                }
            }
        }
    }
}