在尝试构建项目时,我在Android Studio中收到"错误:未指定Android源生成器:[app_name]Android SDK"。
我有Android Studio 1.0.2 RC4版本。
已经做了什么:
- SDK安装在SDK Manager中
- 项目结构->SDK;我已经添加了最低和目标SDK
- 更新的build.gradle
build.gradle文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.byoutline.pinafood"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.jakewharton:butterknife:6.0.0'
compile 'com.squareup.retrofit:retrofit:1.6.1'
compile 'com.etsy.android.grid:library:1.0.5'
compile 'org.glassfish:javax.annotation:3.1.1'
compile 'com.squareup:otto:1.3.5'
compile 'com.squareup.picasso:picasso:2.3.4'
compile 'com.squareup.dagger:dagger:1.2.2'
provided 'com.squareup.dagger:dagger-compiler:1.2.1'
compile 'com.jakewharton.hugo:hugo-runtime:1.1.0'
compile 'com.jakewharton.timber:timber:2.4.+'
}
转到Project Structure->SDK Location
并确保路径设置正确。
好的,所以我不得不将build:gradle升级到1.0.0(只需更改build.gradle文件中的数字,并从runProguard更改为minimyEnabled。