I am using react native. I am getting the crashes on crashlytics with the error INVALID_STATE_ERR.I am using FireBase Crashlytics. I am also using MQTT client for making web socket connection.
I am not able to figure out the reason of crashing the app. Is it due to the MQTT WebSockets or due to the error occurring on javascript thread? I am also not getting any relevant message from the stack trace either.
I am pasting my Stack Trace below.
Fatal Exception: com.facebook.react.common.JavascriptException: INVALID_STATE_ERR, stack:
value#79:1340
_socket_send#557:21101
_on_socket_open#557:16408
<unknown>#557:628
value#63:1501
<unknown>#79:4566
value#32:1363
value#18:3559
<unknown>#18:1044
value#18:2986
value#18:1016
at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:54)
at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:38)
at java.lang.reflect.Method.invoke(Method.java)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
at android.os.Looper.loop(Looper.java:148)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
at java.lang.Thread.run(Thread.java:818)
Can I get more insight to fix this issue?
According to this Wix GitHub issue, it is caused by:
Too many views on older phones. RNN added a few nested views, but it appears I may have too many anyways.
That issue links to a pull request on React Native's GitHub repo, which should now be merged in. It mentions the issue is on pre-API 21, so I suggest you try your code on later APIs and see if it persists.
Either way, reducing the number of views (or requests, in this case?) seems a good first step.
Related
I am working on an android application with AR elements. When it is redirecting me from the onboarding screen to the AR screen it crashes with the following error.
java.lang.IllegalArgumentException: Could not find tag for key 'org.codeaurora.qcamera3.exposure_metering.exposure_metering_mode')
at android.hardware.camera2.impl.CameraMetadataNative.nativeGetTagFromKeyLocal(Native Method)
at android.hardware.camera2.impl.CameraMetadataNative.setBase(CameraMetadataNative.java:1389)
at android.hardware.camera2.impl.CameraMetadataNative.set(CameraMetadataNative.java:459)
at android.hardware.camera2.impl.CameraMetadataNative.set(CameraMetadataNative.java:463)
at android.hardware.camera2.CaptureRequest$Builder.set(CaptureRequest.java:848)
at dez.a(PG:49)
at gtf.g(PG:104)
at det.a(Unknown Source:12)
at gjw.e(PG:5)
at gnx.run(PG:12)
at gsa.run(PG:2)
at gtc.run(PG:1)
at gsw.f(PG:2)
at gsv.run(PG:6)
Suppressed: gnv: [gpc{Cancelling}#66fb9dc, Dispatchers.IO]
It works fine on android API level 31 and the crash only happens on level 29. Does anybody have any idea what is causing this error?
Apparently it is a device dependent problem and the issue is reported on ARCore github.
https://github.com/google-ar/arcore-android-sdk/issues/1261
since I´ve downloaded the Android 11 update (Samsung Galaxy S10e; also tested with Android SDK´s Emulator running Android 11, same results), the DSP app "Noozxoide EIZO-rewire™ PRO" is always crashing when started. I know that this app was developed for Android 4.0, but it was even working properly on Android 10. I decided to download Android SDK to test in on VM and look at the logcat.
I would like to get the app working because it improves the audio quality perfectly and I don´t know any similar app like this one. I wanted to contact the developers of the app but their e-mail adress does not exist anymore.
I don´t have any experience with developing apk´s, but maybe someone can help me :)
I have already read some logcat explanations and guide to migrating apps to Android 11 on developer.android but it didn´t really help me with this.
Maybe can someone explain to me what´s happening in this logcat part:
2021-02-24 20:21:19.648 10997-10997/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.noozxoidelabs.eizo.rewirepro, PID: 10997
java.lang.RuntimeException: java.lang.NoSuchMethodException: android.media.audiofx.AudioEffect.setParameter [class [B, class [B]
at com.noozxoidelabs.eizo.rewirepro.VSPCoreEngine.updateDsp(VSPCoreEngine.java:231)
at com.noozxoidelabs.eizo.rewirepro.VSPCoreEngine$4.onCallStateChanged(VSPCoreEngine.java:129)
at android.telephony.PhoneStateListener$IPhoneStateListenerStub.lambda$onCallStateChanged$10(PhoneStateListener.java:1185)
at android.telephony.-$$Lambda$PhoneStateListener$IPhoneStateListenerStub$6czWSGzxct0CXPVO54T0aq05qls.run(Unknown Source:6)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: java.lang.NoSuchMethodException: android.media.audiofx.AudioEffect.setParameter [class [B, class [B]
at java.lang.Class.getMethod(Class.java:2072)
at java.lang.Class.getMethod(Class.java:1693)
at com.noozxoidelabs.eizo.rewirepro.VSPCoreEngine.updateDsp(VSPCoreEngine.java:226)
at com.noozxoidelabs.eizo.rewirepro.VSPCoreEngine$4.onCallStateChanged(VSPCoreEngine.java:129)
at android.telephony.PhoneStateListener$IPhoneStateListenerStub.lambda$onCallStateChanged$10(PhoneStateListener.java:1185)
at android.telephony.-$$Lambda$PhoneStateListener$IPhoneStateListenerStub$6czWSGzxct0CXPVO54T0aq05qls.run(Unknown Source:6)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Thanks in advance
PS: sorry for my misstakes in English :)
From the Google Play Store comments for that app, support is no longer available, and due to framework code changes won't work on modern Android
Similar to: Compile error: Cannot find symbol AudioEffect::setParameter in Android Studio
A quick check of the source shows that in old version of Android:
https://android.googlesource.com/platform/frameworks/base/+/5bb8f80/media/java/android/media/audiofx/AudioEffect.java
No annotation was on setParameter(...)
https://android.googlesource.com/platform/frameworks/base/+/refs/heads/android11-d1-release/media/java/android/media/audiofx/AudioEffect.java
While in newer ones the setParameter(...) functions is now hidden by #TestApi and throw an exception if not initialized correctly.
Any fix will require developer to update code.
I have the solution you're looking for. I downloaded an app from the Play Store called App Cloner, and ran Noozxoide through this program to create a cloned apk. The cloned app installed perfectly and worked fine on Android 11.
My game stops when I try to connect it with the google play games. It was working. But suddenly this is happening. It's showing development error occurred. Here's the logcat.
07:34.150 2144-2144/com.sennovations.countermaster E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.sennovations.countermaster, PID: 2144
java.lang.IllegalStateException: A fatal developer error has occurred. Check the logs for further information.
at com.google.android.gms.common.internal.zze.zzs(Unknown Source)
at com.google.android.gms.common.internal.zzi.zzrk(Unknown Source)
at com.google.android.gms.common.internal.zzh.handleMessage(Unknown Source)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5637)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754)
I have added the meta tags in the manifest.
<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="#string/app_id" />
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
Any help would be appreciated. Thanks
Based on your comments I infer that this wasn't your issue, but as I encountered a similar error that I resolved as follows, I'll add this answer:
Google's documentation (here, for instance) currently instructs us to add
compile 'com.google.android.gms:play-services:11.0.4'
to build.gradle. Notice that it currently advises version 11.0.4. Google adds:
Be sure you update this version number each time Google Play services is updated.
This one line appears to be quite possibly some of the worst advice ever given.
Why? Two reasons.
Suppose you use their free BaseGameUtils, which Google itself encourages. Its build.gradle is set up to use version 8.4.0:
ext.gms_library_version = '8.4.0'
I did this, and used the webpage's advice to use version 11.0.4. The disagreement in library numbers caused the app to crash on both Android Studio emulator and a test device with a stack trace similar to the one above.
To be fair, Android Studio will warn you that things can go wrong with the different version numbers: if you open the Manifest file, it will underline the version numbers and whine that it finds two different version numbers, and it will even tell you which version numbers disagree, but -- this is key -- it won't tell you where to find the other file(s) with different version numbers. If you are importing several libraries, and/or compiling dependencies on GitHub or elsewhere, it can be a bit of a challenge to find the cause.
If your app requests Play Games services 11.0.4, but your emulator and/or phone have a lower version number (e.g., 11.0.2 as on my emulator), then the Games API's connect() will give status RESULT_CANCEL to onActivityResult(). The documentation on these result codes leaves something to be desired, so this can take a while to debug -- in fact, I think I think the crashes above were my only clue that the problem might be with the API version number.
There is a way to check that the device supports the requested API, but most of Google's documentation doesn't tell you to do it, and even BaseGameUtils doesn't seem to check for it. (You want to look at GoogleApiAvailability.GOOGLE_PLAY_SERVICES_VERSION_CODE.)
In my particular case, the problem was solved by changing my app's play-services version to 8.4.0. Works beautifully now.
So I have a pretty robust android application and I want to add some code from a react-native only application in one activity. I've gone through the docs on the site and it turned out to be a lot more complicated to integrate a react-native app into an existing android native app. Among the may errors, this is the one I'm current stuck on, does anyone know where this comes from?
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:309)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.NoClassDefFoundError: com.facebook.react.CoreModulesPackage$1
at com.facebook.react.CoreModulesPackage.getNativeModules(CoreModulesPackage.java:96)
at com.facebook.react.LazyReactPackage.createNativeModules(LazyReactPackage.java:71)
at com.facebook.react.NativeModuleRegistryBuilder.processPackage(NativeModuleRegistryBuilder.java:97)
at com.facebook.react.ReactInstanceManager.processPackage(ReactInstanceManager.java:950)
at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:880)
at com.facebook.react.ReactInstanceManager.access$600(ReactInstanceManager.java:104)
at com.facebook.react.ReactInstanceManager$ReactContextInitAsyncTask.doInBackground(ReactInstanceManager.java:218)
at com.facebook.react.ReactInstanceManager$ReactContextInitAsyncTask.doInBackground(ReactInstanceManager.java:197)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
It's currently fetching the bundle and it gets to 100 percent but then the activity crashes with the error output above about CoreModulesPackages.
It's been pretty frustrating trying to get this thing up and running, there seems to be a bunch of errors from many sides, I had to import react native manually through an aar since the version on maven is archaic(0.20), download okhttp web socket support, FLog and .so loader stuff. Among also having to exclude architecture specific code. If anyone knows of an easier way to integrate a RN app into an existing codebase, I'd really appreciate it.
I'm coming from the native side trying to understand this thing. I set up npm, bundle up the js before staring the server and then run my app. After which i forward to the proper 8081 port. If I'm doing the sequence of steps wrong then someone please correct me. It's been 3 days. Halp.
I encountered this same error in my react native app on Android 5.x devices -- no issues on 6 or 7.
The issue ceased to occur after I removed Fabric.io Crashlytics as a dependency from my app.
I got same error.
Probles has been solved by properly configuration of multidex for old android
In my case I forgot to inherit my application class from MultiDexApplication
Crashlytics compile('com.crashlytics.sdk.android:crashlytics:2.4.0#aar') is integrated with the app and is being tested on nexus 7 4.4.4,
The crash is seen from application onCreate method and following stacktrace is obtained. No other similar error/explaination could be found on stackoverflow.
Any suggestions are welcome.
Caused by: java.lang.TypeNotPresentException: Type com/crashlytics/android/core/internal/CrashEventDataProvider not present
at java.lang.Class.getDeclaredAnnotation(Native Method)
at java.lang.Class.getAnnotation(Class.java:290)
at io.fabric.sdk.android.Kit.containsAnnotatedDependency(Kit.java:158)
at io.fabric.sdk.android.Kit.compareTo(Kit.java:140)
at io.fabric.sdk.android.Kit.compareTo(Kit.java:33)
at java.util.ComparableTimSort.countRunAndMakeAscending(ComparableTimSort.java:291)
at java.util.ComparableTimSort.sort(ComparableTimSort.java:153)
at java.util.ComparableTimSort.sort(ComparableTimSort.java:142)
at java.util.Arrays.sort(Arrays.java:1970)
at java.util.Collections.sort(Collections.java:1864)
at io.fabric.sdk.android.Fabric.initializeKits(Fabric.java:401)
at io.fabric.sdk.android.Fabric.init(Fabric.java:375)
at io.fabric.sdk.android.Fabric.setFabric(Fabric.java:332)
at io.fabric.sdk.android.Fabric.with(Fabric.java:303)
at com.xxxx.MainApplication.onCreate(MainApplication.java:19)
Apparently android limiatation of 65K methods is the problem on pre-lollipop devices, the problem is not due to crashalytics library per-se but in general one might run into this problem due to limitation of 65K methods at dalvik level.
Thanks to http://frogermcs.github.io/MultiDex-solution-for-64k-limit-in-Dalvik/ I was able to get the no. of methods in my .apk file.