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

[Issue] game always crashes on launch on Android

Discussion in 'Android' started by jackblue2009, Apr 29, 2023.

  1. jackblue2009

    jackblue2009

    Joined:
    Feb 12, 2016
    Posts:
    2
    Hi everyone,

    Recently I've been working on a 2d game on android, however I have released early version of it, but the issue here is that it always crashed when launched, never even loads the game. I have tried several ways to find out the root cause but to no avail.

    One of the ways I have tried is ticking on a custom main gradle template, here what I added to it:
    Code (CSharp):
    1. // GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN
    2.  
    3. apply plugin: 'com.android.library'
    4. **APPLY_PLUGINS**
    5.  
    6. dependencies {
    7.     implementation fileTree(dir: 'libs', include: ['*.jar'])
    8.     // For apps targeting Android 12, add WorkManager dependency.
    9.   constraints {
    10.     implementation('androidx.work:work-runtime:2.7.0') {
    11.       because '''androidx.work:work-runtime:2.1.0 pulled from
    12.     play-services-ads has a bug using PendingIntent without
    13.     FLAG_IMMUTABLE or FLAG_MUTABLE and will fail in Apps
    14.     targeting S+.'''
    15.     }
    16.   }
    17. **DEPS**}
    18.  
    19. android {
    20.     compileSdkVersion **APIVERSION**
    21.     buildToolsVersion '**BUILDTOOLS**'
    22.  
    23.     compileOptions {
    24.         sourceCompatibility JavaVersion.VERSION_1_8
    25.         targetCompatibility JavaVersion.VERSION_1_8
    26.     }
    27.  
    28.     defaultConfig {
    29.         minSdkVersion **MINSDKVERSION**
    30.         targetSdkVersion **TARGETSDKVERSION**
    31.         ndk {
    32.             abiFilters **ABIFILTERS**
    33.         }
    34.         versionCode **VERSIONCODE**
    35.         versionName '**VERSIONNAME**'
    36.         consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD**
    37.     }
    38.  
    39.     lintOptions {
    40.         abortOnError false
    41.     }
    42.  
    43.     aaptOptions {
    44.         noCompress = ['.ress', '.resource', '.obb'] + unityStreamingAssets.tokenize(', ')
    45.         ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
    46.     }**PACKAGING_OPTIONS**
    47. }**REPOSITORIES**
    48. **IL_CPP_BUILD_SETUP**
    49. **SOURCE_BUILD_SETUP**
    50. **EXTERNAL_SOURCES**
    51.  
    This is the error from Android logcat every time I have tried launching the game:

    Code (CSharp):
    1. 2023/04/29 16:19:21.720 9717 9740 Error CRASH Tombstone written to: /storage/emulated/0/Android/data/com.BucheeriProductions.HungerStreetMission/files/tombstone_02
    2. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime FATAL EXCEPTION: UnityMain
    3. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime Process: com.BucheeriProductions.HungerStreetMission, PID: 9717
    4. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime java.lang.Error: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    5. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime Version '2020.3.47f1 (5ef4f5b5e2d4)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'armeabi-v7a'
    6. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime Build fingerprint: 'samsung/a3corexx/a3core:12/SP1A.210812.016/A032FXXU2BWC3:user/release-keys'
    7. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime Revision: '0'
    8. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime ABI: 'arm'
    9. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime Timestamp: 2023-04-29 16:19:21+0300
    10. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime pid: 9717, tid: 9740, name: UnityMain  >>> com.BucheeriProductions.HungerStreetMission <<<
    11. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime uid: 10001
    12. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x6a
    13. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime Cause: null pointer dereference
    14. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     r0  00000060  r1  cb564ea0  r2  0000008c  r3  00000040
    15. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     r4  caa3f384  r5  caa21aa0  r6  bc6db3a0  r7  c071c050
    16. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     r8  bc6db3a0  r9  00000003  r10 bc6fd280  r11 ca0d36a0
    17. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     ip  f0e24944  sp  ca0d3670  lr  cac69a7f  pc  cac8f50a
    18. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime
    19. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime backtrace:
    20. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime       #00 pc 000cf50a  /data/app/~~ewZWMi4V2m8-ZJQQAeTp4g==/com.BucheeriProductions.HungerStreetMission-LjrbxxlVONHbRlAKoQJXfQ==/lib/arm/libunity.so (BuildId: cdff0dc27d3d79b25c82b8b7c3ff097d0ceb46cc)
    21. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime       #01 pc 00750f30  /data/app/~~ewZWMi4V2m8-ZJQQAeTp4g==/com.BucheeriProductions.HungerStreetMission-LjrbxxlVONHbRlAKoQJXfQ==/lib/arm/libil2cpp.so (BuildId: bc9bfce1e8af75482731491ab59efa9c7eef0c15)
    22. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime       #02 pc 000d94f0  /data/app/~~ewZWMi4V2m8-ZJQQAeTp4g==/com.BucheeriProductions.HungerStreetMission-LjrbxxlVONHbRlAKoQJXfQ==/lib/arm/libil2cpp.so (BuildId: bc9bfce1e8af75482731491ab59efa9c7eef0c15)
    23. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime       #03 pc 0017c9f0  /data/app/~~ewZWMi4V2m8-ZJQQAeTp4g==/com.BucheeriProductions.HungerStreetMission-LjrbxxlVONHbRlAKoQJXfQ==/lib/arm/libil2cpp.so (BuildId: bc9bfce1e8af75482731491ab59efa9c7eef0c15)
    24. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime       #04 pc 001aa3ad  /data/app/~~ewZWMi4V2m8-ZJQQAeTp4g==/com.BucheeriProductions.HungerStreetMission-LjrbxxlVONHbRlAKoQJXfQ==/lib/arm/libunity.so (BuildId: cdff0dc27d3d79b25c82b8b7c3ff097d0ceb46cc)
    25. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime       #05 pc 001ac699  /data/app/~~ewZWMi4V2m8-ZJQQAeTp4g==/com.BucheeriProductions.HungerStreetMission-LjrbxxlVONHbRlAKoQJXfQ==/lib/arm/libunity.so (BuildId: cdff0dc27d3d79b25c82b8b7c3ff097d0ceb46cc)
    26. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime       #06 pc 001ac60b  /data/app/~~ewZWMi4V2m8-ZJQQAeTp4g==/com.BucheeriProductions.HungerStreetMission-LjrbxxlVONHbRlAKoQJXfQ==/lib/arm/libunity.so (BuildId: cdff0dc27d3d79b25c82b8b7c3ff097d0ceb46cc)
    27. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime       #07 pc 001df33b  /data/app/~~ewZWMi4V2m8-ZJQQAeTp4g==/com.BucheeriProductions.HungerStreetMission-LjrbxxlVONHbRlAKoQJXfQ==/lib/arm/libunity.so (BuildId: cdff0dc27d3d79b25c82b8b7c3ff097d0ceb46cc)
    28. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime       #08 pc 001bd94d  /data/app/~~ewZWMi4V2m8-ZJQQAeTp4g==/com.BucheeriProductions.HungerStreetMission-LjrbxxlVONHbRlAKoQJXfQ==/lib/arm/libunity.so (BuildId: cdff0dc27d3d79b25c82b8b7c3ff097d0ceb46cc)
    29. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime       #09 pc 001bdc17  /data/app/~~ewZWMi4V2m8-ZJQQAeTp4g==/com.BucheeriProductions.HungerStreetMission-LjrbxxlVONHbRlAKoQJXfQ==/lib/arm/libunity.so (BuildId: cdff0dc27d3d79b25c82b8b7c3ff097d0ceb46cc)
    30. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime       #10 pc 001bd8f7  /data/app/~~ewZWMi4V2m8-ZJQQAeTp4g==/com.BucheeriProductions.HungerStreetMission-LjrbxxlVONHbRlAKoQJXfQ==/lib/arm/libunity.so (BuildId: cdff0dc27d3d79b25c82b8b7c3ff097d0ceb46cc)
    31. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime       #11 pc 001ea34d  /data/app/~~ewZWMi4V2m8-ZJQQAeTp4g==/com.BucheeriProductions.HungerStreetMission-LjrbxxlVONHbRlAKoQJXfQ==/lib/arm/libunity.so (BuildId: cdff0dc27d3d79b25c82b8b7c3ff097d0ceb46cc)
    32. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime       #12 pc 001ea291  /data/app/~~ewZWMi4V2m8-ZJQQAeTp4g==/com.BucheeriProductions.HungerStreetMission-LjrbxxlVONHbRlAKoQJXfQ==/lib/arm/libunity.so (BuildId: cdff0dc27d3d79b25c82b8b7c3ff097d0ceb46cc)
    33. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime       #13 pc 001ea233  /data/app/~~ewZWMi4V2m8-ZJQQAeTp4g==/com.BucheeriProductions.HungerStreetMission-LjrbxxlVONHbRlAKoQJXfQ==/lib/arm/libunity.so (BuildId: cdff0dc27d3d79b25c82b8b7c3ff097d0ceb46cc)
    34. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime       #14 pc 001566ef  /data/app/~~ewZWMi4V2m8-ZJQQAeTp4g==/com.BucheeriProductions.HungerStreetMission-LjrbxxlVONHbRlAKoQJXfQ==/lib/arm/libunity.so (BuildId: cdff0dc27d3d79b25c82b8b7c3ff097d0ceb46cc)
    35. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime       #15 pc 001568df  /data/app/~~ewZWMi4V2m8-ZJQQAeTp4g==/com.BucheeriProductions.HungerStreetMission-LjrbxxlVONHbRlAKoQJXfQ==/lib/arm/libunity.so (BuildId: cdff0dc27d3d79b25c82b8b7c3ff097d0ceb46cc)
    36. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime       #16 pc 001564a9  /data/app/~~ewZWMi4V2m8-ZJQQAeTp4g==/com.BucheeriProductions.HungerStreetMission-LjrbxxlVONHbRlAKoQJXfQ==/lib/arm/libunity.so (BuildId: cdff0dc27d3d79b25c82b8b7c3ff097d0ceb46cc)
    37. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime       #17 pc 00156547  /data/app/~~ewZWMi4V2m8-ZJQQAeTp4g==/com.BucheeriProductions.HungerStreetMission-LjrbxxlVONHbRlAKoQJXfQ==/lib/arm/libunity.so (BuildId: cdff0dc27d3d79b25c82b8b7c3ff097d0ceb46cc)
    38. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime       #18 pc 001562ff  /data/app/~~ewZWMi4V2m8-ZJQQAeTp4g==/com.BucheeriProductions.HungerStreetMission-LjrbxxlVONHbRlAKoQJXfQ==/lib/arm/libunity.so (BuildId: cdff0dc27d3d79b25c82b8b7c3ff097d0ceb46cc)
    39. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime       #19 pc 00156eb7  /data/app/~~ewZWMi4V2m8-ZJQQAeTp4g==/com.BucheeriProductions.HungerStreetMission-LjrbxxlVONHbRlAKoQJXfQ==/lib/arm/libunity.so (BuildId: cdff0dc27d3d79b25c82b8b7c3ff097d0ceb46cc)
    40. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime       #20 pc 0015731d  /data/app/~~ewZWMi4V2m8-ZJQQAeTp4g==/com.BucheeriProductions.HungerStreetMission-LjrbxxlVONHbRlAKoQJXfQ==/lib/arm/libunity.so (BuildId: cdff0dc27d3d79b25c82b8b7c3ff097d0ceb46cc)
    41. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime       #21 pc 00200397  /data/app/~~ewZWMi4V2m8-ZJQQAeTp4g==/com.BucheeriProductions.HungerStreetMission-LjrbxxlVONHbRlAKoQJXfQ==/lib/arm/libunity.so (BuildId: cdff0dc27d3d79b25c82b8b7c3ff097d0ceb46cc)
    42. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime       #22 pc 0021001d  /data/app/~~ewZWMi4V2m8-ZJQQAeTp4g==/com.BucheeriProductions.HungerStreetMission-LjrbxxlVONHbRlAKoQJXfQ==/lib/arm/libunity.so (BuildId: cdff0dc27d3d79b25c82b8b7c3ff097d0ceb46cc)
    43. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime       #23 pc 000f3a8d  /apex/com.android.art/lib/libart.so (BuildId: 19d288d67da9080d0f9ea13d2970cc15)
    44. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime
    45. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     at libunity.0xcf50a(Native Method)
    46. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     at libil2cpp.0x750f30(Native Method)
    47. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     at libil2cpp.0xd94f0(Native Method)
    48. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     at libil2cpp.0x17c9f0(Native Method)
    49. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     at libunity.0x1aa3ad(Native Method)
    50. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     at libunity.0x1ac699(Native Method)
    51. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     at libunity.0x1ac60b(Native Method)
    52. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     at libunity.0x1df33b(Native Method)
    53. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     at libunity.0x1bd94d(Native Method)
    54. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     at libunity.0x1bdc17(Native Method)
    55. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     at libunity.0x1bd8f7(Native Method)
    56. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     at libunity.0x1ea34d(Native Method)
    57. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     at libunity.0x1ea291(Native Method)
    58. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     at libunity.0x1ea233(Native Method)
    59. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     at libunity.0x1566ef(Native Method)
    60. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     at libunity.0x1568df(Native Method)
    61. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     at libunity.0x1564a9(Native Method)
    62. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     at libunity.0x156547(Native Method)
    63. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     at libunity.0x1562ff(Native Method)
    64. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     at libunity.0x156eb7(Native Method)
    65. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     at libunity.0x15731d(Native Method)
    66. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     at libunity.0x200397(Native Method)
    67. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     at libunity.0x21001d(Native Method)
    68. 2023/04/29 16:19:21.723 9717 9740 Error AndroidRuntime     at libart.0xf3a8d(Native Method)
    69.  

    This is the Android Manifest:

    Code (CSharp):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <!-- GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN-->
    3. <manifest
    4.     xmlns:android="http://schemas.android.com/apk/res/android"
    5.     package="com.unity3d.player"
    6.     xmlns:tools="http://schemas.android.com/tools">
    7.     <application>
    8.         <activity android:name="com.unity3d.player.UnityPlayerActivity"
    9.                   android:theme="@style/UnityThemeSelector">
    10.             <intent-filter>
    11.                 <action android:name="android.intent.action.MAIN" />
    12.                 <category android:name="android.intent.category.LAUNCHER" />
    13.             </intent-filter>
    14.             <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    15.         </activity>
    16.     </application>
    17. </manifest>
    18.  
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,679
    Use development player to get more information
     
  3. jackblue2009

    jackblue2009

    Joined:
    Feb 12, 2016
    Posts:
    2
    Okay I used the Adb.exe and this is what I got after attempting to launch the app:

    https://pastebin.com/vWyzrvEB
     
    Last edited: Apr 29, 2023
  4. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,679
    That's not development player, it still says you're using Release. Development checkbox is in Build Settings window in Unity editor