Closed Pyreweb closed 9 years ago
Hi there, I think that test app is fairly outdated.. To use the WebView in an Alloy project:
<WebView id="webView" platform="ios" />
<WebView id="webView" platform="android" module="com.universalavenue.ticrosswalk" />
Otherwise just call the createWebView([props])
method on the module (when on Android) and use the evalAsync(code, [callback])
method to access the WebView JS context.
On iOS the module simply extends the existing WebView, meaning you can use the same APIs as on Android.
Cheers!
I've added a simple usage section to the README now. If you'd like to fix up the test app as well, feel free to do so! I love pull requests. :smile:
Oh, that's better and far easier :) I may look into updating the example app (if I can make mine work, priorities ;)), it'll help !
Still, not working directly, that'll be too easy
[DEBUG] TiCrosswalk: (main) [1543,50050] [VIEW LIFECYCLE EVENT] view, on ui thread: true
[DEBUG] TiCrosswalk: (main) [5,50055] Activity: org.appcelerator.titanium.TiActivity@4116cdc8, context:com.pyreweb.exostim.ExostimApplication@40cea148
[INFO] dalvikvm: Jit: resizing JitTable from 4096 to 8192
[INFO] LibraryLoader: Expected native library version number "",actual native library version number ""
[INFO] chromium: [INFO:library_loader_hooks.cc(104)] Chromium logging enabled: level = 0, default verbosity = 0
[DEBUG] dalvikvm: GREF has increased to 301
[INFO] BrowserStartupController: Initializing chromium process, singleProcess=true
[INFO] ResourceExtractor: Extracting resource icudtl.dat
[INFO] ResourceExtractor: Extracting resource xwalk.pak
[ERROR] dalvikvm: Could not find class 'android.bluetooth.BluetoothManager', referenced from method org.chromium.media.AudioManagerAndroid.hasBluetoothHeadset
[WARN] dalvikvm: VFY: unable to resolve check-cast 55 (Landroid/bluetooth/BluetoothManager;) in Lorg/chromium/media/AudioManagerAndroid;
[DEBUG] dalvikvm: VFY: replacing opcode 0x1f at 0x001d
[WARN] AudioManagerAndroid: Requires BLUETOOTH permission
[WARN] chromium: [WARNING:proxy_service.cc(909)] PAC support disabled because there is no system implementation
[WARN] BuiltinXWalkExtension: Failed to read JS API file: jsapi/presentation_api.js
[WARN] BuiltinXWalkExtension: Failed to read JS API file: jsapi/launch_screen_api.js
[WARN] BuiltinXWalkExtension: Failed to read JS API file: jsapi/contacts_api.js
[WARN] BuiltinXWalkExtension: Failed to read JS API file: jsapi/device_capabilities_api.js
[WARN] BuiltinXWalkExtension: Failed to read JS API file: jsapi/messaging_api.js
[DEBUG] TiCrosswalk: (main) [4030,54085] WebView created with props: {"id":"viewAct","enabled":true,"visible":true,"backgroundColor":"#333","backgroundRepeat":false}
[DEBUG] Window: Checkpoint: postWindowCreated()
[DEBUG] dalvikvm: --- called into dvmAbstractMethodStub
[ERROR] TiBaseActivity: (main) [107,54192] Error dispatching lifecycle event: abstract method not implemented
[ERROR] TiBaseActivity: java.lang.AbstractMethodError: abstract method not implemented
[ERROR] TiBaseActivity: at com.universalavenue.ticrosswalk.WebView.onCreate(WebView.java)
[ERROR] TiBaseActivity: at org.appcelerator.titanium.TiLifecycle.fireLifecycleEvent(TiLifecycle.java:160)
[ERROR] TiBaseActivity: at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:563)
[ERROR] TiBaseActivity: at org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:18)
[ERROR] TiBaseActivity: at android.app.Activity.performCreate(Activity.java:5104)
[ERROR] TiBaseActivity: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
[ERROR] TiBaseActivity: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
[ERROR] TiBaseActivity: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
[ERROR] TiBaseActivity: at android.app.ActivityThread.access$600(ActivityThread.java:141)
[ERROR] TiBaseActivity: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
[ERROR] TiBaseActivity: at android.os.Handler.dispatchMessage(Handler.java:99)
[ERROR] TiBaseActivity: at android.os.Looper.loop(Looper.java:137)
[ERROR] TiBaseActivity: at android.app.ActivityThread.main(ActivityThread.java:5041)
[ERROR] TiBaseActivity: at java.lang.reflect.Method.invokeNative(Native Method)
[ERROR] TiBaseActivity: at java.lang.reflect.Method.invoke(Method.java:511)
[ERROR] TiBaseActivity: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
[ERROR] TiBaseActivity: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
[ERROR] TiBaseActivity: at dalvik.system.NativeStart.main(Native Method)
[INFO] TiCrosswalk: (main) [31,54223] onStart
[INFO] TiCrosswalk: (main) [40,54263] onResume
[INFO] TiCrosswalk: (main) [0,54263] onResume view found
[WARN] EGL_emulation: eglSurfaceAttrib not implemented
[DEBUG] D/ : HostConnection::get() New Host Connection established 0x2a4fc2c8, tid 1109
[ERROR] EGL_emulation: eglQuerySurface 30be EGL_BAD_ATTRIBUTE
[ERROR] chromium: [ERROR:buffer_manager.cc(313)] [.BrowserCompositor-0x2a4fb7e0]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
[WARN] EGL_emulation: eglSurfaceAttrib not implemented
[DEBUG] TiCrosswalk: (main) [1968,56231] Loading new url: app://activites/activite.html
[INFO] chromium: [INFO:xwalk_extension_renderer_controller.cc(47)] EXTENSION PROCESS DISABLED.
[DEBUG] WebViewResourceClient: (main) [3185,59416] WebView finished loading url: app://activites/activite.html
And still a blank and black screen.
And those in particular bugs me :
[WARN] BuiltinXWalkExtension: Failed to read JS API file: jsapi/presentation_api.js
[WARN] BuiltinXWalkExtension: Failed to read JS API file: jsapi/launch_screen_api.js
[WARN] BuiltinXWalkExtension: Failed to read JS API file: jsapi/contacts_api.js
[WARN] BuiltinXWalkExtension: Failed to read JS API file: jsapi/device_capabilities_api.js
[WARN] BuiltinXWalkExtension: Failed to read JS API file: jsapi/messaging_api.js
That's normal ?
The BuiltinXWalkExtension
warnings are "normal", or at least I get them too. The real issue seems to be that onCreate
lifecycle method is not implemented, a bit further up in the log. What's even more interesting is that I am not getting that error.
Have you tried using the module on an actual device? Implementing a dummy onCreate method (like onStop) might also be a potential fix.
@Pyreweb Here's a custom build with a dummy onCreate
method:
http://we.tl/ofzy4SofiB
No, I'm using a simulator/emulator actually. Configuration is Android 4.2.2 (Google API's image on ARM), API Level 17.
I'll look on a real device whenever I can.
Ok. Feel free to try the bulid I linked to above. It might fix things for you on the emulator.
Your build indeed fixed the lifecycle bug.
The original issue is now closed ! :smile:
Hello,
I just copy-pasted parts of the example app (TiCrosswalk/xwtest/app/controllers/index.js) in mine, and it doesn't work well;
On my Jelly Bean emulator, the output is :
If I comment the test.example() call, the output is :
That's the basics; After, I have this, still from the example :
Which gave :
And the webview is blank, and black.
I installed the module via Gittio only, it may had an impact ?