Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build error referencing build.xml and proguard file: "null returned: 1"

While building my PhoneGap app (with the Facebook SDK plugin installed), I encountered this error:

BUILD FAILED C:\adt-bundle-windows-x86_64-20130522\sdk\tools\ant\build.xml:653: The following error occured while executing this line: C:\adt-bundle-windows-x86_64-20130522\sdk\tools\ant\build.xml:698: null returned: 1

Line 653 is:

<do-only-if-manifest-hasCode elseText="hasCode = false. Skipp aidl/renderscript/R.java">

Line 698 is:

proguardFile="${out.absolute.dir}/proguard.txt"

My solutions so far include the following:

  1. Ran android update project to force generation of the proguard-project.txt file, as well as update the local.properties and project.properties file.
  2. Edited C:\adt-bundle-windows-x86_64-20130522\sdk\tools\ant\build.xml so that all mentions to proguard.txt become proguard-project.txt.
  3. ran ant -logfile ./antLogFile.txt release. Here is the log file.

-set-mode-check:

-set-release-mode:

-release-obfuscation-check: [echo] proguard.config is C:\adt-bundle-windows-x86_64-20130522\sdk/tools/proguard/proguard-android.txt:proguard-project.txt [echo] Proguard.config is enabled

-pre-build:

-check-env: [checkenv] Android SDK Tools Revision 22.6.2 [checkenv] Installed at C:\adt-bundle-windows-x86_64-20130522\sdk

-setup: [echo] Project Name: HelloWorld [gettype] Project Type: Application

-build-setup: [getbuildtools] Using latest Build Tools: 19.0.3 [echo] Resolving Build Target for HelloWorld... [gettarget] Project Target: Android 2.3.3 [gettarget] API level: 10 [gettarget] WARNING: Attribute minSdkVersion in AndroidManifest.xml (14) is higher than the project target API level (10) [echo] ---------- [echo] Creating output directories if needed... [echo] ---------- [echo] Resolving Dependencies for HelloWorld... [dependency] Library dependencies: [dependency] [dependency] ------------------ [dependency] Ordered libraries: [dependency] [dependency] ------------------ [dependency] API<=15: Adding annotations.jar to the classpath. [echo] ---------- [echo] Building Libraries with 'release'...

nodeps:

-set-mode-check:

-set-release-mode:

-release-obfuscation-check: [echo] proguard.config is C:\adt-bundle-windows-x86_64-20130522\sdk/tools/proguard/proguard-android.txt:proguard-project.txt [echo] Proguard.config is enabled

-pre-build:

-check-env: [checkenv] Android SDK Tools Revision 22.6.2 [checkenv] Installed at C:\adt-bundle-windows-x86_64-20130522\sdk

-setup: [echo] Project Name: facebook [gettype] Project Type: Android Library

-build-setup: [getbuildtools] Using latest Build Tools: 19.0.3 [echo] Resolving Build Target for facebook... [gettarget] Project Target: Android 2.3.3 [gettarget] API level: 10 [echo] ---------- [echo] Creating output directories if needed... [mkdir] Created dir: C:\Users\brian.lee\Desktop\Eclipse Workspace\chumba_connect_trunk_new\facebook-android-sdk-3.14.1\facebook\bin\rsObj [mkdir] Created dir: C:\Users\brian.lee\Desktop\Eclipse Workspace\chumba_connect_trunk_new\facebook-android-sdk-3.14.1\facebook\bin\rsLibs [echo] ---------- [echo] Resolving Dependencies for facebook... [dependency] Library dependencies: [dependency] No Libraries [dependency] [dependency] ------------------ [dependency] API<=15: Adding annotations.jar to the classpath.

-code-gen: [mergemanifest] Found Deleted Target File [mergemanifest] Merging AndroidManifest files into one. [mergemanifest] Manifest merger disabled. Using project manifest only. [echo] Handling aidl files... [aidl] No AIDL files to compile. [echo] ---------- [echo] Handling RenderScript files... [echo] ---------- [echo] Handling Resources... [aapt] Generating resource IDs... [aapt] invalid resource directory name: C:\Users\brian.lee\Desktop\Eclipse Workspace\chumba_connect_trunk_new\facebook-android-sdk-3.14.1\facebook\bin\res/crunch

BUILD FAILED C:\adt-bundle-windows-x86_64-20130522\sdk\tools\ant\build.xml:601: The following error occurred while executing this line: C:\adt-bundle-windows-x86_64-20130522\sdk\tools\ant\build.xml:653: The following error occurred while executing this line: C:\adt-bundle-windows-x86_64-20130522\sdk\tools\ant\build.xml:698: null returned: 1

Total time: 2 seconds

All of my attempts yielded no progress. Why does this error occur? What must I do to build successfully?

like image 901
brain56 Avatar asked May 20 '14 07:05

brain56


3 Answers

For me: I had

edited my config.xml wrongly

. Try undoing your edits or placing a generic config.xml then see if she builds.

like image 80
ekerner Avatar answered Oct 06 '22 00:10

ekerner


Close Eclipse and then run ant clean in your project folder.

like image 45
brain56 Avatar answered Oct 06 '22 00:10

brain56


Verify your JAVA_HOME variable is correctly set to some path like C:\Program Files\Java\jdk1.7.0_67\ and if the error still goes on, it may be solved going to the build.xml and setting true to the variable fork, or the passed variable ${need.javac.fork}, which sets fork´s value in:

fork="${need.javac.fork}"

like image 41
EliuX Avatar answered Oct 05 '22 23:10

EliuX