Search Unity

Unity 2018.3.6 upgrade to Unity 2018.4 has bug

Discussion in 'Android' started by STKMAN, May 21, 2019.

  1. STKMAN

    STKMAN

    Joined:
    Mar 10, 2016
    Posts:
    11
    When i have upgrade to Unity 2018.4 and build an android apk. it's crash after install.


    Error information

    Unable to start activity ComponentInfo{com.zymobile.block.puzzle.space/com.zymobile.block.puzzle.space.UnityPlayerActivity}: android.content.res.Resources$NotFoundException: String resource ID #0x0
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2946)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3081)
    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:201)
    at android.app.ActivityThread.main(ActivityThread.java:6806)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
    Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x0
    at android.content.res.Resources.getText(Resources.java:360)
    at android.content.res.MiuiResources.getText(MiuiResources.java:97)
    at android.content.res.Resources.getString(Resources.java:453)
    at com.unity3d.player.UnityPlayer.a(Unknown Source:20)
    at com.unity3d.player.UnityPlayer.<init>(Unknown Source:190)
    at com.zymobile.block.puzzle.space.UnityPlayerActivity.onCreate(UnityPlayerActivity.java:25)
    at android.app.Activity.performCreate(Activity.java:7224)
    at android.app.Activity.performCreate(Activity.java:7213)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272)


    then i go back to Unity 2018.3.6 everything is OK.
     
    krishnaa_G and shoutrlabs like this.
  2. unity_91BnGyqxSYUPdQ

    unity_91BnGyqxSYUPdQ

    Joined:
    Aug 7, 2018
    Posts:
    25
    Hello Iam getting the exact same error in Unity 2017_4_27

    Can you please tell me how you fixed the same.
     
    krishnaa_G likes this.
  3. unity_91BnGyqxSYUPdQ

    unity_91BnGyqxSYUPdQ

    Joined:
    Aug 7, 2018
    Posts:
    25
    Hey Fixed this issue

    if you are exporting the android project then don't remove the following string resource -
    <string name="game_view_content_description">Game view</string> that is there by default in the project string.xml
     
    QooDev, nilsdr, ankushsngh93 and 8 others like this.
  4. josefgrunig

    josefgrunig

    Joined:
    Jan 23, 2017
    Posts:
    62
    I had the same issue and tried to add the minimal set of resources needed by Unity to run.
    It seem that the only necessary resource is that string so I added it as an empty string (see in string.xml):

    Code (CSharp):
    1. <string name="game_view_content_description"></string>
     
  5. timmy2get

    timmy2get

    Joined:
    Mar 2, 2018
    Posts:
    12
    WOW! That was a saviour!! Thank you!!!
     
    john_goren and ankushsngh93 like this.
  6. john_goren

    john_goren

    Joined:
    Mar 19, 2021
    Posts:
    15
    That saved my life too. The thing I don't understand is where in Settings we might have accidentally been removing this XML string resource? I don't remember doing so. Is there an "export without important string resources" check box? Kidding of course.

    Update: Yeah so does anyone know the best way to ensure that the string resource is provided by your Unity project? I was researching this issue further and it appears that the practice has been deprecated of leaving XML res/ files inside your Android plugin inside Unity. So what's the ideal way to make sure this resource is being bundled into the UAAL build?
     
    Last edited: Jul 28, 2021
  7. itmozamil22

    itmozamil22

    Joined:
    Sep 16, 2021
    Posts:
    1
    you saved my life