Crashes on HUAWEI Devices Android 8/8.1

Hi everybody,

After a recent Patch for our game we have observed a noticable rise in crashes on Android. The crashes occur soley on HUAWEI devices with Android 8 or 8.1.

For example:

java.lang.Error: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000 Build fingerprint: ‘HUAWEI/RNE-L21/HWRNE:8.0.0/HUAWEIRNE-L21/339(C432):user/release-keys’ Revision: ‘0’ pid: 26647, tid: 14849, name: UnityMain >>> <<< r0 00000000 r1 ba3ffa68 r2 00000000 r3 00000002 r4 00000001 r5 00000000 r6 13d883b0 r7 13200148 r8 13e1acd0 r9 a8389e00 sl c29be3b0 fp 76865368 ip c18e1efc sp ba3ff4a0 lr c0d2224c pc c0b266c0 cpsr e4dacc90

at libunity.004366c0 (Native Method) [-> nativeFocusChanged(_JNIEnv, _jobject, bool)]
at libunity.004369f0 (Native Method) [-> AndroidGraphics::ApplyPendingWindowChanges()]
at libunity.00442d10 (Native Method) [-> AndroidGraphics::AcquireContext()]
at base.oatexec (oatexec)

We are using Unity 2018.2.15f1.

Thanks in advance.

We are experiencing a LOT of the same “AndroidGraphics::AcquireContext()”
crash reported in unity crash reporting. It still occurs in 2018.2.20. Have not yet tried 2018.3.x. We were unsure if it was caused by ad plugins or was a “unity bug”.

On our end it is more likely to be on resume of the app. I don’t recall changing anything regarding the ads, but i will validate this further.

I also am having a problem in Huawei device, my game isn’t realease yet, but I can’t intall it on my Huawei mate 10 Lite, even though it works fine on samsung phones.
When I run the apk after a short time it just says “App not installed.” with a warning sign

@IJhunter This seems like a buildfailure to me more than anything. Are you sure that you installed the same apk for both your HUAWEI and Samsung Device?

I had this happen to me, when

  • my bundle identifier wasn’t set correctly
  • my manifest wasn’t set up correctly
  • The app was already installed on my phone
  • The app was already installed for a different user on the phone
  • I tested the Amazon Version of the same App, while it being installed from the Google Store

(Not 100% sure on all those cases but at least some of them prompted me to see the “Not installed” message)

Possibly when the user resumes/returns to the game activity after viewing an interstitial or rewarded ad?

I can’t outrule an issue here, knowing most of the contents of the update it seems unlikely to me. Do you have strong indications that it is the ads causing the issues in your app?

Hey thanks for the tip, I’m pretty sure it was the same apk.

But it’s ok for now, it seems this problem only occurs when I have Build System set to Gradle instead of internal, and I also have development build checked.

Did an update we added ads to the game for the first, so seemed a very likely cause. Good to hear that doesn’t seem like the cause for someone else. We’ll try moving up to 2018.3 and see if that fixes it.

We also have Vulken disabled (testing if it was causing crashes). You wouldn’t happen to also have it disabled?

To my knowledge, Vulkan was always enabled in our project.
It seems that we are no longer recieving crash reports.
We are not 100% on what had caused the issue:

  • We had a faulty entry in the Manifest that caused users to have 2 icons of our App, it might have crashed when the user clicked the “other” icon in order to resume
  • It also might have been a timing issue in OnResume. And the timing changed with some other changes.

Either way I can’t conclusively say what caused or fixed the issue for us. sry :frowning:

interesting you didn’t have Vulken active either. We’ll try activating it in an update and see how the crash rate goes.

I’m on Unity 2017.4.22f1 and just starting splitting 32 and 64 bit Android apks recently. The release after we had done this, we started seeing a very similar stacktrace that was mentioned above:

AndroidGraphics::AcquireContext()
AndroidGraphics::ApplyPendingWindowChanges()
nativeFocusChanged(_JNIEnv*, _jobject*, bool)

Breadcrumbs suggest the user backgrounds the app for some time (typically a pretty short time) then the crash happens once my app comes into the foreground. I do have a custom main Android activity, and integrate with several ad networks but I don’t know yet if either of these are the root cause. I do know that disabling ads significantly reduces the related crash groups. Has anyone found any more information on this or found root cause?

FYI we had this problem and it was a missing android:launchMode=“singleTask” on our main activity at AndroidManifest.xml (we had a custom one.

Their example lacks this information:

But it can be seen here:

3 Likes