本文介绍了在不同的目录树的Andr​​oid摇篮项目编制项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个这样的项目布局:

  MyProject的/
    项目/
        build.gradle
    build.gradle
    settings.gradle
第三方/
    ActionBarSherlock /
        actionbarsherlock /
            build.gradle
        build.gradle
        settings.gradle
 

ActionBarSherlock 目录是一个git的子模块指向ActionBarSherlock的开发分支,它包含摇篮构建文件。

MyProject的/ settings.gradle 我说:

 包括..:第三方:ActionBarSherlock:动作条
 

MyProject的/ build.gradle 补充:

 编译..:第三方:ActionBarSherlock:动作条
 

依赖部分。当我建立 MyProject的/项目摇篮组装我收到以下错误:

 >项目已具备路径'..:第三方:ActionBarSherlock:动作条'不能在项目中找到:MyProject的
 

我可以建立 ActionBarSherlock 单独使用:

  CD第三方/ ActionBarSherlock / actionbarsherlock
摇篮组装
CP建立/库/ actionbarsherlock-4.3.2-SNAPSHOT.aar ../../../MyProject/Project/libs
 

然后把它用在依赖 MyProject的/ build.gradle 的部分:

 编译文件(库/ actionbarsherlock-4.3.2-SNAPSHOT.aar)
 

现在,当我建 MyProject的/项目我收到以下错误:

 >重复的文件在APK内同一路径:AndroidManifest.xml中
 

解决方案

这谷歌集团已经从Android的SDK开发泽维尔Ducrohet一个答案。 https://groups.google.com/forum/#​​!topic/adt -dev / bPY_Un8BsBY

要报价:

I have a project layout like this:

MyProject/
    Project/
        build.gradle
    build.gradle
    settings.gradle
thirdparty/
    ActionBarSherlock/
        actionbarsherlock/
            build.gradle
        build.gradle
        settings.gradle

The ActionBarSherlock directory is a git submodule pointing to the dev branch of ActionBarSherlock which contains gradle build files.

In MyProject/settings.gradle I added:

include '..:thirdparty:ActionBarSherlock:actionbar'

and in MyProject/build.gradle added:

compile '..:thirdparty:ActionBarSherlock:actionbar'

to the dependencies section. When I build MyProject/Project with gradle assemble I get the following error:

> Project with path '..:thirdparty:ActionBarSherlock:actionbar' could not be found in project ':MyProject'

I can build ActionBarSherlock separately, using:

cd thirdparty/ActionBarSherlock/actionbarsherlock
gradle assemble
cp build/libs/actionbarsherlock-4.3.2-SNAPSHOT.aar ../../../MyProject/Project/libs

and then use it in the dependencies section of MyProject/build.gradle as:

compile files('libs/actionbarsherlock-4.3.2-SNAPSHOT.aar')

Now, when I build MyProject/Project I get the following error:

> Duplicate files at the same path inside the APK: AndroidManifest.xml
解决方案

This google group has an answer from Android SDK developer Xavier Ducrohet.https://groups.google.com/forum/#!topic/adt-dev/bPY_Un8BsBY

To quote:

这篇关于在不同的目录树的Andr​​oid摇篮项目编制项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 02:04