任何人都可以幫助我解決這個問題!它昨天工作,但今天當我今天早上再次運行我的應用程序時,它不起作用。.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