When I try to run my application on Huawei P9 I’m getting the error
Attempt to invoke virtual method 'int com.huawei.lcagent.client.LogCollectManager.getUserType()' on a null object reference
Is there any way to debug this because application works on other Android 6 phones (Samsung, HTC...).
APP: https://play.google.com/store/apps/details?id=com.morescreens.mkt
LOG:
07-04 10:42:56.045: W/System.err(955): java.lang.NullPointerException: Attempt to invoke virtual method 'int com.huawei.lcagent.client.LogCollectManager.getUserType()' on a null object reference 07-04 10:42:56.046: W/System.err(955): at com.android.server.util.ReportTools.getUserType(ReportTools.java:86) 07-04 10:42:56.046: W/System.err(955): at com.android.server.util.ReportTools.isBetaUser(ReportTools.java:73) 07-04 10:42:56.046: W/System.err(955): at com.android.server.util.ReportTools.report(ReportTools.java:58) 07-04 10:42:56.046: W/System.err(955): at com.android.server.util.HwUserBehaviourRecord.appExitRecordInnerImpl(HwUserBehaviourRecord.java:125) 07-04 10:42:56.046: W/System.err(955): at com.android.server.util.HwUserBehaviourRecord.access$200(HwUserBehaviourRecord.java:32) 07-04 10:42:56.046: W/System.err(955): at com.android.server.util.HwUserBehaviourRecord$AsyUploadLooperThread$1.handleMessage(HwUserBehaviourRecord.java:255) 07-04 10:42:56.046: W/System.err(955): at android.os.Handler.dispatchMessage(Handler.java:102) 07-04 10:42:56.046: W/System.err(955): at android.os.Looper.loop(Looper.java:150) 07-04 10:42:56.046: W/System.err(955): at com.android.server.util.HwUserBehaviourRecord$AsyUploadLooperThread.run(HwUserBehaviourRecord.java:267)
Does anyone experianced such issue? What is the best way to contact Huawei support for this error? I send them e-mail on consumer support site. Is there any developer support site or e-mail? Please provide links. Thanks in advance!
EDIT: I have figured out that this exception wasn't invoked by my app. However, my app was exiting nearly this exception which led me to think that app is crashing but in fact something was killing my app. It was my code in Application.onTrimMemory method which was "Called when the operating system has determined that it is a good time for a process to trim unneeded memory from its process". I still don't know why this method was called only on Huawei P8, P9 devices, never get any response from Huawei support.
The exception is generic, could have many causes and I found that the best way to go deeper and have a detailed view of it, it's enable more detailed log in Project Menu of the phone.
On P9 can be done writing the code: * # * # 2846579 # * # *
in phone number composition, it open Project Menu such as in picture:
Project Menu
then choose Background settings -> Log settings and check all the items; your logcat will be more detailed and easier to find the original error that give that exception. After using, uncheck in Log settings to avoid degrading your phone system performance.
In my case, it was a iap plugin inserted in unity project in my app, too old, never used but initialized: this crash my app and give the error; deleting it and all it's ok.
I know this is old but my problem showed when i added service with non-existing class in manifest.
I get the same Error.
Just in case you don't get an answer here, be sure to check my question .
PS: would have written this as a comment, but unfortunately i haven't earned enough reputation yet
I was getting this error because I was passing an int to a TextViews setText method.
Fix that worked..
textView.setText(intValue + "");
you just need to goto settings of your device and then goto "Apps" and Select you app after that and Give permission All permissions...it would be working after that
来源:https://stackoverflow.com/questions/39588023/unable-to-start-android-app-due-to-logcollectmanager-getusertype-error