facebook / react-native

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

Unable to run the app on Android 14. #44736

Closed gkasireddy202 closed 1 month ago

gkasireddy202 commented 1 month ago

Description

Unable to run the app on Android 14. Previous my project running on Android 12,13. FATAL EXCEPTION: main Process: com.appname, PID: 22654 java.lang.SecurityException: com.khameleonapp.test: 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:3069) at android.os.Parcel.createException(Parcel.java:3053) at android.os.Parcel.readException(Parcel.java:3036) at android.os.Parcel.readException(Parcel.java:2978) at android.app.IActivityManager$Stub$Proxy.registerReceiverWithFeature(IActivityManager.java:6137) at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1913) at android.app.ContextImpl.registerReceiver(ContextImpl.java:1853) at android.app.ContextImpl.registerReceiver(ContextImpl.java:1841) at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:772) at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:772) at com.github.yamill.orientation.OrientationModule.onHostResume(OrientationModule.java:153) at com.facebook.react.bridge.ReactContext.onHostResume(ReactContext.java:308) at com.facebook.react.ReactInstanceManager.moveToResumedLifecycleState(ReactInstanceManager.java:765) at com.facebook.react.ReactInstanceManager.moveReactContextToCurrentLifecycleState(ReactInstanceManager.java:800) at com.facebook.react.ReactInstanceManager.lambda$setupReactContext$3(ReactInstanceManager.java:1174) at com.facebook.react.ReactInstanceManager.$r8$lambda$iHpnDjhPTftdZc2HP9iD9hTDvL4(Unknown Source:0) at com.facebook.react.ReactInstanceManager$$ExternalSyntheticLambda0.run(Unknown Source:6) at android.os.Handler.handleCallback(Handler.java:958) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:230) at android.os.Looper.loop(Looper.java:319) at android.app.ActivityThread.main(ActivityThread.java:8913) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103) Caused by: android.os.RemoteException: Remote stack trace: at com.android.server.am.ActivityManagerService.registerReceiverWithFeature(ActivityManagerService.java:16590) at android.app.IActivityManager$Stub.onTransact$registerReceiverWithFeature$(IActivityManager.java:11530) at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2928) at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3195) at android.os.Binder.execTransactInternal(Binder.java:1375)

Steps to reproduce

react-native run-android

React Native Version

0.73.7

Affected Platforms

Runtime - Android

Output of npx react-native info

System:
  OS: macOS 14.2.1
  CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
  Memory: 274.48 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 21.7.3
    path: /usr/local/bin/node
  Yarn: Not Found
  npm:
    version: 10.5.0
    path: /usr/local/bin/npm
  Watchman:
    version: 2023.03.13.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.14.3
    path: /Users/gopi/.rvm/gems/ruby-2.7.6/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - watchOS 10.2
  Android SDK:
    API Levels:
      - "23"
      - "24"
      - "25"
      - "26"
      - "27"
      - "28"
      - "29"
      - "30"
      - "31"
      - "32"
      - "33"
      - "34"
    Build Tools:
      - 29.0.2
      - 30.0.3
      - 33.0.1
      - 34.0.0
    System Images:
      - android-29 | Google APIs Intel x86 Atom
      - android-29 | Google Play Intel x86 Atom
      - android-30 | Google APIs Intel x86 Atom
      - android-32 | Google APIs Intel x86 Atom_64
      - android-32 | Google Play Intel x86 Atom_64
      - android-33 | Google APIs Intel x86 Atom_64
      - android-33 | Google Play Intel x86 Atom_64
    Android NDK: Not Found
IDEs:
  Android Studio: 2021.2 AI-212.5712.43.2112.8609683
  Xcode:
    version: 15.1/15C65
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 18.0.2.1
    path: /Library/Java/JavaVirtualMachines/jdk-18.0.2.1.jdk/Contents/Home/bin/javac
  Ruby:
    version: 2.7.6
    path: /Users/gopi/.rvm/rubies/ruby-2.7.6/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.7
    wanted: 0.73.7
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: false

Stacktrace or Logs

