Search Unity

Old gvr project crashes on android (worked in 5.5, crashes on 2017.4 build)

Discussion in 'Daydream' started by mgear, Apr 5, 2018.

  1. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,443
    Just posting here for future googlers..

    Tested upgrading old 5.5 cardboard vr project into 2017.4.0f1 LTS, and all went fine,
    except that Android build crashes on start, with the error below:

    (iOS build works fine, and that error is probably caused by old GVR plugin v0.7,
    so going to check later if upgrading that helps..)


    Code (CSharp):
    1. java.lang.Error: FATAL EXCEPTION [main]
    2.  
    3. E/AndroidRuntime(10577): Caused by: java.lang.NoSuchMethodError: No direct method <init>(Landroid/content/ContextWrapper;)V in class Lcom/unity3d/player/UnityPlayer; or its super classes (declaration of 'com.unity3d.player.UnityPlayer' appears in /data/app/com.xyz.asdasd-2/base.apk)
    4. E/AndroidRuntime(10577):        at com.google.unity.GoogleUnityActivity.onCreate(GoogleUnityActivity.java:114)
    5. E/AndroidRuntime(10577):        at android.app.Activity.performCreate(Activity.java:6289)
    6. E/AndroidRuntime(10577):        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
    7. E/AndroidRuntime(10577):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2655)
    8. E/AndroidRuntime(10577):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2767)
    9. E/AndroidRuntime(10577):        at android.app.ActivityThread.access$900(ActivityThread.java:177)
    10. E/AndroidRuntime(10577):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1449)
    11. E/AndroidRuntime(10577):        at android.os.Handler.dispatchMessage(Handler.java:102)
    12. E/AndroidRuntime(10577):        at android.os.Looper.loop(Looper.java:145)
    13. E/AndroidRuntime(10577):        at android.app.ActivityThread.main(ActivityThread.java:5951)
    14. E/AndroidRuntime(10577):        at java.lang.reflect.Method.invoke(Native Method)
    15. E/AndroidRuntime(10577):        at java.lang.reflect.Method.invoke(Method.java:372)
    16. E/AndroidRuntime(10577):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
    17. E/AndroidRuntime(10577):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
    18.  
    19.  

    *similar topics, no working answers though
    https://forum.unity.com/threads/for...e-your-google-vr-sdk-to-1-12-or-later.520986/ *i'm not using il2cpp though
    https://forum.unity.com/threads/crash-in-unity-2017-com-unity3d-player-unityplayer.492450/
    https://answers.unity.com/questions/1389155/i-built-a-google-daydream-vr-game-in-unity-but-whe.html
    https://answers.unity.com/questions/848333/android-plugin-context-issues.html
    https://answers.unity.com/questions/930466/unity-android-plugin-no-method-with-name.html
    https://answers.unity.com/questions/1274789/project-tange-unfortunately-app-name-has-stopped.html
     
  2. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    Try removing and re-importing an up to date version of the Google VR SDK. I don't think GoogleUnityActivity may be valid in a post native integration world.
     
  3. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,443
    yes, confirmed that removing those old gvr files from plugin folder allowed the app to start.

    although was hoping that could still use the old version, as there is some code that relies on the old cardboard button stuff etc.. but i guess need to update eventually anyways.