Tac*_*0sS 5 android gradle android-library android-studio build.gradle
我需要使用Gradle构建一个依赖于Android库项目A的Android项目,该项目取决于另一个Android库项目B.
到目前为止,我有以下内容:
Android项目:
的build.gradle:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android'
dependencies {
compile project(':LibA')
}
android {
compileSdkVersion 7
buildToolsVersion "17.0.0"
}
Run Code Online (Sandbox Code Playgroud)
manifest.xml文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cyborg.template"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="7" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name="com.cyborg.template.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Run Code Online (Sandbox Code Playgroud)
Android库A:
的build.gradle:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android-library'
dependencies {
compile project(':LibB')
}
android {
compileSdkVersion 7
buildToolsVersion "17.0.0"
}
Run Code Online (Sandbox Code Playgroud)
manifest.xml文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.lib.project.a"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="7"/>
</manifest>
Run Code Online (Sandbox Code Playgroud)
Android库B:
的build.gradle:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android-library'
android {
compileSdkVersion 7
buildToolsVersion "17.0.0"
}
Run Code Online (Sandbox Code Playgroud)
manifest.xml文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.lib.project.b"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="7"/>
</manifest>
Run Code Online (Sandbox Code Playgroud)
在尝试构建Android项目时,Android studio报告了以下错误:
Gradle: Execution failed for task ':LibA:processDebugManifest'.
> Manifest merging failed. See console for more info.
Run Code Online (Sandbox Code Playgroud)
那个控制台在哪里我想搜索有关错误的更多信息?
我发现了一些关于这个错误的问题,但它似乎与我的情况不一样.
启示?
谢谢,亚当.
| 归档时间: |
|
| 查看次数: |
3507 次 |
| 最近记录: |