我是 Gradle 和 Maven 的新手,所以如果我犯了一个菜鸟错误,请多多包涵。
这是我的 build.gradle 文件(项目,不是全局的)
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
dependencies {
compile 'com.android.support:support-v4:13.0.+'
compile 'com.actionbarsherlock:actionbarsherlock:4.3.+'
compile 'com.github.rtyley:roboguice-sherlock:1.5'
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 8
targetSdkVersion 17
}
}
即使我添加了 ABS 和 RoboABS gradle 就下载了它们各自的 jar,AndroidStudio 和 Gradle 都找不到 ABS 类和主题。除了将 maven 工件添加到构建配置之外,我还需要做任何其他事情吗?
这正是我尝试编译新项目模板时遇到的错误,仅替换类声明以扩展 RoboSherlockActivity
Gradle: error: cannot access SherlockActivity
Gradle: error: cannot access SherlockActivity
class file for com.actionbarsherlock.app.SherlockActivity not found
Gradle: error: cannot find symbol variable super
Gradle: error: cannot find symbol variable activity_main
Gradle: error: method does not override or implement a method from a supertype
Gradle: error: cannot find symbol variable main
Gradle: error: cannot find symbol method getMenuInflater()
Gradle: error: method does not override or implement a method from a supertype