Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Android IL2CPP Build crashes while select both arm64 and armv7 architecture

Discussion in 'Android' started by JayWang1999, May 21, 2021.

  1. JayWang1999

    JayWang1999

    Joined:
    Oct 6, 2016
    Posts:
    3
    Only select one of them(arm64 or armv7 single) would not crash,
    but when I check both of them, the app would crash before loading the scene.
    I added Debug.Log at one of the Start method of my first scene, it doesn't shown in the logcat.
    I pasted the logcat content below:
    Code (CSharp):
    1. 2021-05-21 15:27:31.209 31524-31552/? E/CRASH: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    2. 2021-05-21 15:27:31.209 31524-31552/? E/CRASH: Version '2021.1.7f1c1 (4e944ebb9621)', Build type 'Development', Scripting Backend 'il2cpp', CPU 'armeabi-v7a'
    3. 2021-05-21 15:27:31.209 31524-31552/? E/CRASH: Build fingerprint: 'Xiaomi/pine/pine:10/QKQ1.191014.001/V12.0.3.0.QCMCNXM:user/release-keys'
    4. 2021-05-21 15:27:31.209 31524-31552/? E/CRASH: Revision: '0'
    5. 2021-05-21 15:27:31.209 31524-31552/? E/CRASH: ABI: 'arm'
    6. 2021-05-21 15:27:31.209 31524-31552/? E/CRASH: Timestamp: 2021-05-21 15:27:31+0800
    7. 2021-05-21 15:27:31.209 31524-31552/? E/CRASH: pid: 31524, tid: 31552, name: UnityMain  >>> com.TeamYuhui.PolarNightCruise <<<
    8. 2021-05-21 15:27:31.209 31524-31552/? E/CRASH: uid: 10205
    9. 2021-05-21 15:27:31.209 31524-31552/? E/CRASH: signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x85285fe4
    10. 2021-05-21 15:27:31.209 31524-31552/? E/CRASH:     r0  b12cfa08  r1  00000000  r2  000000e0  r3  0000000e
    11. 2021-05-21 15:27:31.209 31524-31552/? E/CRASH:     r4  000000e0  r5  00000000  r6  00000000  r7  0000000e
    12. 2021-05-21 15:27:31.209 31524-31552/? E/CRASH:     r8  00000001  r9  0000000e  r10 00000000  r11 b12cfa08
    13. 2021-05-21 15:27:31.209 31524-31552/? E/CRASH:     ip  ade95d1c  sp  85286000  lr  ade16855  pc  ade16b24
    14. 2021-05-21 15:27:31.209 31524-31552/? E/CRASH: backtrace:
    15. 2021-05-21 15:27:31.209 31524-31552/? E/CRASH:       #00 pc 00036b24  /apex/com.android.runtime/lib/bionic/libc.so (arena_choose) (BuildId: 36720ba5aeb300d75235d367cb8550ae)
    16. 2021-05-21 15:27:31.209 31524-31552/? E/CRASH:       #01 pc 0000025e  [anon:.bss]
    17. 2021-05-21 15:27:32.316 31524-31552/? E/CRASH: Tombstone written to: /storage/emulated/0/Android/data/com.TeamYuhui.PolarNightCruise/files/tombstone_00
    18. 2021-05-21 15:27:32.317 31524-31552/? E/AndroidRuntime: FATAL EXCEPTION: UnityMain
    19.     Process: com.TeamYuhui.PolarNightCruise, PID: 31524
    20.     java.lang.Error: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    21.     Version '2021.1.7f1c1 (4e944ebb9621)', Build type 'Development', Scripting Backend 'il2cpp', CPU 'armeabi-v7a'
    22.     Build fingerprint: 'Xiaomi/pine/pine:10/QKQ1.191014.001/V12.0.3.0.QCMCNXM:user/release-keys'
    23.     Revision: '0'
    24.     ABI: 'arm'
    25.     Timestamp: 2021-05-21 15:27:31+0800
    26.     pid: 31524, tid: 31552, name: UnityMain  >>> com.TeamYuhui.PolarNightCruise <<<
    27.     uid: 10205
    28.     signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x85285fe4
    29.         r0  b12cfa08  r1  00000000  r2  000000e0  r3  0000000e
    30.         r4  000000e0  r5  00000000  r6  00000000  r7  0000000e
    31.         r8  00000001  r9  0000000e  r10 00000000  r11 b12cfa08
    32.         ip  ade95d1c  sp  85286000  lr  ade16855  pc  ade16b24
    33.    
    34.     backtrace:
    35.           #00 pc 00036b24  /apex/com.android.runtime/lib/bionic/libc.so (arena_choose) (BuildId: 36720ba5aeb300d75235d367cb8550ae)
    36.           #01 pc 0000025e  [anon:.bss]
    37.    
    38.         at libc.arena_choose(arena_choose:0)
    39.         at [anon:.0x25e(Native Method)
     
    mbhagat likes this.
  2. JayWang1999

    JayWang1999

    Joined:
    Oct 6, 2016
    Posts:
    3
    In addition, I've tried Unity 2021.1.5/1.6/1.7 , all of them has the same problem.
     
  3. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,682
    Sadly there's no clear info why it's crashing, what about empty project, does it crash too?

    If no, could you please submit a bug with repro project attached? THank you
     
  4. rabbitmountain

    rabbitmountain

    Joined:
    Nov 21, 2016
    Posts:
    3
    We are running into the same issue. So fare completely random so very hard to even report a bug.
    On latest 2020.3.14 LTS

    In one case it was temp resolves by building for only ARM7 and then including ARM64 later and then the build didn't crash (with both ARM7 + ARM64).

    After one (very) minor code change the crash returned and the previous workaround didn't work any longer.
     
  5. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,682
    Try checking the stacktrace after the crash, also be sure to have symbols generated for every build, so you can resolve stacktrace
     
  6. c3bgames

    c3bgames

    Joined:
    Jun 14, 2020
    Posts:
    3
    I have the same problem. The following work around seems to work for me when this starts up. I turn off arm64 and compile only for armv7. I then turn arm64 back on and compile for both arm64 and armv7 and then it works. This is in Unity 2021.1.10f1. This problem of crashing seems to randomly start at some point, and then I have to do the above to get it back to normal.
     
    Coco07 likes this.
  7. rabbitmountain

    rabbitmountain

    Joined:
    Nov 21, 2016
    Posts:
    3
    Thanks, work around works for us, and indeed in can start crashing again after simply changing one line of code.
    At this point we're buidling seperate arm7 and arm64 bundles as it gives more reliable outcome.
     
  8. michaeldobele

    michaeldobele

    Joined:
    Oct 25, 2016
    Posts:
    10
    We've been experiencing the same issue recently in two of our projects, it seems to have begun after recently updating to Unity 2020.3.16f1. It seems to have just randomly started happening and the work-around of disabling Armv64, doing a build that will work then re-enabling both Armv7 / Armv64 again is also working for us.
     
  9. Coco07

    Coco07

    Joined:
    Mar 7, 2017
    Posts:
    49
    Since Google obligatorily wants an .aab file instead of .apk, we also had to enable "Armv7" and "Arm64". Since then the app does not start anymore and we have exactly the same problem...

    The workaround seems to work for me sometimes, but not always.

    Is there any news on this yet?

    Unity version 2021.1.20f1
     
    joaoborlido17465 and muratoter like this.
  10. lagalot123

    lagalot123

    Joined:
    Nov 12, 2015
    Posts:
    12
    We're having the same issue, with both ARMv7 and ARM64 selected it sometimes works but usually the apk just crashes or freezes on startup, removing ARMv7 support seems to fix it.

    Bug report with repro project: 1362153

    Edit: Not sure if it's related, but after installing an apk that would crash on startup, sometimes unrelated other unity games would start crashing on startup as well, after uninstalling the broken apk and restarting the device the other games would work normally again.
     
    Last edited: Sep 10, 2021
  11. Coco07

    Coco07

    Joined:
    Mar 7, 2017
    Posts:
    49
    Hi @mh54613,

    I didn't even notice the crash with other apps. This is another reason that Unity should fix this problem quickly.
    I can't find the bug report, can you share it via link here? That would be very nice :)
     
  12. Coco07

    Coco07

    Joined:
    Mar 7, 2017
    Posts:
    49
    Maybe it will help someone:

    I was just now able to export several runnable builds with intermediate changes in the code. I had previously deleted the library folder in the project folder once and now it seems to work. CAUTION: All assets will be re-imported and it may be necessary to switch back to the previous platform, also the project must be closed when deleting the folder. Otherwise, everything worked fine for me, even the project settings were all preserved.
     
    Last edited: Sep 13, 2021
    Wortium likes this.
  13. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    383
    We're getting this too and the backtrace for the crash is unresolvable. We were seeing the crash in both ARMv7 and ARM64 devices. The AAB is unusable. We recently upgraded from Unity 2020.3.17f1 to 2020.3.18f1 and then this problem started happening. @Coco07 's suggestion worked, but we didn't delete the entire Library folder, only the il2cpp, ScriptAssemblies, PlayerDataCache, BuildPlayerData, and Artifact folders. One of those was probably key to this, if I had to speculate I would guess il2cpp is the culprit.
     
  14. lagalot123

    lagalot123

    Joined:
    Nov 12, 2015
    Posts:
    12
  15. RaventurnPatrick

    RaventurnPatrick

    Joined:
    Aug 9, 2011
    Posts:
    173
    The same happens for us with Unity 2020 LTS on all devices we tested
     
    FamishedMammal likes this.
  16. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    383
    I can confirm that just removing the Library/il2cpp* folders will resolve the issue. Happens frequently when switching between architecture types, for example going from a Mono/ARMv7 Build to a IL2CPP/ARMv7+ARM64 build.
     
  17. RaventurnPatrick

    RaventurnPatrick

    Joined:
    Aug 9, 2011
    Posts:
    173
    I can also confirm now that deleting the Library/il2cpp* folders resolves the problem (and has no major impact on build times)
     
    unity_6lFscwL5Mm2QPQ likes this.
  18. GuilhermeDuarte21

    GuilhermeDuarte21

    Joined:
    Oct 29, 2016
    Posts:
    6
    Deleting Library/il2cpp* folders didn't work for me.
    I even switched to version 2021.1.25f1.

    My game doesn't even open, it crashes instantly
     
    joaoborlido17465 likes this.
  19. Jerry-Lee

    Jerry-Lee

    Joined:
    Apr 10, 2014
    Posts:
    3
    Hey guys, this bug also drive me crazy. But I found if export gradle project and generate apk or aab in Android Studio will be fine. Seems that there are some differences between Unity build and AS build.
     
  20. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,682
    Try deleting Library folder, if it doesn't help, could you submit a bug report with repro project attached ? Thank you
     
  21. Kiraaa23

    Kiraaa23

    Joined:
    Nov 30, 2018
    Posts:
    2
    Yeah, I too confirm that deleting Il2Cpp folders from the library worked for me. Thank you
     
  22. dunghn94

    dunghn94

    Joined:
    Jul 4, 2015
    Posts:
    3
    I am too confirm. Deleting Library folder worked on Unity 2020.3.x
     
    mbhagat likes this.
  23. rmgomez

    rmgomez

    Joined:
    Oct 2, 2014
    Posts:
    18
    korlinga likes this.
  24. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    383
  25. Nith666

    Nith666

    Joined:
    Aug 1, 2012
    Posts:
    56
    deleting Library/il2cpp* folders did the trick for me, too. Unity 2020.3.38f1
     
    mbhagat likes this.
  26. mbhagat

    mbhagat

    Joined:
    Dec 15, 2013
    Posts:
    49
    Wow ! Deleting iL2cpp worked finally.
    Wasted too much time before.
     
  27. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    422
    Deleting iL2cpp works OMG
     
  28. Zapan15

    Zapan15

    Joined:
    Apr 11, 2011
    Posts:
    179
    Deleting worked, 2020.3.41f1; There is no backport currently, but good to know that this will work. +1 Community!
     
  29. Zapan15

    Zapan15

    Joined:
    Apr 11, 2011
    Posts:
    179
    We had an issue where deleting the iL2cpp folders did not work, but deleting the library folder does.
     
    korlinga likes this.