-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
openPhotoGallery() restarting app on Android 9 #14024
Comments
sounds more like a memory issue. Please try to run it with edit: some older phones have those memory issues as you can see here: https://stackoverflow.com/questions/40357163/android-app-restarts-during-gallery-intent |
Thanks M1ga, I see, it seems odd that the photo picker would do this when nothing else does though. I'll try your suggestion and try trimming/optimising anything that might be boosting the memory footprint around that process. |
the photo picker is loading externally over your app and if memory gets low your app is killed in the background. The SO post is a native app with the same error so it's not Titanium exclusive but of course Ti will add some more memory overhead around your app compared to a native app so it's more likely to happen there |
I see, that makes sense. I guess looking into logs deeper and optimising the app where possible might be in order then. Thanks for the explanation. |
I appreciate this likely isnt Titanium, but I have this from the logs, could it be related? There is a note about memory wastage. We're using the following modules:
|
found the same for flutter: Android Studio Debug tools or something like https://square.github.io/leakcanary/ might be something worth looking at. You can add
to your apps build.gradle file and it will look memory leaks. And for studio: open build/android in Android studio and then build a debug version to your device. After that look at the profiler menu to see you memory levels |
Thanks. Neah I think you're right that it probably isn't SDK related, I wondered if it was maybe module related and wanted some guidance is all. Thanks for this, appreciated. |
I have searched and made sure there are no existing issues for the issue I am filing
Description
We're getting an app restart on an Xiaomi A1 running Android 9 when Ti.Media.openPhotoGallery() is called.
Behaviour:
Photo gallery opens, when the photo gallery is retracted (either by cancelling or selecting a photo) the app restarts. Checking the console on LiveView it appears that the live view disconnects a moment after the photo gallery has opened. So it looks like the app is going into background refresh when the gallery is open.
Other than the liveview disconnecting when using live view, there are no error messages or anything appearing in the console, the app just restarts when the gallery is closed.
Note: This happens with regular builds and in live view.
Frequency:
Typically 1 in 5 gallery openings will lead to a restart, once a restart has occurred it will continue restarting every time.
Expected Behavior
App shouldn't background restart
Actual behavior
App restarts when photo gallery is opened.
Reproducible sample
Steps to reproduce
Not sure whether this is isolated to an Android version or something to do with this device. The code runs fine on Android 11+ devices. We use this for testing older Android versions, perhaps Android 9 related?
Platform
Android
SDK version you are using
12.3.0.GA
Alloy version you are using
No response
The text was updated successfully, but these errors were encountered: