我以前见过各种版本的dex erros,但这个版本是新的.清理/重启等无济于事.图书馆项目似乎完好无损,依赖似乎正确联系在一起.
Unable to execute dex: method ID not in [0, 0xffff]: 65536
Conversion to Dalvik format failed: Unable to execute dex: method ID not in [0, 0xffff]: 65536
Run Code Online (Sandbox Code Playgroud)
要么
Cannot merge new index 65950 into a non-jumbo instruction
Run Code Online (Sandbox Code Playgroud)
要么
java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
Run Code Online (Sandbox Code Playgroud)
tl;博士:Google的官方解决方案终于来了!
http://developer.android.com/tools/building/multidex.html
只有一个小提示,你可能需要这样做以防止在执行dex-ing时内存不足.
dexOptions {
javaMaxHeapSize "4g"
}
Run Code Online (Sandbox Code Playgroud)
还有一种巨型模式可以以不太可靠的方式解决这个问题:
dexOptions {
jumboMode true
}
Run Code Online (Sandbox Code Playgroud)
更新:如果您的应用程序很胖并且您的主应用程序中有太多方法,则可能需要按照应用程序重新设置应用程序
http://blog.osom.info/2014/12/too-many-methods-in-main-dex.html
我正在使用Android 2.2开发Android应用程序,我的应用程序APK大小为22.5 MB,我想为三星平板电脑创建一个新版本.我收到以下错误:
INSTALL_FAILED_DEXOPT
我该如何解决这种错误?
自从我更新到Android SDK工具25.1.6和Android支持存储库32.0.0(今天早上)后,我收到以下错误,我没有更改我的代码中的任何内容,它仍在我的同事计算机上运行(Android SDK工具) 25.1.1 + Android支持存储库30.0.0).
java.lang.IncompatibleClassChangeError: The method
'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)'
was expected to be of type virtual but instead was found to be of type direct
(declaration of 'java.lang.reflect.ArtMethod' appears in /system/framework/core-libart.jar)
at com.google.android.gms.iid.zzd.zzeb(Unknown Source)
at com.google.android.gms.iid.zzd.<init>(Unknown Source)
at com.google.android.gms.iid.zzd.<init>(Unknown Source)
at com.google.android.gms.iid.InstanceID.zza(Unknown Source)
at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source)
at com.xxxxxxx.utils.RegistrationIntentService.onHandleIntent(RegistrationIntentService.java:55)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.os.HandlerThread.run(HandlerThread.java:61)
Run Code Online (Sandbox Code Playgroud)
这是一段崩溃的代码:
InstanceID instanceID = InstanceID.getInstance(this); // <-- crash here
String instanceIDToken = instanceID.getToken(getString(R.string.google_app_id),
GoogleCloudMessaging.INSTANCE_ID_SCOPE, null);
Run Code Online (Sandbox Code Playgroud)
当我尝试从Google Cloud Messaging获取令牌时.
我正在使用分割的播放服务在Gradle中导入GCM:
compile 'com.google.android.gms:play-services-analytics:9.0.0'
compile …Run Code Online (Sandbox Code Playgroud) android google-cloud-messaging android-gradle-plugin firebase-cloud-messaging
Android ART运行时是否与Dalvik具有相同的方法限制限制?目前,主要dex文件中有64k方法的限制
我一直在尝试在我的应用程序中使用Quasar光纤,但我想知道这个库是否不适合Android JVM.
我有我的build.gradle:
configurations {
quasar
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.google.android.gms:play-services:6.5.87'
compile 'co.paralleluniverse:quasar-core:0.6.2'
}
Run Code Online (Sandbox Code Playgroud)
运行构建时,我在gradle控制台中获得以下输出:
Executing tasks: [:app:assembleDebug]
Configuration on demand is an incubating feature.
:app:preBuild
:app:compileDebugNdk UP-TO-DATE
:app:preDebugBuild
:app:checkDebugManifest
:app:preReleaseBuild
:app:prepareComAndroidSupportAppcompatV72103Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42103Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices6587Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:compileDebugJava UP-TO-DATE
:app:preDexDebug UP-TO-DATE
:app:dexDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexIndexOverflowException: method ID …Run Code Online (Sandbox Code Playgroud)