Skip to content

Instantly share code, notes, and snippets.

@unitycoder
Last active April 6, 2018 08:33
Show Gist options
  • Save unitycoder/16099ba4e1e1ca69122e28a0343833a2 to your computer and use it in GitHub Desktop.
Save unitycoder/16099ba4e1e1ca69122e28a0343833a2 to your computer and use it in GitHub Desktop.
Android GVR 0.7 Build Error in Unity 2017.4.0f1
// caused by old GVR 0.7
FATAL EXCEPTION: main
java.lang.Error: FATAL EXCEPTION [main]
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.asdas-2/base.apk)
E/AndroidRuntime(10577): at com.google.unity.GoogleUnityActivity.onCreate(GoogleUnityActivity.java:114)
E/AndroidRuntime(10577): at android.app.Activity.performCreate(Activity.java:6289)
E/AndroidRuntime(10577): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
E/AndroidRuntime(10577): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2655)
E/AndroidRuntime(10577): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2767)
E/AndroidRuntime(10577): at android.app.ActivityThread.access$900(ActivityThread.java:177)
E/AndroidRuntime(10577): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1449)
E/AndroidRuntime(10577): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(10577): at android.os.Looper.loop(Looper.java:145)
E/AndroidRuntime(10577): at android.app.ActivityThread.main(ActivityThread.java:5951)
E/AndroidRuntime(10577): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(10577): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(10577): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
E/AndroidRuntime(10577): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
Error below, caused by either
- androidmanifest.xml, too small min/target sdk, set both to 21 for 2017.4
- or phone had denied installing (you pressed deny, instead of allow), go to Settings/DeveloperSettings/Permissions/Install via usb, should have blocked your app, disable and try again
// warning
Plugins/Android/AndroidManifest.xml has android:targetSdkVersion set to 21 but "Target API Level" in Editor is set to 26! Setting android:targetSdkVersion to 26.
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
// error
CommandInvokationFailure: Unable to install APK to device. Please make sure the Android SDK is installed and is properly configured in the Editor. See the Console for more details.
.../android-sdk\platform-tools\adb.exe -s "28a358290404" install -r "...\asdf.apk"
stderr[
Failed to install asdf.apk: Failure [INSTALL_CANCELED_BY_USER]
]
stdout[
]
exit code: 1
at UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) [0x00000] in <filename unknown>:0
at UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) [0x00000] in <filename unknown>:0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment