facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.17k stars 24.21k forks source link

App Crashes - On upgrading to Android 14(SDK 34) for "react-native": "0.68.2", #45653

Closed Bilal-Basheer closed 1 month ago

Bilal-Basheer commented 1 month ago

Description

-------------------------REACT-NATIVE-------------------------------- "react-native": "0.68.2", --------------------------------JAVA----------------------------------- java : openjdk version "21.0.3" 2024-04-16 OpenJDK Runtime Environment Homebrew (build 21.0.3) OpenJDK 64-Bit Server VM Homebrew (build 21.0.3, mixed mode, sharing) ------------------------BUILD.GRADLE--------------------------------- import org.apache.tools.ant.taskdefs.condition.Os def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript { ext { buildToolsVersion = "33.0.0" minSdkVersion = 21 compileSdkVersion = 34 targetSdkVersion = 34 // Any of the following will work googlePlayServicesVersion = "17.0.0" // playServicesVersion = "17.0.0" // playServicesLocationVersion = "17.0.0"

    if (System.properties['os.arch'] == "aarch64") {
        // For M1 Users we need to use the NDK 24 which added support for aarch64
        ndkVersion = "24.0.8215888"
    } else {
        // Otherwise we default to the side-by-side NDK version from AGP.
        ndkVersion = "21.4.7075529"
    }
}
repositories {
    google()
    mavenCentral()
}
dependencies {
    classpath("com.android.tools.build:gradle:7.4.2")
    classpath("com.facebook.react:react-native-gradle-plugin")
    classpath("de.undercouch:gradle-download-task:4.1.2")
    classpath("com.google.gms:google-services:4.4.0")
    // 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' } } } please ask if more information require

Steps to reproduce

0

React Native Version

0.68.2

Affected Platforms

Runtime - Android

Output of npx react-native info

System:
    OS: macOS 14.1.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 44.97 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.17.0 - ~/.nvm/versions/node/v18.17.0/bin/node
    Yarn: Not Found
    npm: 10.8.1 - ~/.nvm/versions/node/v18.17.0/bin/npm
    Watchman: 2024.07.15.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.15.2 - /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:
      API Levels: 28, 29, 30, 31, 32, 33, 33, 33, 34
      Build Tools: 30.0.2, 30.0.3, 31.0.0, 33.0.0, 34.0.0
      System Images: android-33 | Google APIs Intel x86_64 Atom, android-34 | Google APIs Intel x86_64 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 2023.3 AI-233.14808.21.2331.11842104
    Xcode: 15.0.1/15A507 - /usr/bin/xcodebuild
  Languages:
    Java: 21.0.3 - /usr/local/opt/openjdk/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.68.2 => 0.68.2 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Stacktrace or Logs

--------------LOGCAT-----------
    E  FATAL EXCEPTION: main
                                                                                                    Process: com.attobility, PID: 1382
                                                                                                    java.lang.RuntimeException: Unable to create application com.attobility.MainApplication: java.lang.RuntimeException: Requested enabled DevSupportManager, but BridgeDevSupportManager class was not found or could not be created
                                                                                                        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7003)
                                                                                                        at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
                                                                                                        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2236)
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:106)
                                                                                                        at android.os.Looper.loopOnce(Looper.java:205)
                                                                                                        at android.os.Looper.loop(Looper.java:294)
                                                                                                        at android.app.ActivityThread.main(ActivityThread.java:8177)
                                                                                                        at java.lang.reflect.Method.invoke(Native Method)
                                                                                                        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
                                                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
                                                                                                    Caused by: java.lang.RuntimeException: Requested enabled DevSupportManager, but BridgeDevSupportManager class was not found or could not be created
                                                                                                        at com.facebook.react.devsupport.DefaultDevSupportManagerFactory.create(DefaultDevSupportManagerFactory.java:96)
                                                                                                        at com.facebook.react.ReactInstanceManager.<init>(ReactInstanceManager.java:260)
                                                                                                        at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:332)
                                                                                                        at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:95)
                                                                                                        at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:42)
                                                                                                        at com.attobility.MainApplication.onCreate(MainApplication.java:74)
                                                                                                        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1316)
                                                                                                        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6998)
                                                                                                        at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0) 
                                                                                                        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2236) 
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:106) 
                                                                                                        at android.os.Looper.loopOnce(Looper.java:205) 
                                                                                                        at android.os.Looper.loop(Looper.java:294) 
                                                                                                        at android.app.ActivityThread.main(ActivityThread.java:8177) 
                                                                                                        at java.lang.reflect.Method.invoke(Native Method) 
                                                                                                        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) 
                                                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971) 
                                                                                                    Caused by: java.lang.reflect.InvocationTargetException
                                                                                                        at java.lang.reflect.Constructor.newInstance0(Native Method)
                                                                                                        at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
                                                                                                        at com.facebook.react.devsupport.DefaultDevSupportManagerFactory.create(DefaultDevSupportManagerFactory.java:85)
                                                                                                        at com.facebook.react.ReactInstanceManager.<init>(ReactInstanceManager.java:260) 
                                                                                                        at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:332) 
                                                                                                        at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:95) 
                                                                                                        at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:42) 
                                                                                                        at com.attobility.MainApplication.onCreate(MainApplication.java:74) 
                                                                                                        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1316) 
                                                                                                        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6998) 
                                                                                                        at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0) 
                                                                                                        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2236) 
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:106) 
                                                                                                        at android.os.Looper.loopOnce(Looper.java:205) 
                                                                                                        at android.os.Looper.loop(Looper.java:294) 
                                                                                                        at android.app.ActivityThread.main(ActivityThread.java:8177) 
                                                                                                        at java.lang.reflect.Method.invoke(Native Method) 
                                                                                                        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) 
                                                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971) 
                                                                                                    Caused by: java.lang.SecurityException: com.attobility: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
                                                                                                        at android.os.Parcel.createExceptionOrNull(Parcel.java:3057)
                                                                                                        at android.os.Parcel.createException(Parcel.java:3041)
                                                                                                        at android.os.Parcel.readException(Parcel.java:3024)
                                                                                                        at android.os.Parcel.readException(Parcel.java:2966)
                                                                                                        at android.app.IActivityManager$Stub$Proxy.registerReceiverWithFeature(IActivityManager.java:5684)
                                                                                                        at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1852)
                                                                                                        at android.app.ContextImpl.registerReceiver(ContextImpl.java:1792)
                                                                                                        at android.app.ContextImpl.registerReceiver(ContextImpl.java:1780)
                                                                                                        at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:755)
                                                                                                        at com.facebook.react.devsupport.DevSupportManagerBase.reload(DevSupportManagerBase.java:1110)
                                                                                                        at com.facebook.react.devsupport.DevSupportManagerBase.reloadSettings(DevSupportManagerBase.java:735)
                                                                                                        at com.facebook.react.devsupport.DevSupportManagerBase.setDevSupportEnabled(DevSupportManagerBase.java:612)
                                                                                                        at com.facebook.react.devsupport.DevSupportManagerBase.<init>(DevSupportManagerBase.java:205)
                                                                                                        at com.facebook.react.devsupport.BridgeDevSupportManager.<init>(BridgeDevSupportManager.java:77)
                                                                                                        at java.lang.reflect.Constructor.newInstance0(Native Method) 
                                                                                                        at java.lang.reflect.Constructor.newInstance(Constructor.java:343) 
                                                                                                        at com.facebook.react.devsupport.DefaultDevSupportManagerFactory.create(DefaultDevSupportManagerFactory.java:85) 
                                                                                                        at com.facebook.react.ReactInstanceManager.<init>(ReactInstanceManager.java:260) 
                                                                                                        at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:332) 
                                                                                                        at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:95) 
                                                                                                        at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:42) 
                                                                                                        at com.attobility.MainApplication.onCreate(MainApplication.java:74) 
                                                                                                        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1316) 
                                                                                                        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6998) 
                                                                                                        at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0) 
                                                                                                        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2236) 
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:106) 
                                                                                                        at android.os.Looper.loopOnce(Looper.java:205) 
                                                                                                        at android.os.Looper.loop(Looper.java:294) 
                                                                                                        at android.app.ActivityThread.main(ActivityThread.java:8177) 
                                                                                                        at java.lang.reflect.Method.invoke(Native Method) 
                                                                                                        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) 
                                                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971) 
                                                                                                    Caused by: android.os.RemoteException: Remote stack trace:
                                                                                                        at com.android.server.am.ActivityManagerService.registerReceiverWithFeature(ActivityManagerService.java:13927)
                                                                                                        at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2570)
                                                                                                        at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2720)
                                                                                                        at android.os.Binder.execTransactInternal(Binder.java:1339)
                                                                                                        at android.os.Binder.execTransact(Binder.java:1275)

cd android && ./gradlew ReactAndroid:installArchives

Note: Recompile with -Xlint:deprecation for details.
3 warnings

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'AttobilityMembers'.
> Could not open proj generic class cache for build file '/Users/attobility-bilal/Documents/React-Native/AttobilityMembers/android/build.gradle' (/Users/attobility-bilal/.gradle/caches/7.5/scripts/ch907c8hlt6zjmmknpqhs89b5).
   > BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 65

* Try:
> 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.

* Get more help at https://help.gradle.org

BUILD FAILED in 15s
6 actionable tasks: 4 executed, 2 up-to-date

Reproducer

ds

Screenshots and Videos

No response

react-native-bot commented 1 month ago
:warning: Too Old Version of React Native
:information_source: It looks like your issue or the example you provided uses a Too Old Version of React Native.

Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.
react-native-bot commented 1 month ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.
react-native-bot commented 1 month ago
:warning: Too Old Version of React Native
:information_source: It looks like your issue or the example you provided uses a Too Old Version of React Native.

Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.
react-native-bot commented 1 month ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either: