首先,我的应用程序的 gradle.build 文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 'android-L'
buildToolsVersion '20.0.0'
defaultConfig {
applicationId "com.blah.blah"
minSdkVersion 16
targetSdkVersion 'L'
versionCode 1
versionName "alpha"
}
...
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:21.+'
compile 'com.android.support:appcompat-v7:21.0.+'
compile 'com.google.android.gms:play-services:5.0.77'
compile 'com.koushikdutta.ion:ion:1.2.4'
}
无论如何,我有一个由Android Studio自动生成的导航抽屉
Fragment
,它的所有生命周期方法(onAttach()
, onDetach()
, onCreate()
等)都会抛出错误"This method is not overriding anything with the current build target, but will in API level 11 (current target is 1):"。在Android Studio生成它后,我没有修改过该片段的源代码。这是为什么?我该如何解决这个问题?