Repository navigation
Description
Description
Currently, my codebase supports Android 13 (SDK version: 33). I wanted to upgrade to SDK 33(Android 14)
On Android 14 updates, the following changes have been made:
kotlinVersion = "1.6.0"
buildToolsVersion = "34.0.0"
minSdkVersion = 23
compileSdkVersion = 34
targetSdkVersion = 34
My current React Native version is 0.70.8.
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.
- Caused by: java.lang.reflect.InvocationTargetException.
- Caused by: android.os.RemoteException: Remote stack trace.
React Native Version
0.70.8
Output of npx react-native info
System:
OS: macOS 14.0
CPU: (8) arm64 Apple M1
Memory: 65.91 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.4.0 - /opt/homebrew/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 9.8.1 - /opt/homebrew/bin/npm
Watchman: 2023.07.10.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.13.0 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 23.0, iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0
Android SDK: Not Found
IDEs:
Android Studio: 2022.3 AI-223.8836.35.2231.10406996
Xcode: 15.0.1/15A507 - /usr/bin/xcodebuild
Languages:
Java: 11.0.19 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.1.0 => 18.1.0
react-native: 0.70.8 => 0.70.8
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
Update Build.gradle's version to support SDK version 34.
Snack, screenshot, or link to a repository
Build.gradle file: https://snack.expo.dev/@shaminisaravanan/android14
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