ks32 / CrosswalkNative

Embedded Crosswalk 77 webview based sample project.
96 stars 43 forks source link

Crosswalk cordova integration error #1

Closed farafonov-alexey closed 6 years ago

farafonov-alexey commented 6 years ago

I successfully build your xwalk_core_library_58.aar with cordova, however when the app starting the roor occured

 Caused by: java.lang.NoSuchMethodException: getAssignedPackageIdentifiers []
     at java.lang.Class.getConstructorOrMethod(Class.java:472)
     at java.lang.Class.getMethod(Class.java:857)
     at org.xwalk.core.internal.XWalkViewDelegate.<clinit>(XWalkViewDelegate.java:69)
     at java.lang.reflect.Method.invokeNative(Native Method) 
     at java.lang.reflect.Method.invoke(Method.java:515) 
     at org.xwalk.core.ReflectMethod.invoke(ReflectMethod.java:61) 
     at org.xwalk.core.XWalkCoreWrapper.checkCoreArchitecture(XWalkCoreWrapper.java:349) 
     at org.xwalk.core.XWalkCoreWrapper.findEmbeddedCore(XWalkCoreWrapper.java:248) 
     at org.xwalk.core.XWalkCoreWrapper.attachXWalkCore(XWalkCoreWrapper.java:162) 
     at org.xwalk.core.XWalkLibraryLoader$ActivateTask.doInBackground(XWalkLibraryLoader.java:335) 
     at org.xwalk.core.XWalkLibraryLoader$ActivateTask.doInBackground(XWalkLibraryLoader.java:317) 
     at android.os.AsyncTask$2.call(AsyncTask.java:288) 
     at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) 

I' tried to search method getAssignedPackageIdentifiers at tenta-browser's XWalkViewDelegate.java - https://github.com/tenta-browser/crosswalk/blob/master/runtime/android/core_internal/src/org/xwalk/core/internal/XWalkViewDelegate.java But this entire method doesn't exsists. Do you have any workaround? Maybe I need to recompile xwalk_core_library.jar somehow.

farafonov-alexey commented 6 years ago

I see it was intetionally added here - https://github.com/ks32/crosswalk/commit/2fc4bc5cff9f9386793b9a26d5879308a2744f9b#diff-32a8c099ccb75ea20046fd6c07ff5a8fR69, but the usage of getPackageId method is commented out - https://github.com/ks32/crosswalk/commit/2fc4bc5cff9f9386793b9a26d5879308a2744f9b#diff-32a8c099ccb75ea20046fd6c07ff5a8fR170

ks32 commented 6 years ago

You can rebuild crosswalk. Use docker image https://hub.docker.com/r/ks32/crosswalk-build-tools It has all tools and just ready for building.

farafonov-alexey commented 6 years ago

So i've succefully started the container and followed by instruction fetched the source with gclient sync.

ks32 commented 6 years ago

I am using following args: gn args out/Default_arm import("//xwalk/build/android.gni") is_debug = false target_os = "android" enable_nacl = false symbol_level = 0 remove_webcore_debug_symbols = true target_cpu = "arm" use_aura=false use_ozone=false enable_plugins=false disable_bundled_extensions=true ffmpeg_branding = "Chrome" #disable to reduce size proprietary_codecs=true #disable to reduce size v8_use_snapshot=true enable_webrtc=false #disable to reduce size pdf_enable_v8=false multidex_in_release=true is_official_build=true v8_enable_i18n_support=false disable_ftp_support=true disable_libfuzzer=true enable_basic_print_dialog=false

ninja -C out/Default_arm xwalk_core_library It should work. You can change arguments if you want.

farafonov-alexey commented 6 years ago

Thank you, @ks32 I've successfully build xwalk_core_library with your parameters. Is there any param to enable Web Sql support?

ks32 commented 6 years ago

check arguments for what you are looking for: gn args out/Default_arm --list

farafonov-alexey commented 6 years ago

Well it seems that websql is turned on by default, but using it lead to error:

there was not enough remaining storage space, or the storage quota was reached and the user declined to allow more space

image

Maybe xwalk source code needs changing? I see tenta-browser has some encryptedSql, maybe that's somehow related with this error. @ks32

UPD: I'm observing strange WebSql behavior:

PS: insert commands in cache3 table works just fine

ks32 commented 6 years ago

tenta encryptedSql is closed repo. So that I have to remove it and also references to it in the code. It maybe the cause for this problem.

farafonov-alexey commented 6 years ago

Well I've successfully integrated this xwalk_core_library to our Cordova project at last. We switched from WebSql to https://github.com/litehelpers/Cordova-sqlite-storage.git plugin.

One more thing. I see in tenta-browser/crosswalk repository there are branches - chromium_59 and chromium_64. According to your comment this chromium versions could be used too.

Is there any chance that you can remove your private libraries from these branches too? Or is there some kind of instruction with help of which I can do it myself?

ks32 commented 6 years ago

First, I am not link to tenta nor do know what they do. Regarding chromium_64, I can work on it after 2-3 months because of my current work.

It is not difficult to remove private libraries. If you look at ks_chromium_58, there are not many changes with chromium_58. You just need to apply similar changes to chromium_64 to make it work.

martinlombana commented 5 years ago

Did anyone make it work with chromium_64?

Does anyone has an .aar to share or instructions? Thanks :)