Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting this error on android #37674

Closed
mrsants opened this issue Jun 3, 2023 · 17 comments
Closed

getting this error on android #37674

mrsants opened this issue Jun 3, 2023 · 17 comments
Labels
Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@mrsants
Copy link

mrsants commented Jun 3, 2023

Description

Exception com.facebook.react.common.JavascriptException:
at com.facebook.react.modules.core.ExceptionsManagerModule.reportException (ExceptionsManagerModule.java:72)
at java.lang.reflect.Method.invoke
at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java:188)
at com.facebook.react.bridge.queue.NativeRunnable.run
at android.os.Handler.handleCallback (Handler.java:751)
at android.os.Handler.dispatchMessage (Handler.java:95)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.java:27)
at android.os.Looper.loop (Looper.java:154)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run (MessageQueueThreadImpl.java:226)
at java.lang.Thread.run (Thread.java:762)

React Native Version

0.71.8

Output of npx react-native info

System:
OS: macOS 13.4
CPU: (12) x64 Intel(R) Core(TM) i5-10500 CPU @ 3.10GHz
Memory: 40.75 MB / 8.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v18.16.0/bin/yarn
npm: 9.5.1 - ~/.nvm/versions/node/v18.16.0/bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.12.1 - /Users/mrsants/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
Android SDK: Not Found
IDEs:
Android Studio: 2022.2 AI-222.4459.24.2221.10121639
Xcode: 14.3.1/14E300c - /usr/bin/xcodebuild
Languages:
Java: 11.0.19 - /usr/local/opt/openjdk@11/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.71.8 => 0.71.8
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

"expo": "~48.0.18",
"react-native": "0.71.8"

Snack, code example, screenshot, or link to a repository

@github-actions github-actions bot added the Platform: Android Android applications. label Jun 3, 2023
@cortinico cortinico added Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. and removed Needs: Triage 🔍 labels Jun 3, 2023
@github-actions
Copy link

github-actions bot commented Jun 3, 2023

⚠️ Missing Reproducible Example
ℹ️ It looks like your issue is missing a reproducible example. Please provide either:

@cortinico
Copy link
Contributor

Not enough information to debug this. You need to provide a reproducer, codesnippet or a Snack. We can't just support with basically just a stacktrace.

@shubhamdeol
Copy link

I opened the related issue here bit more info, yes stack trace is not clear but this is certainly an issue.
with just 5% rollout we got 5 devices facing this issue and those users are completly blocked
#37821

@github-actions
Copy link

github-actions bot commented Jul 6, 2023

This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jul 6, 2023
@cortinico
Copy link
Contributor

Closing as @mrsants is unresponsive

@rabiaah
Copy link

rabiaah commented Aug 26, 2023

Issue still there just right after trying to upgrade the Android to use the targetSdkVersion = 33
I've tried many options but the APK keep crashing, when connecting the same device with USB cable it's not crashing at all.

Where I can have more details about such bug? it's not printed anywhere.

In Google play console I have the below error only

com.facebook.react.common.JavascriptException
samsung b0q (Galaxy S22 Ultra) - Android 13 (SDK 33)

Exception com.facebook.react.common.JavascriptException: at com.facebook.react.modules.core.ExceptionsManagerModule.reportException (ExceptionsManagerModule.java:83) at java.lang.reflect.Method.invoke at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:372) at com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java:151) at com.facebook.react.bridge.queue.NativeRunnable.run at android.os.Handler.handleCallback (Handler.java:942) at android.os.Handler.dispatchMessage (Handler.java:99) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.java:27) at android.os.Looper.loopOnce (Looper.java:226) at android.os.Looper.loop (Looper.java:313) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run (MessageQueueThreadImpl.java:226) at java.lang.Thread.run (Thread.java:1012)

Anyone have any directions here?

Thanks in advance,

@hotaryuzaki
Copy link

same issue here.

@habibaamri
Copy link

Same issue here! @mrsants did you fix it or not yet

@TomasPintoKramer
Copy link

Same issue

@captain-KasH
Copy link

I'm also facing the same.

@JaosnHsieh
Copy link

same here

@rabiaah
Copy link

rabiaah commented Nov 27, 2023

I've tried the same in new Android 13 Device (Xiaomi Redmi 13C) and got a clear Exception as below

com.facebook.react.common.JavascriptException: Error: Exception in HostObject::get(propName:NativeUnimoduleProxy): java.lang.SecurityException: Settings key: <bluetooth_name> is only readable to apps with targetSdkVersion lower than or equal to: 31, stack:
@403:125
h@2:1585
@21:1245
h@2:1585
@12:466
h@2:1585
@11:482
h@2:1585
@9:54
h@2:1585
@8:204
h@2:1585
@6:45
h@2:1585
d@2:958
global code@3211:3

at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:83)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loopOnce(Looper.java:211)
at android.os.Looper.loop(Looper.java:300)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
at java.lang.Thread.run(Thread.java:1012)

Therefore, I've upgraded the expo-device to 5.6.0 (Latest as for today 27 NOV 23)

https://www.npmjs.com/package/expo-device/v/5.6.0

Make sure to access ios/Podfile and increase the platform io to 13 minimum.

platform :ios, '13.0'

## 5.0.0 — 2022-10-25

🛠 Breaking changes

  • Bumped iOS deployment target to 13.0 and deprecated support for iOS 12. (#18873 by @tsapeta)

🐛 Bug fixes

  • Fixed <bluetooth_name> is only readable to apps with targetSdkVersion lower than or equal to: 31 error when the targetSdkVersion is set to 33. (#19666 by @kudo, @kudo)

@rabiaah
Copy link

rabiaah commented Nov 29, 2023

Fast way to resolve it and it's actually worked fine for me.

Access Android studio, Search for "DeviceModule.kt" file,

In the file, search for the below line:
"deviceName" to Settings.Secure.getString(mContext.contentResolver, "bluetooth_name")

Replace it with the below lines:
"deviceName" to run {
if (Build.VERSION.SDK_INT <= 31)
Settings.Secure.getString(mContext.contentResolver, "bluetooth_name")
else
Settings.Global.getString(mContext.contentResolver, Settings.Global.DEVICE_NAME)
},

Source: https://github.com/expo/expo/pull/19666/files

I've tested the APK version from Google play and working fine.

@burakkilinc11
Copy link

I still have this problem. Is there a solution?

@rabiaah
Copy link

rabiaah commented Mar 24, 2024

I still have this problem. Is there a solution?

Please elaborate on your issue? What you’re facing exactly?

@burakkilinc11
Copy link

at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:83)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loopOnce(Looper.java:211)
at android.os.Looper.loop(Looper.java:300)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
at java.lang.Thread.run(Thread.java:1012)
I'm getting this crashing issue on android, I tried several solutions but it didn't work.

@rabiaah
Copy link

rabiaah commented Mar 25, 2024

Can you share the file content of "DeviceModule.kt"?

Path: packages/expo-device/android/src/main/java/expo/modules/device/DeviceModule.kt
(Inside the Android Studio).

Screen Shot 2024-03-25 at 18 54 42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

10 participants