我正在尝试通过 Android Studio 将我的项目从 Eclipse 转换。我的主要项目是使用 Jira Mobile Connect for Android 作为模块。
我的主项目 AndroidManifest.xml 引用了模块项目(Eclipse 中的库项目)中的字符串。
<activity
android:name="com.atlassian.jconnect.droid.activity.FeedbackActivity"
android:label="@string/jconnect.droid.create_feedback" >
</activity>
我收到以下错误。
android-apt-compiler: [MyProject] C:\dev\projects\android\MyProject\AndroidManifest.xml:92: error: Error: No resource found that matches the given name (at 'label' with value '@string/jconnect.droid.create_feedback').
我可以从命令行运行“gradle assemble”而不会出错。
这是我的项目 build.gradle 文件。
buildscript {
println 'Running gradle.'
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile project('../jiraconnect-android/jiraconnect-android-main')
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 8
targetSdkVersion 17
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
}
}
我还有一个 settings.gradle 文件:
include ':MyHouse', '../jiraconnect-android/jiraconnect-android-main'
我的 Jira Mobile Connect 模块具有以下 build.gradle 文件:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android-library'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}
android {
compileSdkVersion 8
buildToolsVersion "17.0.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']
}
}
}