查找unity的class.jar文件

本文详细介绍了如何在Unity和Android之间实现通信的过程。主要讲解了如何在Eclipse中引入Unity提供的classes.jar文件,并给出了不同Unity版本下该文件的具体路径。此外还提供了在发布APK时需要注意的设置选项。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


  我们在做android和unity相互通信的时候在eclipse中需要引入unity的接口classes.jar文件。那么我们怎么找到这个文件呢。

  unity4.6.4 中classes.jar文件路径:点击4.6.4的unity图标右键选择属性->打开文件位置->Data->PlaybackEngines->androidplayer->release->bin->classes.jar。

  unity5.3.1 中classes.jar文件路径:点击5.3.1的unity图标右键选择属性->打开文件位置->Data->PlaybackEngines->androidplayer->Variations->mono->release->classes->classes.jar。当你集成好jar放到unity中发布apk时,在settingPlayer中scripting Backend选择mono2x,不然导出可能会报错。如果你要发布ios的话,那么之前的classes.jar路径可能要使用这个:点击5.3.1的unity图标右键选择属性->打开文件位置->Data->PlaybackEngines->androidplayer->Variations->il2cpp->release->classes->classes.jar。然后在在settingPlayer中scripting Backend选择il2cpp。

   这个我在网上也查了一些资料,一般都是unity4.x的比较多,关于unity5.x不多,我在这里写出来就是希望给大家一些帮助。


Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details. C:/Program Files/Java/jdk-1.8\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="D:/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "D:\Unity\5.3.8f2\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" - stderr[ warning: Ignoring InnerClasses attribute for an anonymous inner class (com.tencent.mm.sdk.b.b) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is *not* an inner class. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.testin.agent.a.b) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is *not* an inner class. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.testin.agent.a.e) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is *not* an inner class. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.testin.agent.a.f) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is *not* an inner class. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.testin.agent.a.i) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is *not* an inner class. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.testin.agent.a.m) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is *not* an inner class. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.testin.agent.d.b.c) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is *not* an inner class. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.testin.agent.d.b.b) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is *not* an inner class. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.testin.agent.e.h) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is *not* an inner class. Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbitter/jnibridge/JNIBridge; Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbitter/jnibridge/JNIBridge$a; Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/player/NativeLoader; Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/player/ReflectionHelper; Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/player/ReflectionHelper$1; Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/player/ReflectionHelper$a; Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/player/UnityPlayer; Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/player/UnityPlayer$1; Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/player/UnityPlayer$10; UNEXPECTED TOP-LEVEL EXCEPTION: java.lang.RuntimeException: Translation has been interrupted at com.android.dx.command.dexer.Main.processAllFiles(Main.java:608) at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311) at com.android.dx.command.dexer.Main.run(Main.java:277) at com.android.dx.command.dexer.Main.main(Main.java:245) at com.android.dx.command.Main.main(Main.java:106) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at SDKMain.main(SDKMain.java:129) Caused by: java.lang.InterruptedException: Too many errors at com.android.dx.command.dexer.Main.processAllFiles(Main.java:600) ... 9 more ] stdout[ processing bin\classes\.\com\dw\Dating\lua\R.class... processing bin\classes\.\com\dw\Dating\lua\R$attr.class... processing bin\classes\.\com\dw\Dating\lua\R$drawable.class... processing bin\classes\.\com\dw\Dating\lua\R$string.class... processing bin\classes\.\com\dw\Dating\lua\R$style.class... processing bin\classes\.\com\dw\Dating\lua\R$xml.class... processing archive bin\classes.jar... processing bitter/jnibridge/JNIBridge.class... processing bitter/jnibridge/JNIBridge$a.class... processing com/unity3d/player/NativeLoader.class... processing com/unity3d/player/ReflectionHelper.class... processing com/unity3d/player/ReflectionHelper$1.class... processing com/unity3d/player/ReflectionHelper$a.class... processing com/unity3d/player/UnityPlayer.class... processing com/unity3d/player/UnityPlayer$1.class... processing com/unity3d/player/UnityPlayer$10.class... processing com/unity3d/player/UnityPlayer$11.class... processing com/unity3d/player/UnityPlayer$12.class... processing com/unity3d/player/UnityPlayer$13.class... processing com/unity3d/player/UnityPlayer$14.class... processing com/unity3d/player/UnityPlayer$15.class... processing com/unity3d/player/UnityPlayer$15$1.class... processing com/unity3d/player/UnityPlayer$16.class... processing com/unity3d/player/UnityPlayer$17.class... processing com/unity3d/player/UnityPlayer$18.class... processing com/unity3d/player/UnityPlayer$19.class... processing com/unity3d/player/UnityPlayer$2.class... processing com/unity3d/player/UnityPlayer$20.class... processing com/unity3d/player/UnityPlayer$3.class... processing com/unity3d/player/UnityPlayer$4.class... processing com/unity3d/player/UnityPlayer$5.class... processing com/unity3d/player/UnityPlayer$6.class... processing com/unity3d/player/UnityPlayer$7.class... processing com/unity3d/player/UnityPlayer$8.class... processing com/unity3d/player/UnityPlayer$9.class... processing com/unity3d/player/UnityPlayer$a.class... processing com/unity3d/player/UnityPlayer$b.class... processing com/unity3d/player/UnityPlayer$c.class... processing com/unity3d/player/UnityPlayer$d.class... processing com/unity3d/player/UnityPlayerActivity.class... processing com/unity3d/player/UnityPlayerNativeActivity.class... processing com/unity3d/player/UnityPlayerProxyActivity.class... processing com/unity3d/player/UnityWebRequest.class... processing com/unity3d/player/WWW.class... processing com/unity3d/player/a.class... processing com/unity3d/player/a$1.class... processing com/unity3d/player/a$2.class... processing com/unity3d/player/a$a.class... processing com/unity3d/player/b.class... processing com/unity3d/player/b$1.class... processing com/unity3d/player/b$2.class... processing com/unity3d/player/c.class... processing com/unity3d/player/d.class... processing com/unity3d/player/d$1.class... processing com/unity3d/player/d$2.class... processing com/unity3d/player/e.class... processing com/unity3d/player/f.class... processing com/unity3d/player/g.class... processing com/unity3d/player/h.class... processing com/unity3d/player/i.class... processing com/unity3d/player/j.class... processing com/unity3d/player/k.class... processing com/unity3d/player/k$1.class... processing com/unity3d/player/k$2.class... processing com/unity3d/player/k$2$1.class... processing com/unity3d/player/k$2$1$1.class... processing com/unity3d/player/l.class... processing com/unity3d/player/l$1.class... processing com/unity3d/player/m.class... processing com/unity3d/player/n.class... processing com/unity3d/player/n$1.class... processing com/unity3d/player/o.class... processing com/unity3d/player/p.class... processing com/unity3d/player/p$1.class... processing com/unity3d/player/q.class... processing com/unity3d/player/r.class... processing com/unity3d/player/s.class... processing com/unity3d/player/s$1.class... processing com/unity3d/player/s$2.class... processing com/unity3d/player/s$3.class... processing com/unity3d/player/t.class... processing com/unity3d/player/u.class... processing com/unity3d/player/v.class... processing com/unity3d/player/w.class... processing com/unity3d/player/w$1.class... processing org/fmod/FMODAudioDevice.class... processing org/fmod/a.class... processing archive plugins\.\FanweiPlugin_v4.4.jar... processing android/app/ActivityThread.class... processing android/app/Instrumentation.class... processing android/app/Instrumentation$ActivityMonitor.class... processing android/app/Instrumentation$ActivityResult.class... processing android/app/LoadedApk.class... processing com/fanwei/bluearty/pluginmgr/BuildConfig.class... processing com/fanwei/bluearty/pluginmgr/DynamicActivity.class... processing com/fanwei/bluearty/pluginmgr/Globals.class... processing com/fanwei/bluearty/pluginmgr/PluginActivityLifeCycleCallback.class... processing com/fanwei/bluearty/pluginmgr/PluginManager.class... processing com/fanwei/bluearty/pluginmgr/delegate/DelegateActivityThread.class... processing com/fanwei/bluearty/pluginmgr/delegate/DelegateInstrumentation.class... processing com/fanwei/bluearty/pluginmgr/delegate/LayoutInflaterProxyContext.class... processing com/fanwei/bluearty/pluginmgr/environment/CreateActivityData.class... processing com/fanwei/bluearty/pluginmgr/environment/PlugInfo.class... processing com/fanwei/bluearty/pluginmgr/environment/PluginClassLoader.class... processing com/fanwei/bluearty/pluginmgr/environment/PluginContext.class... processing com/fanwei/bluearty/pluginmgr/environment/PluginInstrumentation.class... processing com/fanwei/bluearty/pluginmgr/reflect/NULL.class... processing com/fanwei/bluearty/pluginmgr/reflect/Reflect.class... processing com/fanwei/bluearty/pluginmgr/reflect/Reflect$1.class... processing com/fanwei/bluearty/pluginmgr/reflect/ReflectException.class... processing com/fanwei/bluearty/pluginmgr/selector/DefaultActivitySelector.class... processing com/fanwei/bluearty/pluginmgr/selector/DynamicActivitySelector.class... processing com/fanwei/bluearty/pluginmgr/utils/FileUtil.class... processing com/fanwei/bluearty/pluginmgr/utils/IntReader.class... processing com/fanwei/bluearty/pluginmgr/utils/NamespaceStack.class... processing com/fanwei/bluearty/pluginmgr/utils/PluginManifestUtil.class... processing com/fanwei/bluearty/pluginmgr/utils/StringBlock.class... processing com/fanwei/bluearty/pluginmgr/utils/Trace.class... processing com/fanwei/bluearty/pluginmgr/utils/XmlManifestReader.class... processing com/fanwei/bluearty/pluginmgr/utils/XmlResourceParser.class... processing com/fanwei/bluearty/pluginmgr/verify/PluginNotFoundException.class... processing com/fanwei/bluearty/pluginmgr/verify/PluginOverdueVerifier.class... processing com/fanwei/bluearty/pluginmgr/verify/SimpleLengthVerifier.class... processing com/fanwei/bluearty/pluginmgr/widget/LayoutInflaterWrapper.class... processing com/fanwei/bluearty/pluginmgr/widget/ViewStub.class... processing com/fanwei/bluearty/pluginmgr/widget/ViewStub$OnInflateListener.class... processing com/fanwei/bluearty/simplejson/BasicType.class... processing com/fanwei/bluearty/simplejson/BuildConfig.class... processing com/fanwei/bluearty/simplejson/SimpleJson.class... processing com/fanwei/bluearty/simplejson/SimpleJson$1.class... processing com/fanwei/bluearty/simplejson/annotation/CollectionCreateBy.class... processing com/fanwei/bluearty/simplejson/annotation/NickName.class... processing com/fanwei/bluearty/simplejson/annotation/NotConvert.class... processing com/fanwei/bluearty/simplejson/annotation/SerializeBy.class... processing com/fanwei/bluearty/simplejson/serializer/Serializer.class... processing com/fanwei/bluearty/tinyhttp/BuildConfig.class... processing com/fanwei/bluearty/tinyhttp/Const.class... processing com/fanwei/bluearty/tinyhttp/Request.class... processing com/fanwei/bluearty/tinyhttp/Request$Method.class... processing com/fanwei/bluearty/tinyhttp/Response.class... processing com/fanwei/bluearty/tinyhttp/RetryManager.class... processing com/fanwei/bluearty/tinyhttp/Webb.class... processing com/fanwei/bluearty/tinyhttp/Webb$1.class... processing com/fanwei/bluearty/tinyhttp/Webb$AutoDisconnectInputStream.class... processing com/fanwei/bluearty/tinyhttp/Webb$FWHostnameVerifier.class... processing com/fanwei/bluearty/tinyhttp/Webb$FWX509TrustManager.class... processing com/fanwei/bluearty/tinyhttp/WebbException.class... processing com/fanwei/bluearty/tinyhttp/WebbUtils.class... processing com/fanwei/jubaosdk/common/BuildConfig.class... processing com/fanwei/jubaosdk/common/core/AbstractCall.class... processing com/fanwei/jubaosdk/common/core/AbstractCall$Callback.class... processing com/fanwei/jubaosdk/common/core/AbstractCall$CallbackUI.class... processing com/fanwei/jubaosdk/common/core/AbstractCall$CallbackUI$UIHandler.class... processing com/fanwei/jubaosdk/common/core/Call.class... processing com/fanwei/jubaosdk/common/core/Dispatcher.class... processing com/fanwei/jubaosdk/common/core/OnPayResultListener.class... processing com/fanwei/jubaosdk/common/entity/Advertisement.class... processing com/fanwei/jubaosdk/common/entity/OrderEntity.class... processing com/fanwei/jubaosdk/common/entity/PayMethodResponse.class... processing com/fanwei/jubaos<message truncated>
最新发布
07-19
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值