我有一个Android项目,它依赖于三个android库.它的project.properties文件如下所示:
split.density=false
android.library.reference.2=..\\LibB
proguard.config=proguard.cfg
android.library.reference.1=..\\\\LibA\\\\
# Project target.
target=android-5
android.library.reference.3=../LibC
Run Code Online (Sandbox Code Playgroud)
此项目的build.xml仅用于依赖Gradle任务:
<target name="-pre-build" depends="preBuild" />
<target name="-pre-compile" depends="preCompile" />
<import file="${sdk.dir}/tools/ant/build.xml" />
Run Code Online (Sandbox Code Playgroud)
和build.gradle以下列方式包含项目的build.xml:
ant.property(file: 'local.properties')
configurations {
sdkDir = ant.properties['sdk.dir']
}
ant.importBuild "build.xml"
Run Code Online (Sandbox Code Playgroud)
当我使用"release"目标运行此脚本时,我从Android的build.xml文件中收到以下错误:
[ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':-build-setup'.
[ERROR] [org.gradle.BuildExceptionReporter] Cause: The following error occurred while executing this line:
[ERROR] [org.gradle.BuildExceptionReporter] Target "${build.target}" does not exist in the project "LibA".
Run Code Online (Sandbox Code Playgroud)
这是由第466行(包含"subant"的行)引起的:
<!-- compile the libraries if any -->
<if>
<condition>
<isreference refid="project.libraries" />
</condition>
<then>
<echo>Building Libraries</echo> …
Run Code Online (Sandbox Code Playgroud)