Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manual installation - crash at launch #23

Open
jrouault opened this issue Aug 21, 2014 · 5 comments
Open

Manual installation - crash at launch #23

jrouault opened this issue Aug 21, 2014 · 5 comments

Comments

@jrouault
Copy link

Cordova version: 3.5.0-0.2.7
Webview+: 2.2.0
Device: Samsung Galaxy Tab 2 (7.0) GT-P3110, Android 4.1.2

Hi, I tried to installed manually the latest version of Webview+ but without success.
I simply created a Cordova project, followed the Readme and ended up with this exception at startup:

FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: com.ludei.chromium.R$attr
    at com.ludei.chromium.ResourceProvider.registerResources(ResourceProvider.java:16)
    at com.ludei.chromium.LudeiContentView.initialize(LudeiContentView.java:393)
    at com.ludei.chromium.LudeiContentView.<init>(LudeiContentView.java:55)
    at com.ludei.chromium.LudeiContentView.<init>(LudeiContentView.java:48)
    at com.ludei.chromium.LudeiWebView.<init>(LudeiWebView.java:40)
    at com.ludei.chromium.LudeiWebView.<init>(LudeiWebView.java:27)
    at com.ludei.chromium.LudeiWebView.<init>(LudeiWebView.java:22)
    at com.ludei.chromium.LudeiWebView.<init>(LudeiWebView.java:17)
    at org.apache.cordova.CordovaWebView.<init>(CordovaWebView.java:138)
    at org.apache.cordova.CordovaActivity.makeWebView(CordovaActivity.java:272)
    at org.apache.cordova.CordovaActivity.init(CordovaActivity.java:307)
    at com.example.testwebviewplus.testwebviewplus.onCreate(testwebviewplus.java:31)
    at android.app.Activity.performCreate(Activity.java:5163)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2061)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2122)
    at android.app.ActivityThread.access$600(ActivityThread.java:140)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1228)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4895)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
    at dalvik.system.NativeStart.main(Native Method)

Here is a simple bash to execute in an empty folder, tested on OSX 10.9.4, to reproduce the test:

npm install cordova
./node_modules/cordova/bin/cordova create testwebviewplus com.example.testwebviewplus testwebviewplus
cd testwebviewplus/
./../node_modules/cordova/bin/cordova platform add android
cd ../
git clone https://github.com/ludei/webview-plus.git
sed -i -e 's/^public class CordovaWebView extends WebView.*/import com.ludei.chromium.LudeiWebView;\'$'\npublic class CordovaWebView extends LudeiWebView {/' ./testwebviewplus/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebView.java
grep -q 'android.library.reference.1=' ./testwebviewplus/platforms/android/CordovaLib/project.properties && sed -i -e 's/^android\.library\.reference\.1=.*/android.library.reference.1=..\/..\/..\/..\/webview-plus\/android/' ./testwebviewplus/platforms/android/CordovaLib/project.properties || sed -i -e '$ a\'$'\n''android.library.reference.1=..\/..\/..\/..\/webview-plus\/android' ./testwebviewplus/platforms/android/CordovaLib/project.properties
cd testwebviewplus/
./../node_modules/cordova/bin/cordova run

Any hints?

@agamemnus
Copy link

Check out #10.

@ludei
Copy link
Collaborator

ludei commented Sep 4, 2014

@jrouault did you fix your problem with the solution proposed by @agamemnus ?

@jrouault
Copy link
Author

jrouault commented Sep 5, 2014

Unfortunately, neither @agamemnus or @vecernik solutions seem to fix this. However I could make it work adding it as a Cordova plugin and building with ADT/Eclipse (steps are specified in #20).
Not sure if it's worth mentioning but I'm not using CocoonJS in this case.

@severedsea
Copy link

@jrouault Do an "ant clean" then "ant release" on the WebView+ project (whereever your project.properties is referencing e.g. plugins/com.ludei.webview.plus/android). This worked for me.

@mike1808
Copy link

@severedsea thank you. That worked for me too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants