5
是否可以指定gradle這個生成AndroidManifest額外XML字段。使用的情況下,具體而言,是我有一個使用谷歌地圖應用程序,並且根據their documentation,應用程序必須指定:指定額外的gradle XML生成AndroidManifest
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
在AndroidManifest。如果再嘗試測試這個程序與gradle這個,你會得到:
$ ./gradlew connectedCheck
<snip>
:myapp:processTestTestManifest
[manifestMerge1694110764542760523.xml:1, manifestMerge678902239503841223.xml:15] Main manifest has <uses-feature android:glEsVersion='0x00010000'> but library uses glEsVersion='0x00020000'
Note: main manifest lacks a <uses-feature android:glEsVersion> declaration, and thus defaults to glEsVersion=0x00010000.
我現在的(相關)項目結構是:
myapp/AndroidManifest.xml
myapp/project.properties
myapp/res/
myapp/src/com/magic/package/Foo.java
myapp/tests/java/com/magic/package/test/FooTest.java
換句話說,除了tests/
遺留項目結構。我也試着與添加任意的AndroidManifest.xml到myapp/tests/
,即使the doc說不是,只是作爲一個測試。但是,我沒有運氣。
我buid.gradle
樣子:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
dependencies {
compile project('stuff')
}
android {
compileSdkVersion 17
buildToolsVersion "17"
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']
}
instrumentTest.setRoot('tests')
}
}
如果我刪除uses-feature
,測試將運行,但我想避免這種情況,如果可能的話。
我應該提交錯誤的地方進行跟蹤呢? – abhishekmukherg
請執行以下操作:https://code.google.com/p/android/issues/entry?template=Tools%20bug%20report –
Thanks @Xav,[filed](https://code.google.com/ p/android/issues/detail?id = 57526) – abhishekmukherg