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
Frame crashes on app restore occasionally #715
Comments
I have exactly the same issue on Android.
Sadly I don't know how to copy a full stack trace in this situation. Funny thing, that it is hard to reproduce if you simply suspending app, without running different ones. For example, If I'm locking/unlocking phone or simply navigating it, mostly - everything's great. But when it comes to launching different apps - it crashes with error above. When I've tried to debug it using node-inspector and placing a callbacks for all App Events except already handled suspend/resume, node-inspector is simply detaching somewhere upon 'Chrome' step described above. Any clues on how to copy a full stack trace or fixing this issue? I'm using nativescript-cli on Ubuntu 14.04 with real device. |
I am unable to replicate via those steps 100% of the time, however I did try to get a full stack trace by using the app analytics module of the telerik platform...app crashed twice on a demo, nothing logged.
|
I think I have a way to replicate the situation ,in the developers option , set background process limit to 2 or 1, open ns app , go to another app or two then go to the ns app. If the ns app is restarted it will crash as the above picture ( using real device here ) |
@x4080 👍 awesome. It really was crashing upon app restart. Didn't knew that on android dev options is such option, like limiting processes. And that actually works 100% of time Also, I think that this situation should've been able to be handled by at least - "lowMemory" or "uncaughtError" application events, but it's not. |
Glad it can help a bit..the Google search and stackoverflow talked about manifest app name setting but i still cannot resolve it. Maybe other people csn help |
+1 I would love to figure out a way to solve this issue as it is happening quite often. |
I think it needs high priority also |
raised the priority. We will investigate this further as part of 1.5 work. |
Thanks man |
I think the problem is in frame.android.ts (PageFragmentBody), android complains about the constructor is not public and have no empty constructor, I tried to change the constructor without parameters and calling new PageFragmentBody with :
(the constructor) :
It still the same result, maybe because class generated is not public ? How can we make inherited class in nativescript public ? |
Starting work on it... |
I managed to reproduce it. Go to the App Manager (the thing that has the RAM tab), go to "RAM" and hit the "Clear Memory" button to run the Low Memory Killer (LMK). Then go back to the app. I changed the code so that the PageFragmentBody now has a default empty constructor and is created via a static method called newInstance (as described here), but the Android runtime still can't find the default constructor of PageFragmentBody and crashes with the same exception. Here is the new source code. Maybe the Android runtime guys (@blagoev) will be able to help here. There is an issue in the Android Runtime repo: NativeScript/android#241 |
Just pasting the Java code that leads to this exception. Fragment.java: public static Fragment instantiate(Context context, String fname, @Nullable Bundle args) {
try {
Class<?> clazz = sClassMap.get(fname);
if (clazz == null) {
// Class not found in the cache, see if it's real, and try to add it
clazz = context.getClassLoader().loadClass(fname);
if (!Fragment.class.isAssignableFrom(clazz)) {
throw new InstantiationException("Trying to instantiate a class " + fname
+ " that is not a Fragment", new ClassCastException());
}
sClassMap.put(fname, clazz);
}
Fragment f = (Fragment)clazz.newInstance();
if (args != null) {
args.setClassLoader(f.getClass().getClassLoader());
f.mArguments = args;
}
return f;
} catch (ClassNotFoundException e) {
throw new InstantiationException("Unable to instantiate fragment " + fname
+ ": make sure class name exists, is public, and has an"
+ " empty constructor that is public", e);
} catch (java.lang.InstantiationException e) {
throw new InstantiationException("Unable to instantiate fragment " + fname
+ ": make sure class name exists, is public, and has an"
+ " empty constructor that is public", e);
} catch (IllegalAccessException e) {
throw new InstantiationException("Unable to instantiate fragment " + fname
+ ": make sure class name exists, is public, and has an"
+ " empty constructor that is public", e);
}
} |
Ok managed to reproduce this. Will be back with more info what is the issue. |
Any update on this? |
Hi guys, We have fixed this issue and it will be included in 1.6 release. |
Thumbs up..1.5 already finished? |
@hshristov Yeah is this a typo? Did you mean 1.5? I see the version has been incrimented to 1.5, but this is a pretty critical bug to push back to December or later. |
@sitefinitysteve Yeah typo on my side. Sorry. I meant 1.5 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
If I leave my app open, then come back to it later it crashes with this??
https://goo.gl/photos/Z8pJyrY8w8nNM9Uf6
... It's always done this
The text was updated successfully, but these errors were encountered: