Unity Android无法将类转换为dex格式的AdMob

时间:2014-07-14 09:37:40

标签: android unity3d admob google-play-services dex

我是初学者Unity程序员(学龄期),所以我对系统了解不多。我自己的应用程序编译得很好,但是当我实现AdMob SDK(Google)2.1时,我有以下错误日志(将java.class转换为DEX时):

Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/bin/java -Xmx1024M -Dcom.android.sdkmanager.toolsdir="/Volumes/SAMSUNG/Programming/Eclipse Java etc./android-sdk-macosx/tools" -Dfile.encoding=UTF8 -jar "/Volumes/SAMSUNG/Applications/Unity/Unity.app/Contents/BuildTargetTools/AndroidPlayer/sdktools.jar" -

stderr[

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:128)
    at java.util.zip.ZipFile.<init>(ZipFile.java:145)
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:244)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
    at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
    at com.android.dx.command.dexer.Main.processOne(Main.java:596)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
    at com.android.dx.command.dexer.Main.run(Main.java:230)
    at com.android.dx.command.dexer.Main.main(Main.java:199)
    at com.android.dx.command.Main.main(Main.java:103)
    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:129)
1 error; aborting
]
stdout[
processing archive bin/classes.jar...
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/a.class...
processing com/unity3d/player/b.class...
processing com/unity3d/player/c$1.class...
processing com/unity3d/player/c$2.class...
processing com/unity3d/player/c.class...
processing com/unity3d/player/d.class...
processing com/unity3d/player/e$1.class...
processing com/unity3d/player/e$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$1.class...
processing com/unity3d/player/k.class...
processing com/unity3d/player/NativeLoader.class...
processing com/unity3d/player/l.class...
processing com/unity3d/player/PsmMainActivity.class...
processing com/unity3d/player/PsmUnityActivity.class...
processing com/unity3d/player/ReflectionHelper$1.class...
processing com/unity3d/player/ReflectionHelper$a.class...
processing com/unity3d/player/ReflectionHelper.class...
processing com/unity3d/player/m.class...
processing com/unity3d/player/n$1.class...
processing com/unity3d/player/n$2.class...
processing com/unity3d/player/n$3.class...
processing com/unity3d/player/n.class...
processing com/unity3d/player/o.class...
processing com/unity3d/player/p.class...
processing com/unity3d/player/UnityPlayer$1.class...
processing com/unity3d/player/UnityPlayer$2.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$10.class...
processing com/unity3d/player/UnityPlayer$11.class...
processing com/unity3d/player/UnityPlayer$12.class...
processing com/unity3d/player/UnityPlayer$13$1.class...
processing com/unity3d/player/UnityPlayer$13.class...
processing com/unity3d/player/UnityPlayer$3.class...
processing com/unity3d/player/UnityPlayer$14.class...
processing com/unity3d/player/UnityPlayer$15.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$a.class...
processing com/unity3d/player/UnityPlayer$b.class...
processing com/unity3d/player/UnityPlayer.class...
processing com/unity3d/player/UnityPlayerActivity.class...
processing com/unity3d/player/UnityPlayerNativeActivity.class...
processing com/unity3d/player/UnityPlayerProxyActivity.class...
processing com/unity3d/player/q.class...
processing com/unity3d/player/r$1.class...
processing com/unity3d/player/r.class...
processing com/unity3d/player/WWW.class...
processing org/fmod/FMODAudioDevice$a.class...
processing org/fmod/FMODAudioDevice.class...
processing org/fmod/a.class...
processing bin/classes/./com/google/android/gms/R$attr.class...
processing bin/classes/./com/google/android/gms/R$color.class...
processing bin/classes/./com/google/android/gms/R$drawable.class...
processing bin/classes/./com/google/android/gms/R$id.class...
processing bin/classes/./com/google/android/gms/R$integer.class...
processing bin/classes/./com/google/android/gms/R$string.class...
processing bin/classes/./com/google/android/gms/R$style.class...
processing bin/classes/./com/google/android/gms/R$styleable.class...
processing bin/classes/./com/google/android/gms/R.class...
processing bin/classes/./com/homegrownapps/gochickengo/R$attr.class...
processing bin/classes/./com/homegrownapps/gochickengo/R$color.class...
processing bin/classes/./com/homegrownapps/gochickengo/R$drawable.class...
processing bin/classes/./com/homegrownapps/gochickengo/R$id.class...
processing bin/classes/./com/homegrownapps/gochickengo/R$integer.class...
processing bin/classes/./com/homegrownapps/gochickengo/R$string.class...
processing bin/classes/./com/homegrownapps/gochickengo/R$style.class...
processing bin/classes/./com/homegrownapps/gochickengo/R$styleable.class...
processing bin/classes/./com/homegrownapps/gochickengo/R.class...
processing archive plugins/./unity-plugin-library.jar...
ignored resource META-INF/MANIFEST.MF
processing com/google/unity/ads/Banner$1$1.class...
processing com/google/unity/ads/Banner$1.class...
processing com/google/unity/ads/Banner$2.class...
processing com/google/unity/ads/Banner$3.class...
processing com/google/unity/ads/Banner$4.class...
processing com/google/unity/ads/Banner$5.class...
processing com/google/unity/ads/Banner.class...
processing com/google/unity/ads/Interstitial$1$1.class...
processing com/google/unity/ads/Interstitial$1.class...
processing com/google/unity/ads/Interstitial$2.class...
processing com/google/unity/ads/Interstitial$3.class...
processing com/google/unity/ads/Interstitial.class...
processing com/google/unity/ads/PluginUtils.class...
processing com/google/unity/ads/UnityAdListener.class...
processing archive /Volumes/SAMSUNG/Programming/Unity Android/Go, Chicken, Go!/Temp/StagingArea/android-libraries/google-play-services_lib/libs/./google-play-services.jar...
ignored resource .readme
processing com/google/android/gms/internal/mb.class...
processing com/google/android/gms/internal/mc.class...
processing com/google/android/gms/internal/md.class...
processing com/google/android/gms/internal/mi.class...
processing com/google/android/gms/internal/me.class...
processing com/google/android/gms/internal/mf.class...
processing com/google/android/gms/internal/mg.class...
processing com/google/android/gms/internal/mh.class...
processing com/google/android/gms/internal/ma$a.class...
processing com/google/android/gms/internal/ma.class...
processing com/google/android/gms/internal/lz.class...
processing com/google/android/gms/common/internal/safeparcel/b.class...
processing com/google/android/gms/common/internal/safeparcel/a.class...
processing com/google/android/gms/common/internal/safeparcel/a$a.class...
processing com/google/android/gms/common/internal/safeparcel/SafeParcelable.class...
processing com/google/android/gms/internal/e.class...
processing com/google/android/gms/internal/f$1.class...
processing com/google/android/gms/internal/f$a.class...
processing com/google/android/gms/internal/f$b.class...
processing com/google/android/gms/internal/f$c.class...
processing com/google/android/gms/internal/f$d.class...
processing com/google/android/gms/internal/f$e.class...
processing com/google/android/gms/internal/f$f.class...
processing com/google/android/gms/internal/f$g.class...
processing com/google/android/gms/internal/f$h.class...
processing com/google/android/gms/internal/f$i.class...
processing com/google/android/gms/internal/f$j.class...
processing com/google/android/gms/internal/f$k.class...
processing com/google/android/gms/internal/f$l.class...
processing com/google/android/gms/internal/f$m.class...
processing com/google/android/gms/internal/f.class...
processing com/google/android/gms/internal/g.class...
processing com/google/android/gms/internal/h.class...
processing com/google/android/gms/internal/i.class...
processing com/google/android/gms/internal/j$a.class...
processing com/google/android/gms/internal/j.class...
processing com/google/android/gms/internal/k$a.class...
processing com/google/android/gms/internal/k.class...
processing com/google/android/gms/internal/l.class...
processing com/google/android/gms/internal/m.class...
processing com/google/android/gms/internal/n.class...
processing com/google/android/gms/internal/o.class...
processing com/google/android/gms/internal/p$a.class...
processing com/google/android/gms/internal/p.class...
processing com/google/android/gms/internal/q.class...
processing com/google/android/gms/internal/r.class...
processing com/google/android/gms/internal/ly.class...
processing com/google/android/gms/internal/a.class...
processing com/google/android/gms/internal/b.class...
processing com/google/android/gms/internal/c$j.class...
processing com/google/android/gms/internal/c.class...
processing com/google/android/gms/internal/c$a.class...
processing com/google/android/gms/internal/c$i.class...
processing com/google/android/gms/internal/c$c.class...
processing com/google/android/gms/internal/c$f.class...
processing com/google/android/gms/internal/c$d.class...
processing com/google/android/gms/internal/c$g.class...
processing com/google/android/gms/internal/c$h.class...
processing com/google/android/gms/internal/c$b.class...
processing com/google/android/gms/internal/c$e.class...
processing com/google/android/gms/internal/d$a.class...
processing com/google/android/gms/internal/d.class...
processing com/google/android/gms/internal/s$a.class...
processing com/google/android/gms/internal/s.class...
processing com/google/android/gms/internal/s$a$a.class...
processing com/google/android/gms/location/LocationRequest.class...
processing com/google/android/gms/location/ActivityRecognition$1.class...
processing com/google/android/gms/location/LocationServices$a.class...
processing com/google/android/gms/location/DetectedActivity.class...
processing com/google/android/gms/location/b.class...
processing com/google/android/gms/location/LocationServices.class...
processing com/google/android/gms/location/GeofenceStatusCodes.class...
processing com/google/android/gms/location/FusedLocationProviderApi.class...
processing com/google/android/gms/location/a.class...
processing com/google/android/gms/location/a$a.class...
processing com/google/android/gms/location/LocationStatusCodes.class...
processing com/google/android/gms/location/ActivityRecognition$a.class...
processing com/google/android/gms/location/a$a$a.class...
processing com/google/android/gms/location/ActivityRecognition.class...
processing com/google/android/gms/location/Geofence$Builder.class...
processing com/google/android/gms/location/ActivityRecognitionResult.class...
processing com/google/android/gms/location/LocationClient$OnRemoveGeofencesResultListener.class...
processing com/google/android/gms/location/DetectedActivityCreator.class...
processing com/google/android/gms/location/GeofencingEvent.class...
processing com/google/android/gms/location/Geofence.class...
processing com/google/android/gms/location/LocationClient$OnAddGeofencesResultListener.class...
processing com/google/android/gms/location/ActivityRecognitionClient.class...
processing com/google/android/gms/location/c.class...
processing com/google/android/gms/location/LocationClient.class...
processing com/google/android/gms/location/LocationServices$1.class...
processing com/google/android/gms/location/LocationRequestCreator.class...
processing com/google/android/gms/location/ActivityRecognitionResultCreator.class...
processing com/google/android/gms/location/GeofencingApi.class...
processing com/google/android/gms/location/ActivityRecognitionApi.class...
processing com/google/android/gms/location/LocationListener.class...
processing com/google/android/gms/internal/ja.class...
processing com/google/android/gms/internal/jg$b.class...
processing com/google/android/gms/internal/jc$a.class...
processing com/google/android/gms/internal/jd$2.class...
processing com/google/android/gms/internal/jd$1$1.class...
processing com/google/android/gms/internal/jc$4.class...
processing com/google/android/gms/internal/ji.class...
processing com/google/android/gms/internal/jd$2$1.class...
processing com/google/android/gms/internal/jf$a.class...
processing com/google/android/gms/internal/jj.class...
processing com/google/android/gms/internal/jh.class...
processing com/google/android/gms/internal/jc$3.class...
processing com/google/android/gms/internal/jb.class...
processing com/google/android/gms/internal/jc$1.class...
processing com/google/android/gms/internal/je$a.class...
processing com/google/android/gms/internal/jd.class...
processing com/google/android/gms/internal/je.class...
processing com/google/android/gms/internal/jb$a.class...
processing com/google/android/gms/internal/jd$a.class...
processing com/google/android/gms/internal/jh$1.class...
processing com/google/android/gms/internal/jc$6.class...
processing com/google/android/gms/internal/jd$1.class...
processing com/google/android/gms/internal/jc$7.class...
processing com/google/android/gms/internal/jb$1.class...
processing com/google/android/gms/internal/jb$2.class...
processing com/google/android/gms/internal/jk.class...
processing com/google/android/gms/internal/jd$3.class...
processing com/google/android/gms/internal/jh$a.class...
processing com/google/android/gms/internal/jc.class...
processing com/google/android/gms/internal/jh$b.class...
processing com/google/android/gms/internal/jg.class...
processing com/google/android/gms/internal/jg$a.class...
processing com/google/android/gms/internal/je$a$a.class...
processing com/google/android/gms/internal/jh$c.class...
processing com/google/android/gms/internal/jc$5.class...
processing com/google/android/gms/internal/jd$3$1.class...
processing com/google/android/gms/internal/jh$d.class...
processing com/google/android/gms/internal/jf.class...
processing com/google/android/gms/internal/jf$a$a.class...
processing com/google/android/gms/internal/jc$2.class...
processing com/google/android/gms/internal/jq.class...
processing com/google/android/gms/internal/jm.class...
processing com/google/android/gms/internal/jp.class...
processing com/google/android/gms/internal/jx.class...
processing com/google/android/gms/internal/jl.class...
processing com/google/android/gms/internal/jr.class...
processing com/google/android/gms/internal/jv.class...
processing com/google/android/gms/internal/jy.class...
processing com/google/android/gms/internal/ju.class...
processing com/google/android/gms/internal/jt.class...
processing com/google/android/gms/internal/jo.class...
processing com/google/android/gms/internal/jn.class...
processing com/google/android/gms/internal/js.class...
processing com/google/android/gms/internal/jw.class...
processing com/google/android/gms/internal/jz$a$a.class...
processing com/google/android/gms/internal/jz$a.class...
processing com/google/android/gms/internal/kc.class...
processing com/google/android/gms/internal/ka.class...
processing com/go

我的资产&#39;目录包含插件,其中包含android和ios,android文件夹包含我自己的AndroidManifest.xml和google-play-services-libs(来自最新的Android SDK更新)。

1 个答案:

答案 0 :(得分:1)

这通常是因为项目中有两个相同的jar或aar文件。尝试搜索您的&#34;资产&#34;目录为&#34; .java&#34;和&#34; .aar&#34;文件,看看你是否有任何重复。

此外,删除插件文件时不会卸载它们。他们留在Unity的记忆中。如果你删除了一个重复的jar,你必须重新启动unity,以便在你进行新的构建时删除它。