You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
App Crashes - On upgrading to Android 14(SDK 34) #41288
However, upon launching the application, I encountered an issue where the App Crashes immediately on the launch. To investigate this, I pulled a Bug Report, which provided the following insights:
Caused by: java.lang.RuntimeException: Requested enabled DevSupportManager, but BridgeDevSupportManager class was not found or could not be created.
Caused by: java.lang.SecurityException: : One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts.
You are on a supported minor version, but it looks like there's a newer patch available - 0.70.14. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.
Thanks for the issue. Consider that, as soon as we will release 0.73 as stable (ETA: end Nov/start Dec) we are not going to support 0.70 anymore. Hopefully, this gives you some time to plan the migration to the latest version.
I'm still experiencing the problem, and any guidance or suggestions would be greatly appreciated. If there's any additional information I can provide to help with debugging or if there's a specific way you'd like me to test something, please let me know.
Thank you in advance for your time and assistance!
We tried to add support for new version of Android in 0.70, but that's not possible unfortunately.
If you need to support new Android SDK and Android 14, you have to update to a newer version of React Native.
Reacted by ShaminiSaravanan, Vincent Asscher, jeff ngugi, hardik khanchandani and Peter
I upgraded to 0.73 from RN0.72.7 and android sdk 34,encountered an issue where the App Crashes immediately on the launch
Reacted by Nazir Hussain, koliapp2019, Niklas Machacek, Dawid Nowakowski, Quan Nguyen, Mansi Laad, ashish-kumar1994, Comsa Radu, Yunus Emre Tat, Diana and 32 more
encountered an issue where the App Crashes immediately on the launch. To investigate this, I pulled a Bug Report, which provided the following insights:
Caused by: java.lang.RuntimeException: Requested enabled DevSupportManager, but BridgeDevSupportManager class was not found or could not be created.
I'm closing this issue as related to React Native 0.70 (which is no longer supported).
The author hasn't provided a reproducer also.
I was able to upgrade my targetSDKVersion and compiledSDKVersion to 34 with the current fix provided by putting up the fix below.
But after generating a signed aab and uploading it to internal testing track in play console. This error shows up. Did anyone found a solution to resolve this error?
Thanks everyone! To put it together, adding the following code did the trick for me (react-native 0.69.12) MainApplication.java
For me, it only works in debug mode with React Native version 0.64.2, but in release mode, it crashes right after opening the app. Does anyone have any ideas or suggestions? I would greatly appreciate your help
@ravindra3003 i was also trying to resolve this issue using the solution from @asaejiro but it didn't work for me. So what i did was to Clean > Build the project first so the index.android.bundle is generated and then manually copy the file into the /android/app/build/intermediates/assets/release/mergeReleaseAssets folder.
Then i generate the APK or App bundle and after which i analyze the APK and i see the index.android.bundle is packaged correctly and the app runs on my physical phone now.
Maybe you can give it a try too.
Yes, it's working for now. Please inform me if you discover a permanent solution.
You can add the following code to your node_modules\react-native\react.gradle file:
Big thanks to @christophby and everyone for keeping the community alive and helping each other. The solution to put the method below inside MainApplication.java worked.
Below should be added to the dependencies section of the app/build.gradle file.
implementation 'org.jetbrains:annotations:16.0.2'
My RN version is 0.70.14
Though this resolved the crash issue, I still want to slowly upgrade RN version.
Which stable RN version I should target next, so that multiple things do not break simultaneously. I want to gradually upgrade the RN version.
Reacted by amrin-justnaik, Mohsin, chucnqicetea and Ajay Gautam
I also added this line: import android.content.Context;
Reacted by Karl Djotchuang Tamo, Manan Gadhiya, Akifcan Kara, Juan David García Manrique, Akash Bagchi, Wiratama Adi Wibawa, Noor-e-Iqra and Ajay Gautam
Thanks @Sebosam@christophby so much, this solution working fine! I've been sleepless since last week because of these issues
@wendysychan is your application works after build an .apk file or .aab ??? or just locally on simulator ?
Sorry for late reply @dariusz-rosiek-branchspace , yes its working after build .apk and also .aab with very old RN version 0.62.3
HI, @wendysychan I tried and its not working for :
react-native: 0.63.1 JDK 11 gradle-6.9
Error: cannot find symbol return super.registerReceiver(receiver, filter, Context.RECEIVER_EXPORTED); ^ symbol: variable RECEIVER_EXPORTED location: class Context
Any one still struggling with this issue, I found a workaround. After updating compileSDKVersion & targetSDKVersion to 34. I was getting error for Context.RECEIVER_EXPORTED. After spending more than month, I found in my android->build.gradle, there is block added for supporting some old versions of dependencies I guess, that code block is as below.
Please note that it may be necessary to add the android.content.Context line to your imports. Also, if your files are in Kotlin, you'd have to convert the java code to kotlin. Check my comment on StackOverflow. https://stackoverflow.com/a/79003676/9883035
To anyone still having problems with this, I followed all the steps above and my app was still crashing. I had to update ALL my packages to support Android 14 and then everything worked. Here are some of the packages I had to update:
Activity
github-actions commentedon Nov 2, 2023
ShaminiSaravanan commentedon Nov 2, 2023
I wanted to stick with React Version 0.70.8, as my code runs for both Android and iOS.
In my project, 0.70.8 is compatible for both iOS and Android
cipolleschi commentedon Nov 2, 2023
Thanks for the issue. Consider that, as soon as we will release 0.73 as stable (ETA: end Nov/start Dec) we are not going to support 0.70 anymore. Hopefully, this gives you some time to plan the migration to the latest version.
ShaminiSaravanan commentedon Nov 3, 2023
Hi there! 👋
I'm still experiencing the problem, and any guidance or suggestions would be greatly appreciated. If there's any additional information I can provide to help with debugging or if there's a specific way you'd like me to test something, please let me know.
Thank you in advance for your time and assistance!
cipolleschi commentedon Nov 3, 2023
Have a look at this conversation: reactwg/react-native-releases#84 (comment)
We tried to add support for new version of Android in 0.70, but that's not possible unfortunately.
If you need to support new Android SDK and Android 14, you have to update to a newer version of React Native.
rakeshkumar217 commentedon Nov 21, 2023
Hi cipolleschi, here i am using recent version of react-native(72.6) and android target version 34. But i am still facing the same issue.
I have found one solution related to RECEIVER_NOT_EXPORTED and I have applied check for android 14(34).
Link: https://stackoverflow.com/questions/77235063/one-of-receiver-exported-or-receiver-not-exported-should-be-specified-when-a-rec
But still have same issue. I don't how to get out of this problem.
cipolleschi commentedon Nov 23, 2023
Can you provide a reproducer so we can investigate what's going on?
zkteco-home commentedon Dec 6, 2023
I upgraded to 0.73 from RN0.72.7 and android sdk 34,encountered an issue where the App Crashes immediately on the launch
cortinico commentedon Dec 7, 2023
I'm closing this issue as related to React Native 0.70 (which is no longer supported).
The author hasn't provided a reproducer also.
@zkteco-home please open a new issue
166 remaining items
quoctruongkt commentedon Aug 19, 2024
Thank you, this works for me
react-native 0.70.6
phuongwd commentedon Aug 23, 2024
Original solution by christophby; see #41288 (comment)
Thank you so much! This works for me with
"react-native": "0.71.8".isha-18Pixels commentedon Aug 26, 2024
thanks it worked
anggaip commentedon Aug 27, 2024
Thanks, you saved my times
duarteacin commentedon Aug 27, 2024
You can add the following code to your node_modules\react-native\react.gradle file:

