gradle build issues in building android projects.

162 views
Skip to first unread message

sakthi dass

unread,
Mar 30, 2015, 1:18:18 AM3/30/15
to jenkins...@googlegroups.com
Hi,

            I am trying to build a cordova project in jenkins ,but it shows a compile error like this 
 [javac] Compiling 3 source files to C:\Users\Sakthi Balan\.jenkins\jobs\finalgradle\workspace\bin\classes
   
[javac] C:\Users\Sakthi Balan\.jenkins\jobs\finalgradle\workspace\src\com\example\hello\MainActivity.java:23: error: package org.apache.cordova does not exist
   
[javac] import org.apache.cordova.*;
   
[javac] ^
   
[javac] C:\Users\Sakthi Balan\.jenkins\jobs\finalgradle\workspace\src\com\example\hello\MainActivity.java:25: error: cannot find symbol
   
[javac] public class MainActivity extends CordovaActivity
   
[javac]                                   ^
 i cant resolve this error. can anyone please help me?

Richard Bywater

unread,
Mar 30, 2015, 1:36:10 AM3/30/15
to jenkins...@googlegroups.com

This seems more of a Gradle question than a Jenkins one - does it compile outside of Jenkins?

Richard


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/29864b00-b6e3-4350-bfdc-ddb6839d3579%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

sakthi dass

unread,
Mar 30, 2015, 2:53:25 AM3/30/15
to jenkins...@googlegroups.com
yes i am using command line to build the cordova project.it works fine.

 

 
 C:\Users\Sakthi Balan\Desktop\CordovaAndroid\hello>cordova build
Running command: cmd "/s /c ""C:\Users\Sakthi Balan\Desktop\CordovaAndroid\hello
\platforms\android\cordova\build.bat"""
Buildfile: C:\Users\Sakthi Balan\Desktop\CordovaAndroid\hello\platforms\android\
build.xml

-set-mode-check:

-set-debug-files:

-check-env:
 [checkenv] Android SDK Tools Revision 24.1.2
 [checkenv] Installed at C:\Program Files (x86)\Android\android-sdk

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

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:

-build-setup:
[getbuildtools] Using latest Build Tools: 22.0.1
     [echo] Resolving Build Target for MainActivity...
[gettarget] Project Target:   Android 5.0.1
[gettarget] API level:        21
     [echo] ----------
     [echo] Creating output directories if needed...
     [echo] ----------
     [echo] Resolving Dependencies for MainActivity...
[dependency] Library dependencies:
[dependency]
[dependency] ------------------
[dependency] Ordered libraries:
[dependency]
[dependency] ------------------
     [echo] ----------
     [echo] Building Libraries with 'debug'...

nodeps:

-set-mode-check:

-set-debug-files:

-check-env:
 [checkenv] Android SDK Tools Revision 24.1.2
 [checkenv] Installed at C:\Program Files (x86)\Android\android-sdk

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

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:

-build-setup:
[getbuildtools] Using latest Build Tools: 22.0.1
     [echo] Resolving Build Target for MainActivity...
[gettarget] Project Target:   Android 5.0.1
[gettarget] API level:        21
     [echo] ----------
     [echo] Creating output directories if needed...
     [echo] ----------
     [echo] Resolving Dependencies for MainActivity...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------

-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] Found new input file
     [aapt] Generating resource IDs...
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.

-pre-compile:

-compile:
     [echo] Creating library output jar file...

-post-compile:

-obfuscate:

-dex:
     [echo] Library project: do not convert bytecode...

-crunch:
   [crunch] Crunching PNG Files in source dir: C:\Users\Sakthi Balan\Desktop\Cor
dovaAndroid\hello\platforms\android\CordovaLib\res
   [crunch] To destination dir: C:\Users\Sakthi Balan\Desktop\CordovaAndroid\hel
lo\platforms\android\CordovaLib\ant-build\res
   [crunch] Crunched 0 PNG files to update cache

-package-resources:
     [echo] Library project: do not package resources...

-package:
     [echo] Library project: do not package apk...

-post-package:

-do-debug:
     [echo] Library project: do not create apk...
[propertyfile] Updating property file: C:\Users\Sakthi Balan\Desktop\CordovaAndr
oid\hello\platforms\android\CordovaLib\ant-build\build.prop
[propertyfile] Updating property file: C:\Users\Sakthi Balan\Desktop\CordovaAndr
oid\hello\platforms\android\CordovaLib\ant-build\build.prop
[propertyfile] Updating property file: C:\Users\Sakthi Balan\Desktop\CordovaAndr
oid\hello\platforms\android\CordovaLib\ant-build\build.prop
[propertyfile] Updating property file: C:\Users\Sakthi Balan\Desktop\CordovaAndr
oid\hello\platforms\android\CordovaLib\ant-build\build.prop

-post-build:

debug:

-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] Found Deleted Target File
     [aapt] Generating resource IDs...
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.

-pre-compile:
     [echo] Set jars path to: C:\Users\Sakthi Balan\Desktop\CordovaAndroid\hello
\platforms\android\CordovaLib\ant-build\classes.jar

-compile:
    [javac] Compiling 2 source files to C:\Users\Sakthi Balan\Desktop\CordovaAnd
roid\hello\platforms\android\ant-build\classes

-post-compile:

-obfuscate:

-dex:
      [dex] input: C:\Users\Sakthi Balan\Desktop\CordovaAndroid\hello\platforms\
android\ant-build\classes
      [dex] input: C:\Users\Sakthi Balan\Desktop\CordovaAndroid\hello\platforms\
android\CordovaLib\ant-build\classes.jar
      [dex] Using Pre-Dexed classes-9d0b9665a9cefd5e6c7b979727daacd0.jar <- C:\U
sers\Sakthi Balan\Desktop\CordovaAndroid\hello\platforms\android\CordovaLib\ant-
build\classes.jar
      [dex] Found Deleted Target File
      [dex] Converting compiled files and external libraries into C:\Users\Sakth
i Balan\Desktop\CordovaAndroid\hello\platforms\android\ant-build\classes.dex...
       [dx] Merged dex A (10 defs/7.8KiB) with dex B (223 defs/326.2KiB). Result
 is 233 defs/406.3KiB. Took 0.1s

-crunch:
   [crunch] Crunching PNG Files in source dir: C:\Users\Sakthi Balan\Desktop\Cor
dovaAndroid\hello\platforms\android\res
   [crunch] To destination dir: C:\Users\Sakthi Balan\Desktop\CordovaAndroid\hel
lo\platforms\android\ant-build\res
   [crunch] Crunched 0 PNG files to update cache

-package-resources:
     [aapt] Found Deleted Target File
     [aapt] Creating full resource package...

-package:
[apkbuilder] Found Deleted Target File
[apkbuilder] Creating MainActivity-debug-unaligned.apk and signing it with a deb
ug key...

-post-package:

-do-debug:
 [zipalign] Running zip align on final apk...
     [echo] Debug Package: C:\Users\Sakthi Balan\Desktop\CordovaAndroid\hello\pl
atforms\android\ant-build\MainActivity-debug.apk
[propertyfile] Updating property file: C:\Users\Sakthi Balan\Desktop\CordovaAndr
oid\hello\platforms\android\ant-build\build.prop
[propertyfile] Updating property file: C:\Users\Sakthi Balan\Desktop\CordovaAndr
oid\hello\platforms\android\ant-build\build.prop
[propertyfile] Updating property file: C:\Users\Sakthi Balan\Desktop\CordovaAndr
oid\hello\platforms\android\ant-build\build.prop
[propertyfile] Updating property file: C:\Users\Sakthi Balan\Desktop\CordovaAndr
oid\hello\platforms\android\ant-build\build.prop

-post-build:
     [move] Moving 1 file to C:\Users\Sakthi Balan\Desktop\CordovaAndroid\hello\
platforms\android\ant-build
     [move] Moving 1 file to C:\Users\Sakthi Balan\Desktop\CordovaAndroid\hello\
platforms\android\CordovaLib\ant-build

debug:

BUILD SUCCESSFUL
Total time: 15 seconds
Built the following apk(s):
    C:\Users\Sakthi Balan\Desktop\CordovaAndroid\hello\platforms\android\ant-bui
ld\MainActivity-debug.apk
Reply all
Reply to author
Forward
0 new messages