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的目录会调取不到的。

猜你喜欢

转载自blog.csdn.net/mn24596mn/article/details/84942884