ludei / cocoonjs-cli

CocoonJS command line tool
Other
46 stars 7 forks source link

Cannot build Webview+ project #14

Open c-andrews opened 10 years ago

c-andrews commented 10 years ago

Hi, I have been having issues trying to add WebView+ to my Cordova project. I have run the add plugin in debug mode and get the following:

$ cocoonjs plugin add com.ludei.webview.plus -d [CocoonJS] Executing command 'plugin add com.ludei.webview.plus -d' [CocoonJS] Installing Webview+ in your Cordova Project. [CocoonJS] Downloading Webview+... Fetching plugin "com.ludei.webview.plus" via plugin registry Installing "com.ludei.webview.plus" for android [CocoonJS] Executing 'ant release -buildfile /Users/chris/Work/test_project/development/test/plugins/com.ludei.webview.plus/android/build.xml' Buildfile: /Users/chris/Work/test_project/development/test/plugins/com.ludei.webview.plus/android/build.xml

BUILD FAILED /Users/chris/Work/test_project/development/test/plugins/com.ludei.webview.plus/android/build.xml:90: Cannot find /Users/chris/Development/adt-bundle/sdk/platform-tools:/Users/chris/Development/adt-bundle/sdk/tools/ant/build.xml imported from /Users/chris/Work/test_project/development/test/plugins/com.ludei.webview.plus/android/build.xml

Am i missing something, the build.xml file is there but it is not finding it. My .bash_profile file looks like this:

export ANDROID_HOME=/Users/chris/Development/adt-bundle/sdk/platform-tools:/Users/chris/Development/adt-bundle/sdk/ export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

Any help is very appreciated.

Thanks, Chris

c-andrews commented 10 years ago

Ok, I have changed my .bash_profile to the following and can now get a bit further:

export ANDROID_HOME=/Users/chris/Development/adt-bundle/sdk export PATH=${PATH}:/Users/chris/Development/adt-bundle/sdk/tools

Now i get: Unable to resolve project target 'Google Inc.:Google APIs:19'

So I have changed "target=Google Inc.:Google APIs:19" to "target=android-19" in the android/project.properties and ran the "$ cocoonjs plugin add com.ludei.webview.plus -d", but this just overwrites the changes.

Also after changing the above I run the below: "ant release -buildfile /Users/chris/Work/test_project/development/cocoonjs/plugins/com.ludei.webview.plus/android/build.xml"

I get returned the below output:

Buildfile: /Users/chris/Work/test_project/development/cocoonjs/plugins/com.ludei.webview.plus/android/build.xml

-set-mode-check:

-set-release-mode:

-release-obfuscation-check: [echo] proguard.config is ${proguard.config}

-pre-build:

-check-env: [checkenv] Android SDK Tools Revision 23.0.2 [checkenv] Installed at /Users/chris/Development/adt-bundle/sdk

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

-build-setup: [getbuildtools] Using latest Build Tools: 20.0.0 [echo] Resolving Build Target for LudeiChromium... [gettarget] Project Target: Android 4.4.2 [gettarget] API level: 19 [echo] ---------- [echo] Creating output directories if needed... [mkdir] Created dir: /Users/chris/Work/test_project/development/cocoonjs/plugins/com.ludei.webview.plus/android/bin/rsObj [mkdir] Created dir: /Users/chris/Work/test_project/development/cocoonjs/plugins/com.ludei.webview.plus/android/bin/rsLibs [mkdir] Created dir: /Users/chris/Work/test_project/development/cocoonjs/plugins/com.ludei.webview.plus/android/bin/classes [mkdir] Created dir: /Users/chris/Work/test_project/development/cocoonjs/plugins/com.ludei.webview.plus/android/bin/dexedLibs [echo] ---------- [echo] Resolving Dependencies for LudeiChromium... [dependency] Library dependencies: [dependency] No Libraries [dependency] [dependency] ------------------ [echo] ---------- [echo] Building Libraries with 'release'... [subant] No sub-builds to iterate on

