Closed lazarv closed 10 years ago
Hello lazarv
Please do the following steps:
$ npm update -g cocoonjs $ mkdir test $ cocoonjs create test com.ludei.test $ cocoonjs platform add android $ cocoonjs plugin add com.ludei.webview.plus -d $ cocoonjs build -d
Notice the " -d" after the last two commands. If the project fails when building it, please paste here all the output.
Still fails with the same error, here is the complete verbose build output:
[CocoonJS] Executing command 'build -d' [CocoonJS] cordova library for "android" already exists. No need to download. Co ntinuing. [CocoonJS] Generating config.xml from defaults for platform "android" [CocoonJS] Calling plugman.prepare for platform "android" Preparing android project Processing configuration changes for plugins. Iterating over installed plugins: [ 'com.ludei.webview.plus' ] Writing out cordova_plugins.js... Wrote out Android application name to "HelloCordova" Wrote out Android package name to "com.ludei.test" Running command: C:\Users\Viktor\test\platforms\android\cordova\build.bat [CocoonJS] Buildfile: C:\Users\Viktor\test\platforms\android\build.xml [CocoonJS] [CocoonJS] -set-mode-check: [CocoonJS] -set-debug-files: [CocoonJS] -check-env: [CocoonJS] [checkenv] Android SDK Tools Revision 22.6.3 [CocoonJS] [checkenv] Installed at c:\Users\Viktor\AppData\Local\Android\androi d-sdk
-setup: [CocoonJS] [echo] Project Name: HelloCordova [CocoonJS] [gettype] Project Type: Application [CocoonJS] -set-debug-mode: [CocoonJS] -debug-obfuscation-check: [CocoonJS]
-pre-build:
-build-setup: [CocoonJS] [getbuildtools] Using latest Build Tools: 19.1.0 [CocoonJS] [echo] Resolving Build Target for HelloCordova... [CocoonJS] [CocoonJS] [gettarget] Project Target: Android 4.4.2 [CocoonJS] [gettarget] API level: 19 [CocoonJS] [gettarget] WARNING: No minSdkVersion value set. Application will ins tall on all Android versions. [CocoonJS] [echo] ---------- [CocoonJS] [echo] Creating output directories if needed... [CocoonJS] [echo] ---------- [CocoonJS] [echo] Resolving Dependencies for HelloCordova... [CocoonJS] [dependency] Library dependencies: [CocoonJS] [dependency] [dependency] ------------------ [CocoonJS] [dependency] Ordered libraries: [CocoonJS] [dependency] [CocoonJS] [dependency] ------------------ [CocoonJS] [echo] ---------- [CocoonJS] [CocoonJS] [echo] Building Libraries with 'debug'... [CocoonJS] Trying to override old definition of task testedprojectclasspath [CocoonJS] Trying to override old definition of task getuitarget [CocoonJS] Trying to override old definition of task getlibpath [CocoonJS] Trying to override old definition of task renderscript [CocoonJS] Trying to override old definition of task lint [CocoonJS] Trying to override old definition of task dex [CocoonJS] Trying to override old definition of task getprojectpaths [CocoonJS] Trying to override old definition of task buildconfig [CocoonJS] [CocoonJS] Trying to override old definition of task aidl [CocoonJS] Trying to override old definition of task propertybyreplace [CocoonJS] Trying to override old definition of task signapk [CocoonJS] Trying to override old definition of task gettype [CocoonJS] Trying to override old definition of task if [CocoonJS] Trying to override old definition of task dependency Trying to override old definition of task xpath Trying to override old definition of task zipalign [CocoonJS] Trying to override old definition of task apkbuilder [CocoonJS] Trying to override old definition of task getbuildtools [CocoonJS] Trying to override old definition of task aapt [CocoonJS] Trying to override old definition of task getemmafilter [CocoonJS] Trying to override old definition of task checkenv [CocoonJS] Trying to override old definition of task mergemanifest [CocoonJS] Trying to override old definition of task gettarget [CocoonJS] Trying to override old definition of task emmajava [CocoonJS] Trying to override old definition of task emma [CocoonJS] nodeps: [CocoonJS] -set-mode-check:
-set-debug-files:
-check-env: [CocoonJS] [checkenv] Android SDK Tools Revision 22.6.3 [CocoonJS] [checkenv] Installed at C:\Users\Viktor\AppData\Local\Android\androi d-sdk
-setup: [echo] Project Name: LudeiChromium [CocoonJS] [gettype] Project Type: Android Library [CocoonJS] -set-debug-mode: [CocoonJS] [CocoonJS] -debug-obfuscation-check: [CocoonJS] -pre-build:
-build-setup: [CocoonJS] [getbuildtools] Using latest Build Tools: 19.1.0 [CocoonJS] [echo] Resolving Build Target for LudeiChromium... [CocoonJS] [gettarget] Project Target: Google APIs [CocoonJS] [gettarget] Vendor: Google Inc. [CocoonJS] [gettarget] Platform Version: 4.4.2 [gettarget] API level: 19 [CocoonJS] [echo] ---------- [CocoonJS] [echo] Creating output directories if needed... [CocoonJS] [echo] ---------- [CocoonJS] [echo] Resolving Dependencies for LudeiChromium... [CocoonJS] [CocoonJS] [dependency] Library dependencies: [CocoonJS] [dependency] No Libraries [dependency] [dependency] ------------------ [CocoonJS] -code-gen: [CocoonJS] [CocoonJS] [mergemanifest] Found Deleted Target File [CocoonJS] [mergemanifest] Merging AndroidManifest files into one. [mergemanifest] Manifest merger disabled. Using project manifest only. [CocoonJS] [echo] Handling aidl files... [CocoonJS] [CocoonJS] [aidl] No AIDL files to compile. [CocoonJS] [echo] ---------- [CocoonJS] [echo] Handling RenderScript files... [CocoonJS] [echo] ---------- [CocoonJS] [echo] Handling Resources... [CocoonJS] [aapt] Found Deleted Target File [CocoonJS] [aapt] Generating resource IDs... [CocoonJS] [echo] ---------- [CocoonJS] [echo] Handling BuildConfig class... [CocoonJS] [buildconfig] No need to generate new BuildConfig. [CocoonJS] -pre-compile:
-compile: [CocoonJS] [javac] Compiling 1 source file to C:\Users\Viktor\test\plugins\c om.ludei.webview.plus\android\ant-build\classes [CocoonJS] [echo] Creating library output jar file... [CocoonJS] -post-compile: [CocoonJS] -obfuscate:
-dex: [CocoonJS] [echo] Library project: do not convert bytecode...
-crunch: [CocoonJS] [crunch] Crunching PNG Files in source dir: C:\Users\Viktor\test\p lugins\com.ludei.webview.plus\android\res [CocoonJS] [crunch] To destination dir: C:\Users\Viktor\test\plugins\com.lude i.webview.plus\android\ant-build\res [crunch] Crunched 0 PNG files to update cache
-package-resources: [CocoonJS] [echo] Library project: do not package resources...
-package: [CocoonJS] [echo] Library project: do not package apk... [CocoonJS] -post-package:
-do-debug: [echo] Library project: do not create apk... [CocoonJS] [propertyfile] Updating property file: C:\Users\Viktor\test\plugins\c om.ludei.webview.plus\android\ant-build\build.prop [CocoonJS] [propertyfile] Updating property file: C:\Users\Viktor\test\plugins\c om.ludei.webview.plus\android\ant-build\build.prop [CocoonJS] [propertyfile] Updating property file: C:\Users\Viktor\test\plugins\c om.ludei.webview.plus\android\ant-build\build.prop [CocoonJS] [propertyfile] Updating property file: C:\Users\Viktor\test\plugins\c om.ludei.webview.plus\android\ant-build\build.prop [CocoonJS] -post-build: [CocoonJS]
debug: [CocoonJS] nodeps: [CocoonJS] -set-mode-check:
-set-debug-files: [CocoonJS] -check-env: [CocoonJS] [checkenv] Android SDK Tools Revision 22.6.3 [CocoonJS] [checkenv] Installed at c:\Users\Viktor\AppData\Local\Android\androi d-sdk
-setup: [echo] Project Name: CordovaLib [CocoonJS] [gettype] Project Type: Android Library [CocoonJS] -set-debug-mode: [CocoonJS] -debug-obfuscation-check: [CocoonJS]
-pre-build:
-build-setup: [CocoonJS] [getbuildtools] Using latest Build Tools: 19.1.0 [CocoonJS] [echo] Resolving Build Target for CordovaLib... [CocoonJS] [gettarget] Project Target: Android 4.4.2 [CocoonJS] [gettarget] API level: 19 [CocoonJS] [echo] ---------- [CocoonJS] [echo] Creating output directories if needed... [CocoonJS] [echo] ---------- [CocoonJS] [echo] Resolving Dependencies for CordovaLib...
BUILD FAILED c:\Users\Viktor\AppData\Local\Android\android-sdk\tools\ant\build.xml:601: The f ollowing error occurred while executing this line: c:\Users\Viktor\AppData\Local\Android\android-sdk\tools\ant\build.xml:577: ..... .pluginscom.ludei.webview.plusandroid resolve to a path with no project.properti es file for project C:\Users\Viktor\test\platforms\android\CordovaLib
Total time: 2 seconds
[CocoonJS] Command finished with error code 2: C:\Users\Viktor\test\platforms\an droid\cordova\build.bat
Which version of Cordova have you installed in your system? $ cordova --version
Open the file C:...\test\platforms\android\CordovaLib\project.properties and paste here its contents
We are quickly approaching the solution :)
I'm using Cordova 3.5.0-0.2.4.
Here's the content of the project.properties file:
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "ant.properties", and override values to adapt the script to your
# project structure.
# Indicates whether an apk should be generated for each density.
split.density=false
# Project target.
target=android-19
apk-configurations=
renderscript.opt.level=O0
android.library=true
android.library.reference.1=..\..\..\plugins\com.ludei.webview.plus\android
Thank you for pointing me into the right direction, I managed to succesfully build the project. The path to the webview+ plugin was wrong, because it was not escaped correctly. I modified it to:
android.library.reference.1=..\\..\\..\\plugins\\com.ludei.webview.plus\\android
Is this a Cordova or a CocoonJS bug?
Oooops! this is a CocoonJS bug, thank you so much, we managed to build projects on Windows 7, and we never had any problem like that, we'll investigate this.
Thank you!
Great news, this issue has been fixed with this commit in the Webview+ repo https://github.com/ludei/webview-plus/commit/2b66a1df2e4a6a66357c83d1c524ed24747b39f8
thank you so much lazarv.
After I successfully created my cocoonjs project and added the webview+ plugin without any errors, I get this error on building my project:
BUILD FAILED c:\Users\Viktor\AppData\Local\Android\android-sdk\tools\ant\build.xml:601: The f ollowing error occurred while executing this line: c:\Users\Viktor\AppData\Local\Android\android-sdk\tools\ant\build.xml:577: ..... .pluginscom.ludei.webview.plusandroid resolve to a path with no project.properti es file for project C:\inetpub\wwwroot\duck\platforms\android\CordovaLib
Total time: 1 second
Error: c:\inetpub\wwwroot\duck\platforms\android\cordova\build.bat: Command fail ed with exit code 2 at ChildProcess.whenDone (c:\Users\Viktor\AppData\Roaming\npm\node_modules\c ordova\src\superspawn.js:126:23) at ChildProcess.EventEmitter.emit (events.js:98:17) at maybeClose (child_process.js:753:16) at Process.ChildProcess._handle.onexit (child_process.js:820:5)
The Cordova CLI runs without any errors and I'm using the Multi-Device Hybrid App extension for Visual Studio. Android SDK 19 installed. Is my Android SDK on a wrong path?