I've been trying to build an APK with Unity for quite a while. I'm trying to get the SceneShowController from the examples working but I'm running into a few problems that I just cannot find the cause of. I'm not sure if they're related.
When I try to compile Java from the Ouya Panel I get this error in the console:
UNEXPECTED TOP-LEVEL EXCEPTION:
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:127)
at java.util.zip.ZipFile.<init>(ZipFile.java:143)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:206)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:191)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:123)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
at com.android.dx.command.dexer.Main.processOne(Main.java:422)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:333)
at com.android.dx.command.dexer.Main.run(Main.java:209)
at com.android.dx.command.dexer.Main.main(Main.java:174)
at com.android.dx.command.Main.main(Main.java:91)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at SDKMain.main(SDKMain.java:88)
1 error; aborting
When I build the APK through the build settings and run on my ouya I get the error:
E/AndroidRuntime(27156): FATAL EXCEPTION: main
E/AndroidRuntime(27156): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{tv.ouya.demo/tv.ouya.demo.OuyaUnityApplication}: java.lang.ClassNotFoundException: tv.ouya.demo.OuyaUnityApplication
E/AndroidRuntime(27156): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1983)
E/AndroidRuntime(27156): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
E/AndroidRuntime(27156): at android.app.ActivityThread.access$600(ActivityThread.java:130)
E/AndroidRuntime(27156): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
E/AndroidRuntime(27156): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(27156): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(27156): at android.app.ActivityThread.main(ActivityThread.java:4745)
E/AndroidRuntime(27156): at java.lang.reflect.Method.invokeNative(NativeMethod)
E/AndroidRuntime(27156): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(27156): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
E/AndroidRuntime(27156): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
E/AndroidRuntime(27156): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(27156): Caused by: java.lang.ClassNotFoundException: tv.ouya.demo.OuyaUnityApplication
E/AndroidRuntime(27156): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
E/AndroidRuntime(27156): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
E/AndroidRuntime(27156): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
E/AndroidRuntime(27156): at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
E/AndroidRuntime(27156): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
E/AndroidRuntime(27156): ... 11 more
My uneducated guess is that the zip error means the jar isn't being built correct so it causes an error trying to find the OuyaUnityApplication class. But I'm sure I'm totally wrong, please help me figure this out.