-code-gen: [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: /Users/chris/Work/test_project/development/cocoonjs/plugins/com.ludei.webview.plus/android/bin/res/crunch

BUILD FAILED /Users/chris/Development/adt-bundle/sdk/tools/ant/build.xml:653: The following error occurred while executing this line: /Users/chris/Development/adt-bundle/sdk/tools/ant/build.xml:698: null returned: 1

Can anyone help. Its driving me crazy.

Thanks in advance Chris

c-andrews commented 10 years ago

Ok after hours of searching and playing I have finally managed to sort out the compiling of WebView+ in my Cordova project. Anyone getting the error: "Unable to resolve project target 'Google Inc.:Google APIs:19'" make sure you have the whole of the Android SDK installed: SDK Platform, Google APIs (x86 System Image), Google APIs (ARM System Image).

I am now onto my next issue. The app compiles but when it is run on the device i just get a black screen. If i use Chrome to inspect the WebView I can see that everything has loaded but i get the following warning:

"Failed to execute 'write' on 'Document': It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened."

Can anyone help? Thanks, Chris

ludei commented 10 years ago

Hi Chris, Can you share the source code you're testing? That's strange, as we're not having any issue.

c-andrews commented 10 years ago

I managed to fix the black screen issue. For some reason I was forcing software rendering by having the below script in my main Java file:

super.appView.setLayerType(WebView.LAYER_TYPE_SOFTWARE, null);

I must have added it in the early day of development :-(.

So ready for my next issue :-) I have a Android phone running 4.3 this time i created a basic project from scratch not including any plugins. When i compile and run it on my device i get the following error on the device:

"Unfortunately, LudeiTest has stopped."

Here is the log from Eclipse:

09-17 17:23:58.582: E/ResourceType(22075): 0x4fda7968: Failed to ResTable::remove() cookie = 0x3, not last table. mHeaders.size() = 4. Warning for spontaneous crashes when the garbage collector runs. 09-17 17:23:58.582: E/asset(22075): Error removing runtime skin resource (cookie 0x3) 09-17 17:23:58.582: I/asset(22075): Problem removing all runtime skin resources 09-17 17:23:58.632: I/CordovaLog(22075): Changing log level to DEBUG(3) 09-17 17:23:58.632: I/CordovaLog(22075): Found start page location: index.html 09-17 17:23:58.632: D/Whitelist(22075): Unlimited access to network resources 09-17 17:23:58.632: D/CordovaActivity(22075): CordovaActivity.onCreate() 09-17 17:23:58.692: I/dalvikvm(22075): Could not find method org.apache.cordova.CordovaWebView.setWebContentsDebuggingEnabled, referenced from method org.apache.cordova.CordovaWebView.setup 09-17 17:23:58.692: W/dalvikvm(22075): VFY: unable to resolve static method 5347: Lorg/apache/cordova/CordovaWebView;.setWebContentsDebuggingEnabled (Z)V 09-17 17:23:58.692: D/dalvikvm(22075): VFY: replacing opcode 0x71 at 0x00ba 09-17 17:23:58.882: D/webcoreglue(22075): netstack: Memory Cache feature is OFF 09-17 17:23:59.012: D/JSENGINE(22075): qualcomm.jsengine.version:C.2-patch35-git:7b7ad6f 09-17 17:23:59.092: I/Ludei(22075): *** 09-17 17:23:59.102: I/Ludei(22075): Initializing Ludei WebView+ 09-17 17:23:59.102: I/Ludei(22075): ** 09-17 17:23:59.132: I/LibraryLoader(22075): Loading: LudeiChromium 09-17 17:23:59.132: D/dalvikvm(22075): Trying to load lib /data/app-lib/com.ludei.test-1/libLudeiChromium.so 0x41895980 09-17 17:23:59.212: D/dalvikvm(22075): Added shared lib /data/app-lib/com.ludei.test-1/libLudeiChromium.so 0x41895980 09-17 17:23:59.232: D/HostStatisticManager(22075): netstack: DNS Host Prioritization is: ON, Version: 5.0.2 09-17 17:23:59.232: I/(22075): netstack: LIB_MGR - Lib loaded: libdnshostprio.so 09-17 17:23:59.232: I/(22075): netstack: STAT_HUB - Succeeded to load plugin: libdnshostprio.so 09-17 17:23:59.242: I/LibraryLoader(22075): Time to load native libraries: 110 ms (timestamps 8645-8755) 09-17 17:23:59.242: I/LibraryLoader(22075): Expected native library version number "",actual native library version number "" 09-17 17:23:59.242: I/chromium(22075): [INFO:library_loader_hooks.cc(106)] Chromium logging enabled: level = 0, default verbosity = 0 09-17 17:23:59.242: I/(22075): netstack: LIB_MGR - Lib loaded: spl_proc_plugin.so 09-17 17:23:59.242: I/(22075): netstack: STAT_HUB - Succeeded to load plugin: spl_proc_plugin.so 09-17 17:23:59.242: I/(22075): netstack: LIB_MGR - Lib loaded: pp_proc_plugin.so 09-17 17:23:59.252: I/(22075): netstack: STAT_HUB - Succeeded to load plugin: pp_proc_plugin.so 09-17 17:23:59.252: E/(22075): netstack: STAT_HUB - App com.ludei.test isn't supported 09-17 17:23:59.322: I/BrowserStartupController(22075): Initializing chromium process, renderers=-2 09-17 17:24:00.492: I/ResourceExtractor(22075): Extracting resource content_shell.pak 09-17 17:24:00.622: I/ResourceExtractor(22075): Extracting resource icudtl.dat 09-17 17:24:01.282: E/chromium(22075): [22075:22236:0917/172401:5420798568:ERROR:address_tracker_linux.cc(138)] Could not bind NETLINK socket: Address already in use 09-17 17:24:01.322: D/CordovaWebView(22075): CordovaWebView is running on device made by: Sony 09-17 17:24:01.322: D/JsMessageQueue(22075): Set native->JS mode to 2 09-17 17:24:01.332: D/CordovaActivity(22075): CordovaActivity.init() 09-17 17:24:01.352: D/CordovaWebView(22075): >>> loadUrl(file:///android_asset/www/index.html) 09-17 17:24:01.352: D/PluginManager(22075): init() 09-17 17:24:01.362: D/CordovaWebView(22075): >>> loadUrlNow() 09-17 17:24:01.362: I/CordovaLog(22075): Changing log level to DEBUG(3) 09-17 17:24:01.362: I/CordovaLog(22075): Found start page location: index.html 09-17 17:24:01.362: D/Whitelist(22075): Unlimited access to network resources 09-17 17:24:01.362: D/CordovaActivity(22075): Resuming the App 09-17 17:24:01.362: D/CordovaActivity(22075): CB-3064: The errorUrl is null 09-17 17:24:01.392: D/SoftKeyboardDetect(22075): Ignore this event 09-17 17:24:01.422: D/libEGL(22075): loaded /vendor/lib/egl/libEGL_adreno.so 09-17 17:24:01.432: D/libEGL(22075): loaded /vendor/lib/egl/libGLESv1_CM_adreno.so 09-17 17:24:01.452: D/libEGL(22075): loaded /vendor/lib/egl/libGLESv2_adreno.so 09-17 17:24:01.452: I/Adreno-EGL(22075): : EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_JB_3.2_RB3.04.03.00.134.050_msm8610_JB_3.2_RB3__release_AU () 09-17 17:24:01.452: I/Adreno-EGL(22075): OpenGL ES Shader Compiler Version: 20.00.02 09-17 17:24:01.452: I/Adreno-EGL(22075): Build Date: 11/12/13 Tue 09-17 17:24:01.452: I/Adreno-EGL(22075): Local Branch: 09-17 17:24:01.452: I/Adreno-EGL(22075): Remote Branch: quic/jb_3.2_rb3.21 09-17 17:24:01.452: I/Adreno-EGL(22075): Local Patches: NONE 09-17 17:24:01.452: I/Adreno-EGL(22075): Reconstruct Branch: AU_LINUX_ANDROID_JB_3.2_RB3.04.03.00.134.050 + NOTHING 09-17 17:24:01.622: D/OpenGLRenderer(22075): Enabling debug mode 0 09-17 17:24:01.782: D/SoftKeyboardDetect(22075): Ignore this event 09-17 17:24:01.822: W/chromium(22075): [22075:22285:0917/172401:5421336150:WARNING:proxy_service.cc(904)] PAC support disabled because there is no system implementation 09-17 17:24:01.872: I/chromium(22075): [22075:22075:0917/172401:5421384892:INFO:shell_android.cc(81)] Ludei: creating webcontents... 09-17 17:24:01.872: I/chromium(22075): [22075:22075:0917/172401:5421386447:INFO:shell_android.cc(96)] Ludei: webcontents created. 09-17 17:24:01.882: D/SoftKeyboardDetect(22075): Ignore this event 09-17 17:24:01.962: W/chromium(22075): [22075:22075:0917/172401:5421472761:WARNING:webrtc_internals.cc(52)] Could not get the download directory. 09-17 17:24:01.972: A/libc(22075): Fatal signal 11 (SIGSEGV) at 0xfbadbeef (code=1), thread 22296 (Chrome_InProcRe) 09-17 17:24:01.982: A/chromium(22075): [22075:22299:0917/172401:5421494380:FATAL:thread_local_posix.cc(17)] Check failed: error == 0 (11 vs. 0) 09-17 17:24:01.982: A/libc(22075): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 22299 (JavaBridge) 09-17 17:24:02.012: D/SoftKeyboardDetect(22075): Ignore this event

Any ideas?

Here is a link to my Source: http://dev.c-andrews.co.uk/ludeiTest.zip