Reputation: 41
React Native version 63.5,
AAPT2 aapt2-4.1.3-6503028-osx Daemon #0: Unexpected error during link, attempting to stop daemon. This should not happen under normal circumstances.
Even after undoing the changes and removing the aforementioned line, i am still facing the same error repeatedly.I have attempted cleaning the project, rebuilding it, and also following the steps of "File" > "Invalidate Caches / Restart" to clear the IDE's cache, but unfortunately, I haven't had any success in resolving the issue.
Please let me know if there's any additional information you can provide or if you have any specific questions.
Upvotes: 2
Views: 4628
Reputation: 700
I received this error when trying to update my React Native app, from android target API level 33 to 34. And I solved it like this:
compileSdkVersion = 33
targetSdkVersion = 34
I changed only the targetSdkVersion. I left the compleSdkVersion at 33, and gradleWrapper and the rest of configurations as they were.
Took this solution from here
And also updated my MainApplication and app/build.gradle as christophby suggested
MainApplication.java
// Add imports
import android.content.BroadcastReceiver;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Build;
import org.jetbrains.annotations.Nullable;
// ...
// Put this above "public void onCreate()":
@Override
public Intent registerReceiver(@Nullable BroadcastReceiver receiver, IntentFilter filter) {
if (Build.VERSION.SDK_INT >= 34 && getApplicationInfo().targetSdkVersion >= 34) {
return super.registerReceiver(receiver, filter, Context.RECEIVER_EXPORTED);
} else {
return super.registerReceiver(receiver, filter);
}
}
// ....
and
app/build.gradle
dependencies {
// ...
implementation 'org.jetbrains:annotations:16.0.2'
// ...
}
Upvotes: 3