我正在尝试将Eclipse应用程序迁移到Android Studio中。打开项目后,在同步期间显示此错误:
不支持的方法:BaseConfig.getApplicationIdSuffix()。 您连接的Gradle版本不支持该方法。 要解决此问题,您可以更改/升级您连接到的Gradle的目标版本。 或者,您可以忽略此异常并从模型中读取其他信息。
解决方案似乎是关于更改build.gradle中的类路径,但是我没有改变类路径......
我的意见包括:
apply plugin: 'android'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile project(':library')
compile project(':CaptureActivity')
compile project(':appcompat_v7')
}
android {
compileSdkVersion 19
buildToolsVersion "19.1.0"
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
我做错了什么?