A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade AAPT2 aapt2-4.1.0-6503028-osx Daemon #0: Unexpected error during link, attempting to stop daemon. This should not happen under normal circumstances, please file an issue if it does.
while running =>npx react-native run-android get this error //android/build.gradle
buildscript {
ext {
buildToolsVersion = "33.0.0"
minSdkVersion = 21
compileSdkVersion = 34
targetSdkVersion = 34
ndkVersion = "20.1.5948944"
}
repositories {
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:4.1.0")
classpath('com.google.gms:google-services:4.3.8')
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
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")
}
google()
jcenter()
maven { url 'https://www.jitpack.io' }
}
}
I encountered this problem, and had a very similar classpath("com.android.tools.build:gradle:4.1.0") line in my build.gradle. I discovered this other question which was using classpath 'com.android.tools.build:gradle:7.4.2', which surprised me because the IDE only suggested up to version 4.2.2. I updated my AGP plugin to 7.3.1 (the latest my IDE version supported), and the app built just fine! Maybe that will help you with this inscrutable error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With