Install a lib https://www.npmjs.com/package/patch-package and generate a patch of react-native lib.
Hope it helps 😉
prashant-ksolves-consultant commentedon Sep 4, 2024
My RN version is 0.70.14
Though this resolved the crash issue, I still want to slowly upgrade RN version.
Which stable RN version I should target next, so that multiple things do not break simultaneously. I want to gradually upgrade the RN version.
DanushkaPerusinghe commentedon Sep 6, 2024
"react": "18.2.0",
"react-native": "0.71.7",
This woks thanks a lot :)
Akifcan commentedon Sep 10, 2024
I also added this line: import android.content.Context;
kunal-kudale-invimatic commentedon Sep 11, 2024
Any one still struggling with this issue, I found a workaround. After updating compileSDKVersion & targetSDKVersion to 34. I was getting error for Context.RECEIVER_EXPORTED. After spending more than month, I found in my android->build.gradle, there is block added for supporting some old versions of dependencies I guess, that code block is as below.
subprojects {
afterEvaluate {
project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion = 34
buildToolsVersion = "28.0.3"
}
}
}
}
here compileSdkVersion was "28" which was causing issue, after updating it to 34(even 33 works) it worked.
And also if anyone using "react-native-orientaion", please follow below link.
https://medium.com/@anaz_19473/react-native-app-crashes-on-upgrading-to-targetsdkversion-34-android-14-f8f575da6b45
Djotchuang commentedon Sep 19, 2024
Please note that it may be necessary to add the android.content.Context line to your imports. Also, if your files are in Kotlin, you'd have to convert the java code to kotlin. Check my comment on StackOverflow. https://stackoverflow.com/a/79003676/9883035
odesey commentedon Oct 7, 2024
To anyone still having problems with this, I followed all the steps above and my app was still crashing. I had to update ALL my packages to support Android 14 and then everything worked. Here are some of the packages I had to update:
@react-native-firebase/app, @react-native-firebase/messaging, react-native-maps, react-native-navigation, react-native-sound-player, @notifee/react-native, react-native-device-infoAfter updating those packages, the update to Android worked.
Dance225 commentedon Oct 22, 2024
Thanks guys, help a lot of!!!!!
Jeh212 commentedon Jan 29, 2025
Thank you so much man, this saved my entire day of debugging. Running RN 0.71.12
YASH6004 commentedon Feb 7, 2025
This worked for me if someone still faces some issue
node_modules/react-native-orientation/android/src/main/java/com/github/yamill/orientation/OrientationModule.javapackage com.github.yamill.orientation;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.os.Build;
import android.util.Log;
import com.facebook.common.logging.FLog;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.Callback;
import com.facebook.react.bridge.LifecycleEventListener;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.modules.core.DeviceEventManagerModule;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Nullable;
import java.lang.reflect.Field;
public class OrientationModule extends ReactContextBaseJavaModule implements LifecycleEventListener{
final BroadcastReceiver receiver;
@OverRide
public void onHostResume() {
final Activity activity = getCurrentActivity();
Fix issues with upgrading with 34 SDK version