[AC-6115] Android App Freezing and stuck app screen
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Not Our Bug |
Resolution Date | 2019-02-12T22:05:52.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | Android,, Appcelerator,, Titanium |
Reporter | Pankti Pancholi |
Assignee | Shak Hossain |
Created | 2019-01-23T21:06:38.000+0000 |
Updated | 2019-02-20T16:41:44.000+0000 |
Description
- Android app on restart giving blank black screen and also gets freeze any time.
- Phone hang when try to open app from background
After reading all other related bugs I have tried using Appcelerator CLI 7.0.9 but its just badly messed up with my UI and functionality of all screens so I have decided to revert it back to 7.0.6
Getting following errors in my console
[ERROR] : TiExceptionHandler: (main) [15128,88247] Not allowed to start service Intent { cmp=ca.wearecircus.bcc/com.radiusnetworks.ibeacon.IBeaconIntentProcessor (has extras) }: app is in background uid UidRecord{fe9fde7 u0a474 LAST bg:+1m3s223ms idle procs:1 seq(0,0,0)}
[ERROR] : TiExceptionHandler:
[ERROR] : TiExceptionHandler: android.app.ContextImpl.startServiceCommon(ContextImpl.java:1538)
[ERROR] : TiExceptionHandler: android.app.ContextImpl.startService(ContextImpl.java:1484)
[ERROR] : TiExceptionHandler: android.content.ContextWrapper.startService(ContextWrapper.java:663)
[ERROR] : TiExceptionHandler: com.radiusnetworks.ibeacon.service.Callback.call(Callback.java:63)
[ERROR] : TiExceptionHandler: com.radiusnetworks.ibeacon.service.IBeaconService.processRangeData(IBeaconService.java:533)
[ERROR] : TiExceptionHandler: com.radiusnetworks.ibeacon.service.IBeaconService.finishScanCycle(IBeaconService.java:451)
[ERROR] : TiExceptionHandler: com.radiusnetworks.ibeacon.service.IBeaconService.scheduleScanStop(IBeaconService.java:436)
[ERROR] : TiExceptionHandler: com.radiusnetworks.ibeacon.service.IBeaconService.access$100(IBeaconService.java:62)
[ERROR] : TiExceptionHandler: com.radiusnetworks.ibeacon.service.IBeaconService$2.run(IBeaconService.java:432)
[ERROR] : TiExceptionHandler: android.os.Handler.handleCallback(Handler.java:789)
[ERROR] : TiExceptionHandler: android.os.Handler.dispatchMessage(Handler.java:98)
[ERROR] : TiExceptionHandler: android.os.Looper.loop(Looper.java:164)
[ERROR] : TiExceptionHandler: android.app.ActivityThread.main(ActivityThread.java:6944)
[ERROR] : TiExceptionHandler: java.lang.reflect.Method.invoke(Native Method)
[ERROR] : TiExceptionHandler: com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
[ERROR] : TiExceptionHandler: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
This looks like an issue with a module using "beacon". Can you tell me which module this is please? From the stacktrace, I can tell that this is an issue with that beacon module trying to start a "service" while the app is backgrounded. As of Android 8.0, Google made a breaking change where you can no longer start a background service like this. It has to be made a "foreground" service instead. It sounds like the module's code needs to be changed.
I am using liferay beacons -
Edit: _(Sorry. I posted to the wrong ticket.)_
I'm guessing you're using the following module? https://github.com/jamesfalkner/liferay-android-beacons It's using a "radius.jar" which is documented as a 2014 release. This jar library contains the "com.radiusnetwork.ibeacon" classes which is causing this exception. https://github.com/jamesfalkner/liferay-android-beacons/tree/master/lib The issue is in the "radius.jar". This can't be fixed in the module's code or your code. It's an issue with that old library. And the reason it is crashing is because Google made a breaking-change in Android 8.0 where you're no longer allowed to start a service while the app is in the background... unless you make it a "foreground" service. But you can only make it a "foreground" service via a code change because it involves displaying a notification in the top status bar. https://developer.android.com/about/versions/oreo/background#services So, this means contacting the module developer to see about getting a newer JAR, assuming the original JAR developer has fixed this issue. That's really the only solution. Well, the only other alternative is to "target" Android 7.1 when building your app, but Google Play no longer accepts apps which target versions older than 8.0. So, this is only a viable solution when not deploying via Google Play.
Please check this new error again, We are already running app in Android 8.0.0 which is live on playstore, It is working fine for everyone, I feel it has something to do with some titanium version and java.lang.thread.run error as I started getting it all of sudden in testing version of our app. It is not happening with live app on app store and its not showing me error every-time from one module, Some time beacon, some time other modules [ERROR] : APSAnalyticsRunnable: Error posting events: method POST must have a request body. [ERROR] : APSAnalyticsRunnable: java.lang.IllegalArgumentException: method POST must have a request body. [ERROR] : APSAnalyticsRunnable: at com.android.okhttp.Request$Builder.method(Request.java:259) [ERROR] : APSAnalyticsRunnable: at com.android.okhttp.internal.huc.JavaApiConverter.createOkResponseForCacheGet(JavaApiConverter.java:212) [ERROR] : APSAnalyticsRunnable: at com.android.okhttp.internal.huc.CacheAdapter.get(CacheAdapter.java:51) [ERROR] : APSAnalyticsRunnable: at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:326) [ERROR] : APSAnalyticsRunnable: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:489) [ERROR] : APSAnalyticsRunnable: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131) [ERROR] : APSAnalyticsRunnable: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:262) [ERROR] : APSAnalyticsRunnable: at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:218) [ERROR] : APSAnalyticsRunnable: at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(Unknown Source:0) [ERROR] : APSAnalyticsRunnable: at com.appcelerator.aps.APSAnalyticsRunnable.run(APSAnalyticsRunnable.java:164) [ERROR] : APSAnalyticsRunnable: at java.lang.Thread.run(Thread.java:764)
About the module: The RadiusNetwork library has been removed by the author: https://github.com/RadiusNetworks/android-ibeacon-service The replacement library is https://github.com/AltBeacon/android-beacon-library but has to have a new module. So I think you are stuck with the old radius library or create a new one. And as mentioned in the ti.goosh ticket: https://github.com/AltBeacon/android-beacon-library/issues/673 [~jquick] is right: it is about the background/foreground stuff.
Hello [~ppancholi], Can you please follow up here? Did you follow Joshua's guide to follow up with the module developer to see about getting a newer JAR? Share with us their response regarding this issue. Thanks.
No, I did not get newer jar yet as it is not available , the library has been removed by the developer