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

Class not found exception when using LiquidCoreAndroid with proguard #20

Closed
martinspaeth opened this issue Mar 29, 2017 · 3 comments
Closed
Labels

Comments

@martinspaeth
Copy link

Hi there,

When using the LiquidCore lib while proguard is activated will fail.

To solve one just need to add a simple proguard keep rule:
-keep class org.liquidplayer.javascript.** { *; }

May this could be part of the Library itself

Sample stacktrace for one running into the same issue:
03-29 11:13:15.861 6806-6828/packagename.of.the.app A/art: art/runtime/runtime.cc:427] JNI DETECTED ERROR IN APPLICATION: JNI GetMethodID called with pending exception java.lang.ClassNotFoundException: Didn't find class "org.liquidplayer.javascript.JSValue$JNIReturnObject" on path: DexPathList[[zip file "/data/app/packagename.of.the.app-2/base.apk"],nativeLibraryDirectories=[/data/app/packagename.of.the.app-2/lib/x86, /data/app/packagename.of.the.app-2/base.apk!/lib/x86, /system/lib, /vendor/lib]] 03-29 11:13:15.861 6806-6828/packagename.of.the.app A/art: art/runtime/runtime.cc:427] at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56) 03-29 11:13:15.861 6806-6828/packagename.of.the.app A/art: art/runtime/runtime.cc:427] at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:380) 03-29 11:13:15.861 6806-6828/packagename.of.the.app A/art: art/runtime/runtime.cc:427] at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312) 03-29 11:13:15.861 6806-6828/packagename.of.the.app A/art: art/runtime/runtime.cc:427] at org.liquidplayer.javascript.JSValue$b org.liquidplayer.javascript.JSObject.setProperty(long, long, java.lang.String, long, int) (JSObject.java:-2) 03-29 11:13:15.861 6806-6828/packagename.of.the.app A/art: art/runtime/runtime.cc:427] at void org.liquidplayer.javascript.JSObject$5.run() (JSObject.java:337) 03-29 11:13:15.861 6806-6828/packagename.of.the.app A/art: art/runtime/runtime.cc:427] at void org.liquidplayer.javascript.JSContext.a(java.lang.Runnable) (JSContext.java:66) 03-29 11:13:15.861 6806-6828/packagename.of.the.app A/art: art/runtime/runtime.cc:427] at void org.liquidplayer.javascript.JSObject.a(java.lang.String, java.lang.Object, int) (JSObject.java:345) 03-29 11:13:15.861 6806-6828/packagename.of.the.app A/art: art/runtime/runtime.cc:427] at void org.liquidplayer.javascript.JSObject.a(java.lang.String, java.lang.Object) (JSObject.java:360) 03-29 11:13:15.861 6806-6828/packagename.of.the.app A/art: art/runtime/runtime.cc:427] at void packagename.of.the.app.wrapper.a.c.<init>(android.content.Context) (RiveScriptWrapper.java:51) 03-29 11:13:15.861 6806-6828/packagename.of.the.app A/art: art/runtime/runtime.cc:427] at void packagename.of.the.app.wrapper.d.<init>(android.content.Context) (Wrapper.java:20) 03-29 11:13:15.861 6806-6828/packagename.of.the.app A/art: art/runtime/runtime.cc:427] at java.lang.Integer packagename.of.the.app.wrapper.d.b.d$a.a(java.net.URL[]) (SampleClass.java:384) 03-29 11:13:15.861 6806-6828/packagename.of.the.app A/art: art/runtime/runtime.cc:427] at java.lang.Object packagename.of.the.app..b.d$a.doInBackground(java.lang.Object[]) (AFragment.java:375) 03-29 11:13:15.861 6806-6828/packagename.of.the.app A/art: art/runtime/runtime.cc:427] at java.lang.Object android.os.AsyncTask$2.call() (AsyncTask.java:305) 03-29 11:13:15.861 6806-6828/packagename.of.the.app A/art: art/runtime/runtime.cc:427] at void java.util.concurrent.FutureTask.run() (FutureTask.java:237) 03-29 11:13:15.861 6806-6828/packagename.of.the.app A/art: art/runtime/runtime.cc:427] at void android.os.AsyncTask$SerialExecutor$1.run() (AsyncTask.java:243) 03-29 11:13:15.861 6806-6828/packagename.of.the.app A/art: art/runtime/runtime.cc:427] at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1133) 03-29 11:13:15.861 6806-6828/packagename.of.the.app A/art: art/runtime/runtime.cc:427] at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:607) 03-29 11:13:15.861 6806-6828/packagename.of.the.app A/art: art/runtime/runtime.cc:427] at void java.lang.Thread.run() (Thread.java:761) 03-29 11:13:15.861 6806-6828/packagename.of.the.app A/art: art/runtime/runtime.cc:427]

@martinspaeth martinspaeth changed the title Class not found exception when using Lib with proguard Class not found exception when using LiquidCoreAndroid with proguard Mar 29, 2017
@ericwlange ericwlange added the bug label Mar 30, 2017
@ericwlange
Copy link
Member

Thanks for reporting. I will add a proguard rules file to the library.

ericwlange added a commit that referenced this issue Apr 8, 2017
@ericwlange
Copy link
Member

Should be fixed in 70e9a7f0556886463ffe2d35ec4d6afb60149c02

@ericwlange
Copy link
Member

This is fixed in Release 0.2.2

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

No branches or pull requests

2 participants