3

I'm fairly new to Android apps and ran into a problem that I simply cannot figure out. I don't even know how to start debugging it so I'm hoping someone can help.

My app started to crash during startup only on Huawei phones and out of the blue (I didn't release an update, the crash seemed to just appear on Huawei). It happens before the first screen in my app is loaded so I don't know how to start investigating where the crash originates. I have posted the crash log below. I'm using Android Studio.

Can anyone tell me what I'm missing - or where I could start looking?

11-26 21:06:44.367 6874-6874/? E/HwOUC: [main-1]checkHwoucBetaApplicationExist NameNotFoundException is com.huawei.android.hwoucbeta(/HwOucUtility.java:4900)
android.content.pm.PackageManager$NameNotFoundException: com.huawei.android.hwoucbeta
    at android.app.ApplicationPackageManager.getApplicationInfo(ApplicationPackageManager.java:321)
    at com.huawei.android.hwouc.util.HwOucUtility.checkHwoucBetaApplicationExist(HwOucUtility.java:4896)
    at com.huawei.android.hwouc.util.HwOucUtility.processCancelAllVersinoLockForBeta(HwOucUtility.java:4878)
    at com.huawei.android.hwouc.util.HwOucUtility.initNewVersionRecord(HwOucUtility.java:2742)
    at com.huawei.android.hwouc.util.HwOucConfig.initialize(HwOucConfig.java:1911)
    at com.huawei.android.hwouc.HwOucApplication.onCreate(HwOucApplication.java:59)
    at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1015)
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4837)
    at android.app.ActivityThread.access$1600(ActivityThread.java:168)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1440)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:150)
    at android.app.ActivityThread.main(ActivityThread.java:5665)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:822)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:712)
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Amalie
  • 282
  • 1
  • 3
  • 15

1 Answers1

0

NameNotFoundException

This exception is thrown when a given package, application, or component name cannot be found.

Ensure that your package name is correct. Try to use below code to get your package name

PackageInfo info = this.getPackageManager().getPackageInfo(this.getPackageName(), PackageManager.GET_SIGNATURES);

According to here: https://blog.csdn.net/qq_32519693/article/details/74936847, also try to add proper runtime permission request if you haven't done that.

shizhen
  • 12,251
  • 9
  • 52
  • 88
  • Thanks. I tried that, and the package is correct. Like I said, works fine on all other phones - only an issue on Huawei. – Amalie Nov 27 '18 at 03:19
  • can post the related code to `[main-1]checkHwoucBetaApplicationExist NameNotFoundException is com.huawei.android.hwoucbeta(/HwOucUtility.java:4900)` ? – shizhen Nov 27 '18 at 03:20
  • What do you mean? None of my code is being run so I'm not sure what I should post. The crash happens before the app even starts - it seems to be happening while installing the apk. – Amalie Nov 27 '18 at 03:29
  • probably, you need to install this application https://www.appbrain.com/app/system-update/com.huawei.android.hwouc for Huawei phones, because I see this `checkHwoucBetaApplicationExist ()` . – shizhen Nov 27 '18 at 03:31
  • Thanks, I'll try that to get my own Huawei working. However, I have a lot of users of my app that can't use it right now because it's not working and I can't get them to install this so it doesn't solve my problem. – Amalie Nov 27 '18 at 03:35
  • One possible workaround is to create a dummy app/service with the same package name as this application, so that you can bypass/cheat the check of `checkHwoucBetaApplicationExist`. – shizhen Nov 27 '18 at 03:42
  • Please keep me posted for your updates, i have a lot of interest in this. :) – shizhen Nov 27 '18 at 03:43
  • Alright I’ll try that, thanks! And I’ll make sure to update here – Amalie Nov 27 '18 at 03:51