Search Unity

Android IL2CPP build crashes in MetadataCache.cpp

Discussion in 'Editor & General Support' started by brgishy, Aug 13, 2019.

  1. brgishy

    brgishy

    Joined:
    Jul 9, 2013
    Posts:
    31
    I'm seeing a very weird crashing bug. The first time I install my app everything works great, but if I uninstall the app and install a new build, the app will crash instantly at MetadataCache.cpp line 756. Has anyone ran into this before?

    Logcat Output
    08/13 08:17:52.456 10220 10272 Fatal libc: C:\Program Files\Unity\Hub\Editor\2019.2.0f1\Editor\Data\il2cpp\libil2cpp\vm\MetadataCache.cpp:756: static Il2CppMethodPointer il2cpp::vm::MetadataCache::GetMethodPointer(const Il2CppImage *, uint32_t): assertion "rid <= image->codeGenModule->methodPointerCount" failed
    08/13 08:17:52.457 10220 10272 Error CRASH: signal 6 (SIGABRT), code -6 (?), fault addr --------
    08/13 08:17:52.457 10220 10272 Error CRASH: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    08/13 08:17:52.457 10220 10272 Error CRASH: Build type 'Development', Scripting Backend 'il2cpp', CPU 'armeabi-v7a'
    08/13 08:17:52.457 10220 10272 Error CRASH: Build fingerprint: 'google/taimen/taimen:9/PQ3A.190801.002/5670241:user/release-keys'
    08/13 08:17:52.457 10220 10272 Error CRASH: Revision: 'rev_10'
    08/13 08:17:52.457 10220 10272 Error CRASH: pid: 10220, tid: 10272, name: UnityMain >>> com.BigBlindInteractive.TienLen <<<
    08/13 08:17:52.457 10220 10272 Error CRASH: r0 00000000 r1 00002820 r2 00000006 r3 00000008
    08/13 08:17:52.457 10220 10272 Error CRASH: r4 000027ec r5 00002820 r6 d623e86c r7 0000010c
    08/13 08:17:52.457 10220 10272 Error CRASH: r8 d623f404 r9 d623f34c sl d623f388 fp d623e8b0
    08/13 08:17:52.457 10220 10272 Error CRASH: ip d623e808 sp d623e858 lr f38edfe9 pc f38e5e36 cpsr d9fe8100
     
  2. brgishy

    brgishy

    Joined:
    Jul 9, 2013
    Posts:
    31
    I did find out that if I go into my app settings and clear all storage related to the app, that will get the app running again.
     
  3. MTeaBB

    MTeaBB

    Joined:
    Sep 8, 2017
    Posts:
    1
    Yeah seeing this issue and it's stopping us from making a certification build.
     
  4. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    @brgishy:

    Can you submit a bug report for this issue? This behavior looks to be wrong, I think there might be a bug on the Unity side here.
     
  5. SomehowLuke

    SomehowLuke

    Joined:
    Nov 11, 2015
    Posts:
    34
  6. SomehowLuke

    SomehowLuke

    Joined:
    Nov 11, 2015
    Posts:
    34
    I just figured out that my App works with 2019.1.x but starting with 2019.2.x it does not work anymore.
     
  7. brgishy

    brgishy

    Joined:
    Jul 9, 2013
    Posts:
    31
    @JoshPeterson, @SomehowLuke

    Sorry guys, I haven't been able to report it yet. I was out of town for the last couple weeks. I'll try to do that early next week and I'll post the bug link here.
     
  8. zaniocz

    zaniocz

    Joined:
    May 9, 2011
    Posts:
    24
    Hi Guys,

    Is the problem reproducible with an empty project? or is it possible to isolate your project and share it in this thread?
     
  9. Murcho

    Murcho

    Joined:
    Mar 2, 2009
    Posts:
    309
    @JoshPeterson

    Hi guys, I believe I've encountered this error as well. I received the same error as the original post.

    E:\Program Files\2019.1.12f1\Editor\Data\il2cpp\libil2cpp\vm\MetadataCache.cpp:755: static Il2CppMethodPointer il2cpp::vm::MetadataCache::GetMethodPointer(const Il2CppImage *, uint32_t): assertion "rid <= image->codeGenModule->methodPointerCount" failed


    I've provided a bug report and attached the offending build and crash logs for both debug and release builds : http://fogbugz.unity3d.com/default.asp?1188336_qtgc3q4f37ku0dj9

    If required I can provide the full project however is is over 3 gig so might have issues uploading it all.
     
  10. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    Thanks, our QA team will process this issue (it looks like they have already started to do so). They will let you know if they need more information (maybe the full project).
     
  11. ubik

    ubik

    Joined:
    Aug 20, 2012
    Posts:
    4
    Sorry for the necro, but my project suddenly started having this crash even though I didn't change any code or configuration, so I was searching frantically for a solution to this (Unity 2021.1.16f1).
    NullPointerException in il2cpp::vm::MetadataCache::GetMethodPointer(Il2CppImage const*, unsigned int).

    To anyone that might run into this issue, try clearing your library folder, or parts of it, before building again.
    I'm still not sure what caused the issue or what resolved it, I was switching between APK builds and App Bundle builds, and suddenly this crash appeared on the final AppBundle build.

    It seems related to cached build files in /Library, so after clearing all il2cpp*-folders, BuildCache and csproj files, the issue went away. Hope this spares someone a few days of debugging.
     
  12. oariranh2000

    oariranh2000

    Joined:
    Aug 17, 2021
    Posts:
    1
    you solved my problem! thank you!
     
  13. ArchCC

    ArchCC

    Joined:
    Aug 28, 2014
    Posts:
    2
    Thank you!

    Same story 2020.3.16 il2cpp armv7+arm64 at first crashes in ParticleSystem and GlobalMetadata.cpp, after remove of particles start crashing in MetadataCache. But exported project always work fine after build with Android Studio, so some cache troubles explain it.
     
  14. wechat_os_Qy09qHUrE1NPxkv0-cMsFJ35Y

    wechat_os_Qy09qHUrE1NPxkv0-cMsFJ35Y

    Joined:
    Oct 9, 2020
    Posts:
    2
    It‘s great!
     
  15. s4relok

    s4relok

    Joined:
    May 1, 2013
    Posts:
    3
    Super! Thank you!

    I also was switching between APK builds and App Bundle builds (between Mono and IL2CPP).

    Unity 2020.3.38f1