【发布时间】:2017-01-11 09:56:30
【问题描述】:
谁能帮我解决这个问题!它昨天工作,但今天早上我再次运行我的应用程序时,它没有工作。
这是我的 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 属性的父或祖先上下文中找不到方法 logIn(View)
这是我的 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
}
另外 Instant Run 无法在 android studio 中运行...显示错误:
任务“:app:clean”执行失败。无法删除文件
当我启用即时运行时。请帮忙!
【问题讨论】:
-
你需要完整的
'com.google.android.gms:play-services:9.8.0'吗?您可以只包含您需要的部分播放服务。 -
@Kevinrob 你真的没有读到最后,是吗?从最新的错误中可以看出,它与 multiDex 无关。他修复了 multiDex 问题。
标签: android android-studio build.gradle