Sorry cannot post the source code due to data privacy. Why(what can be the reason) does following type of crash occur. In my case its happening when I come back to the app from tapping on notification.
Logs are as follows:-
java.lang.IllegalStateException: SavedStateRegistry was already restored.
at androidx.savedstate.SavedStateRegistry.performRestore$savedstate_release(SavedStateRegistry.kt:221)
at androidx.savedstate.SavedStateRegistryController.performRestore(SavedStateRegistryController.kt:69) at androidx.fragment.app.FragmentViewLifecycleOwner.performRestore(FragmentViewLifecycleOwner.java:170) at androidx.fragment.app.Fragment.restoreViewState(Fragment.java:693)
at androidx.fragment.app.Fragment.restoreViewState(Fragment.java:3151)
at androidx.fragment.app.Fragment.performActivityCreated(Fragment.java:3142)
at androidx.fragment.app.FragmentStateManager.activityCreated(FragmentStateManager.java:579)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:264)
at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:113)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1433)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2977)
at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2895)
at androidx.fragment.app.Fragment.performActivityCreated(Fragment.java:3143)
at androidx.fragment.app.FragmentStateManager.activityCreated(FragmentStateManager.java:579)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:264)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1899)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1817)
at androidx.fragment.app.FragmentManager.execSingleAction(FragmentManager.java:1729)
at androidx.fragment.app.BackStackRecord.commitNow(BackStackRecord.java:317)
Tried to debug app but nothing useful found. Tried commenting code from onResume activity but its not causing the this crash.
Related
I get this error -> java.lang.AssertionError: Can't find built-in class kotlin.collections.List
sometimes when I launch my application. This crash sometimes appear and sometimes do not.
My code is
SmartRecyclerAdapter
.items(listItems) // here exception is being thrown
.map(Header::class, CustomEventVH::class)
.map(Appointment::class, UpcomingVH::class)
.add(OnCustomViewEventListener{
startActivity(Intent(requireContext(), ActivityAddAttachment::class.java))
})
.into<SmartRecyclerAdapter>(binding!!.recyclerview)
The error appears at .items(listItems)
I am trying to run my app on Android (One plus 6t). This was working fine before making a call to firebase but as soon as I add the line onSend={Fire.shared.send} to Chat.js, the app crashes. The logs just show Uncaught Error: Error calling JSTimers.CallTimers. Haven't seen this error anywhere else. Does anyone know what's the issue?
Here's the snack: https://snack.expo.io/#adititipnis/community
You can get this error if you omit an await call when sending JS objects to the native side, so the promise gets passed rather than the result.
I'm using the typical async sleep pattern that wraps setTimeout, so that may also be a factor in the way this error presents itself, I'm not entirely sure.
This is untested, but something like this should reproduce it:
// some async func
const asyncGetResult = async () => {
await sleep(17);
// etc.
return Promise.resolve(result);
};
// this should cause the error:
MyNativeComponent.nativeMethod({
result: asyncFunc() // <- missing 'await'
});
// this should not cause the error:
MyNativeComponent.nativeMethod({
result: await asyncFunc()
});
This can be difficult to track down if you don't know what you're looking for. I resorted to process of elimination, reverting changes file by file until I found the offending line. Hopefully this saves someone some time.
I have just finished my first android app as part of a school project ..one of my friends encountered a problem while trying to explore one of the activities in the app ..so i searched for solutions to get the crashes reports whenever they happen to fix the bugs ..i came across ACRA ..and I followed one of SO threads to setup ACRA to my app ..
RESULT: when the crashs happens the gmail app get launch in the device and the user (if he want to) he'll send the crash report by email ..Consedering not all users will want to ..i found in a comment in one of the SO threads that some developers use tracepot.
so i have used their link for integration in formUri but exploring my account on tracepot i get nothing ..is there something i am doing wrong (or if there is a better solution than using tracepot a backend , please suggest/explain or link a good tutorial, thanks!)
MyApplication.Java ( AFTER EDITING
#ReportsCrashes(
formUri = "https://collector.tracepot.com/79b1***",
reportType = org.acra.sender.HttpSender.Type.JSON,
httpMethod = org.acra.sender.HttpSender.Method.PUT,
mode = ReportingInteractionMode.TOAST,
resToastText = R.string.crash_toast_text
)
public class MyApplication extends Application {
#Override
public void onCreate() {
super.onCreate();
CaocConfig.Builder.create()
//.errorActivity(CustomErrorActivity.class) //default: null (default error activity)
.apply();
// The following line triggers the initialization of ACRA
ACRA.init(this);
}
}
EDIT :
msg in logcat if i use the http and email:
09-17 18:37:33.700 14329-14812/ma.ac.iav.menunaviagtion:acra W/ACRA: ma.ac.iav.menunaviagtion reports will be sent by email (if accepted by user).
09-17 18:37:33.703 14329-14812/ma.ac.iav.menunaviagtion:acra I/ACRA: Sending report /data/user/0/ma.ac.iav.menunaviagtion/app_ACRA-approved/2018-09-17T18:37:33.441+01:00-IS_SILENT.stacktrace
if i use only the http :
09-17 22:47:00.648 20116-20137/ma.ac.iav.myapplication:acra E/ACRA: Failed to send crash report for /data/user/0/ma.ac.iav.myapplication/app_ACRA-approved/2018-09-17T22:44:52.199+00:00-IS_SILENT.stacktrace
IMPLEMENTATION:
compile 'ch.acra:acra:4.9.2'
LOGCAT FOR F43nd1r
09-18 01:39:49.631 18508-18803/? E/AndroidRuntime: FATAL EXCEPTION: Thread-5
Process: ma.ac.iav.myapplication, PID: 18508
java.lang.InternalError: Thread starting during runtime shutdown
at java.lang.Thread.nativeCreate(Native Method)
at java.lang.Thread.start(Thread.java:733)
at android.app.SharedPreferencesImpl.startLoadFromDisk(SharedPreferencesImpl.java:119)
at android.app.SharedPreferencesImpl.<init>(SharedPreferencesImpl.java:112)
at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:392)
at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:373)
at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
at cat.ereza.customactivityoncrash.CustomActivityOnCrash.getLastCrashTimestamp(CustomActivityOnCrash.java:673)
at cat.ereza.customactivityoncrash.CustomActivityOnCrash.hasCrashedInTheLastSeconds(CustomActivityOnCrash.java:683)
at cat.ereza.customactivityoncrash.CustomActivityOnCrash.access$200(CustomActivityOnCrash.java:52)
at cat.ereza.customactivityoncrash.CustomActivityOnCrash$1.uncaughtException(CustomActivityOnCrash.java:112)
at org.acra.builder.ReportExecutor.endApplication(ReportExecutor.java:269)
at org.acra.builder.ReportExecutor.dialogAndEnd(ReportExecutor.java:254)
at org.acra.builder.ReportExecutor.access$400(ReportExecutor.java:42)
at org.acra.builder.ReportExecutor$2.run(ReportExecutor.java:217)
By default, if the mail config is present, Acra 4 will send via mail and nothing else.
To use both you'd have to configure the reportSenderFactories.
400: Client error
Indicates that tracepot rejected your report. This could have multiple reasons. To find out what the problem is, call ACRA.DEV_LOGGING = true; right before ACRA.init and post all logcat with the ACRA tag.
Also note that ACRA 4.9.2 does not support android Oreo and above, it is recommended to upgrade to at least ACRA 4.11, or just the newest version 5.2.0.
You are not sending all required fields to Tracepot.
https://tracepot.uservoice.com/knowledgebase/articles/355272-what-are-the-required-fields-acra-needs-to-send
ANDROID_VERSION
APP_VERSION_CODE
APP_VERSION_NAME
PACKAGE_NAME
REPORT_ID
STACK_TRACE
USER_APP_START_DATE
USER_CRASH_DATE
There is a crash that is showing up repeatedly in Firebase crash reporting for my React Native Android app. However, I am at a loss as to what would be causing it, as the stack trace doesn't cite any of my code. Does anyone know what might be the cause? I am on React Native 0.47.1
The stack trace is as follows:
Exception java.lang.RuntimeException: java.lang.InterruptedException
com.facebook.react.common.futures.SimpleSettableFuture.getOrThrow (SimpleSettableFuture.java:102)
com.facebook.react.bridge.queue.MessageQueueThreadImpl.startNewBackgroundThread (MessageQueueThreadImpl.java:199)
com.facebook.react.bridge.queue.MessageQueueThreadImpl.create (MessageQueueThreadImpl.java:146)
com.facebook.react.bridge.queue.ReactQueueConfigurationImpl.create (ReactQueueConfigurationImpl.java:87)
com.facebook.react.bridge.CatalystInstanceImpl.<init> (CatalystInstanceImpl.java:101)
com.facebook.react.bridge.CatalystInstanceImpl.<init> (CatalystInstanceImpl.java:42)
com.facebook.react.bridge.CatalystInstanceImpl$Builder.build (CatalystInstanceImpl.java:574)
com.facebook.react.ReactInstanceManager.createReactContext (ReactInstanceManager.java:999)
com.facebook.react.ReactInstanceManager.access$600 (ReactInstanceManager.java:109)
com.facebook.react.ReactInstanceManager$4.run (ReactInstanceManager.java:802)
java.lang.Thread.run (Thread.java:761)
Caused by java.lang.InterruptedException:
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly (AbstractQueuedSynchronizer.java:1301)
java.util.concurrent.CountDownLatch.await (CountDownLatch.java:203)
com.facebook.react.common.futures.SimpleSettableFuture.get (SimpleSettableFuture.java:66)
com.facebook.react.common.futures.SimpleSettableFuture.getOrThrow (SimpleSettableFuture.java:100)
com.facebook.react.bridge.queue.MessageQueueThreadImpl.startNewBackgroundThread (MessageQueueThreadImpl.java:199)
com.facebook.react.bridge.queue.MessageQueueThreadImpl.create (MessageQueueThreadImpl.java:146)
com.facebook.react.bridge.queue.ReactQueueConfigurationImpl.create (ReactQueueConfigurationImpl.java:87)
com.facebook.react.bridge.CatalystInstanceImpl.<init> (CatalystInstanceImpl.java:101)
com.facebook.react.bridge.CatalystInstanceImpl.<init> (CatalystInstanceImpl.java:42)
com.facebook.react.bridge.CatalystInstanceImpl$Builder.build (CatalystInstanceImpl.java:574)
com.facebook.react.ReactInstanceManager.createReactContext (ReactInstanceManager.java:999)
com.facebook.react.ReactInstanceManager.access$600 (ReactInstanceManager.java:109)
com.facebook.react.ReactInstanceManager$4.run (ReactInstanceManager.java:802)
java.lang.Thread.run (Thread.java:761)
This problem also occur for many others as well and the cause is various. You can find the discussion about it here. Since I really don't know what your app does so here is some possible reasons:
You're using react-native-navigation (you can try change it back to react-navigation)
You're using react-native-image-crop-picker or react-native-image-picker (Which produce the same error that make your app crash on some device and it throw InterruptedException
If the problem is number 2 you can try to fix it by alter MainApplication.java:
#Override
public boolean clearHostOnActivityDestroy() {
return false;
}
The fix in number 2 was also reference from here under acintyo answer.
As for changing the react-native version you can try it but I do not recommend it since after reading through the issues mentioned above, I saw that many version also experienced this issues (most of them are 0.49.+ or 0.45.x)
I'm working on Ionic mobile app development.
My requirement is to create client side logger to track issues in app. I used the methods mentioned in https://github.com/pbakondy/filelogger, and I could able to create the log file in both Android and iOS.
For the first time when I open the app, it creates the log file in cordova.file.dataDirectory, when I close and reopen the app in i*OS, I'm trying to read the content of the file which was created using the below
$fileLogger.getLogfile().then(function (loggerContent) {
var temp =loggerContent;
});
But the application says
{
"applicationDirectory":null,
"applicationStorageDirectory":null,
"dataDirectory":null,
"cacheDirectory":null,
"externalApplicationStorageDirectory":null,
"externalDataDirectory":null,
"externalCacheDirectory":null,
"externalRootDirectory":null,
"tempDirectory":null,
"syncedDataDirectory":null,
"documentsDirectory":null,
"sharedDirectory":null
}
So I couldn't able to find the file where i saved my logs.
Please help me resolve this issue or if you could recommend me a different method to get around this issue, that would be great!
Thanks for the answers
There is a check list here and should solve your problem :
1-Be sure that the cordova-file-plugin is installed and works in your test environment.
2-Be sure that the cordova.js file is refrenced by your html and before your code usage.
3-Be sure to call your codes after device_ready state :
check this
4-Call your function after a short delay (use setTimeOut in Javascirpt)
Ali's item 4 is very important:
I had a similiar problem on different platforms: cordova.file.dataDirectory was null.
I tracked cordova.file.dataDirectory over the lifecycle and it was first accessed by my Ionic 2 code BEFORE the device ready event was fired.
My "mistake": I wanted to load data during the constructor(!) of a service. Seems too early.