任何人都可以帮助我解决这个问题!它昨天工作,但今天当我今天早上再次运行我的应用程序时,它不起作用。.dex文件中方法引用的数量不能超过64K,multidexenabled不能正常工作,并且对于任务':app:clean'失败
这是我build.gladle ...
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
repositories {
mavenCentral()
}
defaultConfig {
applicationId "com.brandtechnosolutions.petbaazar"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
compile 'com.google.android.gms:play-services:9.8.0'
compile 'com.google.android.gms:play-services-appindexing:9.8.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.android.support:support-v4:25.1.0'
compile `enter code here`'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
testCompile 'junit:junit:4.12'
}
我曾尝试使用此...
defaultConfig {
...
minSdkVersion 15
targetSdkVersion 23
...
// Enabling multidex support.
multiDexEnabled true
}
这...
dependencies {
compile 'com.android.support:multidex:1.0.0'
}
但随后出现新的错误...
找不到支持Android父母或祖先上下文方法登录(查看):onclick属性上的视图类定义
这是我MainActivity login()方法...
void logIn(View view) { //called when log in button pressed
Intent intent = new Intent(MainActivity.this, LoginActivity.class);
startActivity(intent); // start web activity
}
而且即时运行没有在机器人工作室工作......显示错误:
执行失败的任务“:应用程序:清洁”。无法删除文件
当我启用即时运行。请帮忙!
你需要整个''com.google.android.gms:play-services:9.8.0''吗?您只能包含您需要的播放服务的部分。 – Gudin
[56k方法中的Android 64k方法限制错误可能的重复](http://stackoverflow.com/questions/26357228/android-64k-method-limit-error-on-56k-methods) –
@Kevinrob你真的没有'甚至读到最后,是吗?它与multiDex无关,正如您可以从最新的错误中看到的那样。他修复了multiDex问题。 – Vucko