1. 程式人生 > >Unity3d與安卓的互動1.0

Unity3d與安卓的互動1.0

Unity : java.lang.NoSuchMethodError: no non-static method with name=‘OpenGallery’ signature=’()V’ in class Ljava.lang.Object;
Unity : at com.unity3d.player.ReflectionHelper.getMethodID(Unknown Source:49)
Unity : at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
Unity : at com.unity3d.player.UnityPlayer.c(Unknown Source:0)
Unity : at com.unity3d.player.UnityPlayer$c 1.

h a n d l e M e s s a
g e ( U n k n o w n S
o u r c e : 151 ) U n i t y : a t a n d r o i d . o s . H a n d l e r . d i s p a t c h M e s s a g e ( H a n d l e r . j a v a : 104 ) U n i t y : a t a n d r o i d . o s . L o o p e r . l o o p ( L o o p e r . j a v a : 166 ) U n i t y : a t c o m . u n i t y 3 d . p l a y e r . U n i t y P l a y e r 1.handleMessage(Unknown Source:151) Unity : at android.os.Handler.dispatchMessage(Handler.java:104) Unity : at android.os.Looper.loop(Looper.java:166) Unity : at com.unity3d.player.UnityPlayer c.run(Unknown Source:20)
Unity : at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in :0
Unity : at UnityEngine.AndroidJNISafe.CallStaticObjectMethod (IntPtr clazz, IntPtr methodID, UnityEngine.jvalue[] args) [0x00000] in :0

unity在調取自己自定義的安卓方法,當找不到方法時,要注意AndroidManifest.xml與jar包的目錄層級關係,要與eclipse的目錄對應。隨意放置AndroidManifest.xml與jar的目錄會調取不到的。