FATAL EXCEPTION: main
Process: com.appname, PID: 22654
 java.lang.SecurityException: com.khameleonapp.test: 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:3069)
                                                                          at android.os.Parcel.createException(Parcel.java:3053)
                                                                                                        at android.os.Parcel.readException(Parcel.java:3036)
                                                                                                        at android.os.Parcel.readException(Parcel.java:2978)
                                                                                                        at android.app.IActivityManager$Stub$Proxy.registerReceiverWithFeature(IActivityManager.java:6137)
                                                                                                        at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1913)
                                                                                                        at android.app.ContextImpl.registerReceiver(ContextImpl.java:1853)
                                                                                                        at android.app.ContextImpl.registerReceiver(ContextImpl.java:1841)
                                                                                                        at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:772)
                                                                                                        at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:772)
                                                                                                        at com.github.yamill.orientation.OrientationModule.onHostResume(OrientationModule.java:153)
                                                                                                        at com.facebook.react.bridge.ReactContext.onHostResume(ReactContext.java:308)
                                                                                                        at com.facebook.react.ReactInstanceManager.moveToResumedLifecycleState(ReactInstanceManager.java:765)
                                                                                                        at com.facebook.react.ReactInstanceManager.moveReactContextToCurrentLifecycleState(ReactInstanceManager.java:800)
                                                                                                        at com.facebook.react.ReactInstanceManager.lambda$setupReactContext$3(ReactInstanceManager.java:1174)
                                                                                                        at com.facebook.react.ReactInstanceManager.$r8$lambda$iHpnDjhPTftdZc2HP9iD9hTDvL4(Unknown Source:0)
                                                                                                        at com.facebook.react.ReactInstanceManager$$ExternalSyntheticLambda0.run(Unknown Source:6)
                                                                                                        at android.os.Handler.handleCallback(Handler.java:958)
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                                        at android.os.Looper.loopOnce(Looper.java:230)
                                                                                                        at android.os.Looper.loop(Looper.java:319)
                                                                                                        at android.app.ActivityThread.main(ActivityThread.java:8913)
                                                                                                        at java.lang.reflect.Method.invoke(Native Method)
                                                                                                        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
                                                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
                                                                                                    Caused by: android.os.RemoteException: Remote stack trace:
                                                                                                        at com.android.server.am.ActivityManagerService.registerReceiverWithFeature(ActivityManagerService.java:16590)
                                                                                                        at android.app.IActivityManager$Stub.onTransact$registerReceiverWithFeature$(IActivityManager.java:11530)
                                                                                                        at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2928)
                                                                                                        at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3195)
                                                                                                        at android.os.Binder.execTransactInternal(Binder.java:1375)

Reproducer

https://github.com/gopikrishnacse55/UIExample.git

Screenshots and Videos

shared image

github-actions[bot] commented 1 month ago
:warning: Newer Version of React Native is Available!
:information_source: You are on a supported minor version, but it looks like there's a newer patch available - 0.73.8. 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.
github-actions[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.
gkasireddy202 commented 1 month ago

I provided the repo.

gkasireddy202 commented 1 month ago

I see the code merge changes for my project below. https://github.com/discord/react-native/pull/47/files/72576a373484bcdf64564daa8a961dc34635b21a

gkasireddy202 commented 1 month ago

Fixed this issue.Issue with react-native-orientation.

write2lloyd commented 1 month ago

@gkasireddy202 Would be great to understand how you fixed this issue?

gkasireddy202 commented 1 month ago

Issue with react-native-orientation npm. I replaced with react-native-orientation-locker.

Get Outlook for iOShttps://aka.ms/o0ukef

Gopi Kasireddy Khameleon Software e: @.*** a: 12802 Tampa Oaks Boulevard, Suite 100 Temple Terrace FL 33637


From: Lloyd @.> Sent: Saturday, June 1, 2024 11:45:49 AM To: facebook/react-native @.> Cc: Gopi Kasireddy @.>; Mention @.> Subject: Re: [facebook/react-native] Unable to run the app on Android 14. (Issue #44736)

@gkasireddy202https://github.com/gkasireddy202 Would be great to understand how you fixed this issue?

— Reply to this email directly, view it on GitHubhttps://github.com/facebook/react-native/issues/44736#issuecomment-2143317336, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AVTH7XCALN3VAN5E3R5SYULZFFRJLAVCNFSM6AAAAABISHIYE2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBTGMYTOMZTGY. You are receiving this because you were mentioned.Message ID: @.***>