Fresh React Native CLI init project does not work on Android with a Mac M1 Max
See original GitHub issueDescription
I have a Mac m1 Max, trying to get a fresh project running,it is runing IOS without problem, but no luck on android, the error message I’m getting is the following when trying to build and run using react-native run-android --verbose The following errors are reported:
I did install java with sdkman:
<div class="adn ads" style="display:" data-message-id="#msg-a:r-4687037384327993384" data-legacy-message-id="17eb339b2b1baf40"><div class="gs"><div class=""><div id=":oh" class="ii gt" jslog="20277; u014N:xr6bB; 4:W251bGwsbnVsbCxbXV0."><div id=":og" class="a3s aiL "><div dir="ltr">| 8.0.322 | zulu | installed | 8.0.322-zulu
<span style="font-variant-ligatures:no-common-ligatures"></span>
<span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">error</span><span style="font-variant-ligatures:no-common-ligatures"> Failed to install the app. Make sure you have the Android development environment set up: </span><span style="text-decoration:underline;font-variant-ligatures:no-common-ligatures;color:rgb(153,153,153)">https://reactnative.dev/docs/<wbr>environment-setup</span><span style="font-variant-ligatures:no-common-ligatures">.</span>
<span style="font-variant-ligatures:no-common-ligatures">Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=<wbr>8081</span>
<span style="font-variant-ligatures:no-common-ligatures">Warning: Mapping new ns http://schemas.android.com/<wbr>repository/android/common/02 to old ns http://schemas.android.com/<wbr>repository/android/common/01</span>
<span style="font-variant-ligatures:no-common-ligatures">Warning: Mapping new ns http://schemas.android.com/<wbr>repository/android/generic/02 to old ns http://schemas.android.com/<wbr>repository/android/generic/01</span>
<span style="font-variant-ligatures:no-common-ligatures">Warning: Mapping new ns http://schemas.android.com/<wbr>sdk/android/repo/addon2/02 to old ns http://schemas.android.com/<wbr>sdk/android/repo/addon2/01</span>
<span style="font-variant-ligatures:no-common-ligatures">Warning: Mapping new ns http://schemas.android.com/<wbr>sdk/android/repo/addon2/03 to old ns http://schemas.android.com/<wbr>sdk/android/repo/addon2/01</span>
<span style="font-variant-ligatures:no-common-ligatures">Warning: Mapping new ns http://schemas.android.com/<wbr>sdk/android/repo/repository2/<wbr>02 to old ns http://schemas.android.com/<wbr>sdk/android/repo/repository2/<wbr>01</span>
<span style="font-variant-ligatures:no-common-ligatures">Warning: Mapping new ns http://schemas.android.com/<wbr>sdk/android/repo/repository2/<wbr>03 to old ns http://schemas.android.com/<wbr>sdk/android/repo/repository2/<wbr>01</span>
<span style="font-variant-ligatures:no-common-ligatures">Warning: Mapping new ns http://schemas.android.com/<wbr>sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/<wbr>sdk/android/repo/sys-img2/01</span>
<span style="font-variant-ligatures:no-common-ligatures">Warning: Mapping new ns http://schemas.android.com/<wbr>sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/<wbr>sdk/android/repo/sys-img2/01</span>
<span style="font-variant-ligatures:no-common-ligatures">Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}<wbr>api-level></span>
<span style="font-variant-ligatures:no-common-ligatures"></span>
<span style="font-variant-ligatures:no-common-ligatures">FAILURE: Build failed with an exception.</span>
<span style="font-variant-ligatures:no-common-ligatures"></span>
<span style="font-variant-ligatures:no-common-ligatures">* What went wrong:</span>
<span style="font-variant-ligatures:no-common-ligatures">Execution failed for task ':app:processDebugResources'.</span>
<span style="font-variant-ligatures:no-common-ligatures">> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>> Failed to transform appcompat-1.3.0.aar (androidx.appcompat:appcompat:<wbr>1.3.0) to match attributes {artifactType=android-<wbr>compiled-dependencies-<wbr>resources, org.gradle.category=library, org.gradle.dependency.<wbr>bundling=external, org.gradle.libraryelements=<wbr>aar, org.gradle.status=release, org.gradle.usage=java-runtime}<wbr>.</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>> Execution failed for AarResourcesCompilerTransform: /Users/xlan/.gradle/caches/<wbr>transforms-3/<wbr>d7f19fb48ed68be2921ae87dc8e58f<wbr>8e/transformed/appcompat-1.3.<wbr>0.</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>> AAPT2 aapt2-4.2.2-7147631-osx Daemon #1: Daemon startup failed</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>This should not happen under normal circumstances, please file an issue if it does.</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>> Failed to transform core-1.5.0.aar (androidx.core:core:1.5.0) to match attributes {artifactType=android-<wbr>compiled-dependencies-<wbr>resources, org.gradle.status=release}.</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>> Execution failed for AarResourcesCompilerTransform: /Users/xlan/.gradle/caches/<wbr>transforms-3/<wbr>540dbfb90b248d7b59cd154497c15f<wbr>99/transformed/core-1.5.0.</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>> AAPT2 aapt2-4.2.2-7147631-osx Daemon #0: Daemon startup failed</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>This should not happen under normal circumstances, please file an issue if it does.</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>> Failed to transform core-1.5.0.aar (androidx.core:core:1.5.0) to match attributes {artifactType=android-<wbr>compiled-dependencies-<wbr>resources, org.gradle.category=library, org.gradle.dependency.<wbr>bundling=external, org.gradle.libraryelements=<wbr>aar, org.gradle.status=release, org.gradle.usage=java-runtime}<wbr>.</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>> Execution failed for AarResourcesCompilerTransform: /Users/xlan/.gradle/caches/<wbr>transforms-3/<wbr>540dbfb90b248d7b59cd154497c15f<wbr>99/transformed/core-1.5.0.</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>> AAPT2 aapt2-4.2.2-7147631-osx Daemon #0: Daemon startup failed</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>This should not happen under normal circumstances, please file an issue if it does.</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>> Failed to transform core-1.5.0.aar (androidx.core:core:1.5.0) to match attributes {artifactType=android-<wbr>compiled-dependencies-<wbr>resources, org.gradle.status=release}.</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>> Execution failed for AarResourcesCompilerTransform: /Users/xlan/.gradle/caches/<wbr>transforms-3/<wbr>540dbfb90b248d7b59cd154497c15f<wbr>99/transformed/core-1.5.0.</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>> AAPT2 aapt2-4.2.2-7147631-osx Daemon #0: Daemon startup failed</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>This should not happen under normal circumstances, please file an issue if it does.</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>> Failed to transform core-1.5.0.aar (androidx.core:core:1.5.0) to match attributes {artifactType=android-<wbr>compiled-dependencies-<wbr>resources, org.gradle.status=release}.</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>> Execution failed for AarResourcesCompilerTransform: /Users/xlan/.gradle/caches/<wbr>transforms-3/<wbr>540dbfb90b248d7b59cd154497c15f<wbr>99/transformed/core-1.5.0.</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>> AAPT2 aapt2-4.2.2-7147631-osx Daemon #0: Daemon startup failed</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>This should not happen under normal circumstances, please file an issue if it does.</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>> Failed to transform core-1.5.0.aar (androidx.core:core:1.5.0) to match attributes {artifactType=android-<wbr>compiled-dependencies-<wbr>resources, org.gradle.status=release}.</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>> Execution failed for AarResourcesCompilerTransform: /Users/xlan/.gradle/caches/<wbr>transforms-3/<wbr>540dbfb90b248d7b59cd154497c15f<wbr>99/transformed/core-1.5.0.</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>> AAPT2 aapt2-4.2.2-7147631-osx Daemon #0: Daemon startup failed</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>This should not happen under normal circumstances, please file an issue if it does.</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>> Failed to transform core-1.5.0.aar (androidx.core:core:1.5.0) to match attributes {artifactType=android-<wbr>compiled-dependencies-<wbr>resources, org.gradle.status=release}.</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>> Execution failed for AarResourcesCompilerTransform: /Users/xlan/.gradle/caches/<wbr>transforms-3/<wbr>540dbfb90b248d7b59cd154497c15f<wbr>99/transformed/core-1.5.0.</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>> AAPT2 aapt2-4.2.2-7147631-osx Daemon #0: Daemon startup failed</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>This should not happen under normal circumstances, please file an issue if it does.</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>> Failed to transform core-1.5.0.aar (androidx.core:core:1.5.0) to match attributes {artifactType=android-<wbr>compiled-dependencies-<wbr>resources, org.gradle.status=release}.</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>> Execution failed for AarResourcesCompilerTransform: /Users/xlan/.gradle/caches/<wbr>transforms-3/<wbr>540dbfb90b248d7b59cd154497c15f<wbr>99/transformed/core-1.5.0.</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>> AAPT2 aapt2-4.2.2-7147631-osx Daemon #0: Daemon startup failed</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>This should not happen under normal circumstances, please file an issue if it does.</span>
<span style="font-variant-ligatures:no-common-ligatures"></span>
<span style="font-variant-ligatures:no-common-ligatures">* Try:</span>
<span style="font-variant-ligatures:no-common-ligatures">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.</span>
<span style="font-variant-ligatures:no-common-ligatures"></span>
<span style="font-variant-ligatures:no-common-ligatures">* Get more help at https://help.gradle.org</span>
<span style="font-variant-ligatures:no-common-ligatures"></span>
<span style="font-variant-ligatures:no-common-ligatures">BUILD FAILED in 16m 10s</span>
<span style="font-variant-ligatures:no-common-ligatures"></span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>at makeError (/Users/xlan/projects/<wbr>baredemo/node_modules/execa/<wbr>index.js:174:9)</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>at /Users/xlan/projects/baredemo/<wbr>node_modules/execa/index.js:<wbr>278:16</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>at processTicksAndRejections (node:internal/process/task_<wbr>queues:96:5)</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>at async runOnAllDevices (/Users/xlan/projects/<wbr>baredemo/node_modules/@react-<wbr>native-community/cli-platform-<wbr>android/build/commands/<wbr>runAndroid/runOnAllDevices.js:<wbr>109:5)</span>
<span style="font-variant-ligatures:no-common-ligatures"><span> </span>at async Command.handleAction (/Users/xlan/projects/<wbr>baredemo/node_modules/@react-<wbr>native-community/cli/build/<wbr>index.js:192:9)</span>
</div><div class="yj6qo"></div><div class="adL"> </div></div></div><div class="hi"></div></div></div><div class="ajx"></div></div><div class="gA gt acV"><div class="gB xu"><div class="ip iq"><div id=":oi"> </div></div></div></div>Version
0.67.1
Output of npx react-native info
info Fetching system and libraries information…
(node:10552) Warning: Accessing non-existent property ‘padLevels’ of module exports inside circular dependency
(Use node --trace-warnings ...
to show where the warning was created)
System:
OS: macOS 12.2
CPU: (10) arm64 Apple M1 Max
Memory: 32.65 GB / 64.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 17.4.0 - /opt/homebrew/bin/node
Yarn: 1.22.17 - /opt/homebrew/bin/yarn
npm: 8.3.1 - /opt/homebrew/bin/npm
Watchman: 2022.01.24.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.2 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
Android SDK:
API Levels: 30, 31, 32
Build Tools: 30.0.2, 32.0.0, 32.1.0
System Images: android-32 | Google APIs ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2021.1 AI-211.7628.21.2111.8092744
Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_322 - /Users/xlan/.sdkman/candidates/java/current/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.67.1 => 0.67.1
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
react-native init baredemo cd baredemo react-native run-android --verbose
Snack, code example, screenshot, or link to a repository
my android/build.grade
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { ext { buildToolsVersion = “30.0.2” minSdkVersion = 29 compileSdkVersion = 30 targetSdkVersion = 30 ndkVersion = “21.4.7075529” } repositories { google() mavenCentral() jcenter() } dependencies { classpath(“com.android.tools.build:gradle:4.2.2”) // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } }
allprojects { repositories { maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url(“$rootDir/…/node_modules/react-native/android”) } maven { // Android JSC is installed from npm url(“$rootDir/…/node_modules/jsc-android/dist”) } mavenCentral { // We don’t want to fetch react-native from Maven Central as there are // older versions over there. content { excludeGroup “com.facebook.react” } } google() maven { url ‘https://www.jitpack.io’ } jcenter() } }
my android/app/build.grade
apply plugin: “com.android.application”
import com.android.build.OutputFile
/**
- The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
- and bundleReleaseJsAndAssets).
- These basically call
react-native bundle
with the correct arguments during the Android build - cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
- bundle directly from the development server. Below you can see all the possible configurations
- and their defaults. If you decide to add a configuration block, make sure to add it before the
apply from: "../../node_modules/react-native/react.gradle"
line.- project.ext.react = [
- // the name of the generated asset file containing your JS bundle
- bundleAssetName: “index.android.bundle”,
- // the entry file for bundle generation. If none specified and
- // “index.android.js” exists, it will be used. Otherwise “index.js” is
- // default. Can be overridden with ENTRY_FILE environment variable.
- entryFile: “index.android.js”,
- // https://reactnative.dev/docs/performance#enable-the-ram-format
- bundleCommand: “ram-bundle”,
- // whether to bundle JS and assets in debug mode
- bundleInDebug: false,
- // whether to bundle JS and assets in release mode
- bundleInRelease: true,
- // whether to bundle JS and assets in another build variant (if configured).
- // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
- // The configuration property can be in the following formats
- // ‘bundleIn${productFlavor}${buildType}’
- // ‘bundleIn${buildType}’
- // bundleInFreeDebug: true,
- // bundleInPaidRelease: true,
- // bundleInBeta: true,
- // whether to disable dev mode in custom build variants (by default only disabled in release)
- // for example: to disable dev mode in the staging build type (if configured)
- devDisabledInStaging: true,
- // The configuration property can be in the following formats
- // ‘devDisabledIn${productFlavor}${buildType}’
- // ‘devDisabledIn${buildType}’
- // the root of your project, i.e. where “package.json” lives
- root: “…/…/”,
- // where to put the JS bundle asset in debug mode
- jsBundleDirDebug: “$buildDir/intermediates/assets/debug”,
- // where to put the JS bundle asset in release mode
- jsBundleDirRelease: “$buildDir/intermediates/assets/release”,
- // where to put drawable resources / React Native assets, e.g. the ones you use via
- // require(‘./image.png’)), in debug mode
- resourcesDirDebug: “$buildDir/intermediates/res/merged/debug”,
- // where to put drawable resources / React Native assets, e.g. the ones you use via
- // require(‘./image.png’)), in release mode
- resourcesDirRelease: “$buildDir/intermediates/res/merged/release”,
- // by default the gradle tasks are skipped if none of the JS files or assets change; this means
- // that we don’t look at files in android/ or ios/ to determine whether the tasks are up to
- // date; if you have any other folders that you want to ignore for performance reasons (gradle
- // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
- // for example, you might want to remove it from here.
- inputExcludes: [“android/", "ios/”],
- // override which node gets called and with what additional arguments
- nodeExecutableAndArgs: [“node”],
- // supply additional arguments to the packager
- extraPackagerArgs: []
- ] */
project.ext.react = [ enableHermes: false, // clean and rebuild if changing ]
apply from: “…/…/node_modules/react-native/react.gradle”
/**
- Set this to true to create two separate APKs instead of one:
-
- An APK that only works on ARM devices
-
- An APK that only works on x86 devices
- The advantage is the size of the APK is reduced by about 4MB.
- Upload all the APKs to the Play Store and people will download
- the correct one based on the CPU architecture of their device. */ def enableSeparateBuildPerCPUArchitecture = false
/**
- Run Proguard to shrink the Java bytecode in release builds. */ def enableProguardInReleaseBuilds = false
/**
- The preferred build flavor of JavaScriptCore.
- For example, to use the international variant, you can use:
def jscFlavor = 'org.webkit:android-jsc-intl:+'
- The international variant includes ICU i18n library and necessary data
- allowing to use e.g.
Date.toLocaleString
andString.localeCompare
that - give correct results when using with locales other than en-US. Note that
- this variant is about 6MiB larger per architecture than default. */ def jscFlavor = ‘org.webkit:android-jsc:+’
/**
- Whether to enable the Hermes VM.
- This should be set on project.ext.react and that value will be read here. If it is not set
- on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
- and the benefits of using Hermes will therefore be sharply reduced. */ def enableHermes = project.ext.react.get(“enableHermes”, false);
/**
- Architectures to build native code for in debug. */ def nativeArchitectures = project.getProperties().get(“reactNativeDebugArchitectures”)
android { ndkVersion rootProject.ext.ndkVersion
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "com.baredemo"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
if (nativeArchitectures) {
ndk {
abiFilters nativeArchitectures.split(',')
}
}
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.debug
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// https://developer.android.com/studio/build/configure-apk-splits.html
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
}
}
}
}
dependencies { implementation fileTree(dir: “libs”, include: [“*.jar”]) //noinspection GradleDynamicVersion implementation “com.facebook.react:react-native:+” // From node_modules
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
}
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
exclude group:'com.squareup.okhttp3', module:'okhttp'
}
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
}
if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
} else {
implementation jscFlavor
}
}
// Run this once to be able to run the application with BUCK // puts all compile dependencies into folder libs for BUCK to use task copyDownloadableDepsToLibs(type: Copy) { from configurations.implementation into ‘libs’ }
apply from: file(“…/…/node_modules/@react-native-community/cli-platform-android/native_modules.gradle”); applyNativeModulesAppBuildGradle(project)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (2 by maintainers)
Ok I did change on my baredemo/android/gradle/wrapper/gradle-wrapper.properties this line distributionUrl=https://services.gradle.org/distributions/gradle-7.4-all.zip
to use the latest gradle version
and in this file baredemo/android/build.gradle
I did change this line classpath(“com.android.tools.build:gradle:7.1.0”)
to use the plugin as you suggested.
One thing I don’t quite get if the plugin version is the same as the gradle version, and what version should we use.
But after cleaning my gradle folder -rf ~/.gradle
I did try again the build using react-native run-android --verbose and It works. Thanks a lot, I know need to try these with another project or and old proyect and see what is going on.
i just curious this happen for my m1 2020 ram 16. it had been solved by upgrade these classpath(“com.android.tools.build:gradle:7.2.1”)
distributionUrl=https://services.gradle.org/distributions/gradle-7.5.1-all.zip
the error caused by this version
classpath(“com.android.tools.build:gradle:4.2.2”)
allprojects { repositories { exclusiveContent { // We get React Native’s Android binaries exclusively through npm, // from a local Maven repo inside node_modules/react-native/. // (The use of exclusiveContent prevents looking elsewhere like Maven Central // and potentially getting a wrong version.) filter { includeGroup “com.facebook.react” } forRepository { maven { // NOTE: if you are in a monorepo, you may have “$rootDir/…/…/…/node_modules/react-native/android” url “$rootDir/…/node_modules/react-native/android” } } } … } }
distributionUrl=https://services.gradle.org/distributions/gradle-6.9-all.zip
But my colleagues m1 not occur this error