Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid Javascript Interface Fail
    primarykey
    data
    text
    <p>I am using Javascript Interface in my application.</p> <p>When i run Debug on my device(Galaxy 3) it run perfectly without any problem,but when i make a release apk file the JavaScript is probably not running.</p> <p>This is the <code>JavaScriptInterface</code> Class:</p> <pre><code>public class StreamingMediaPlayer{ public class JavaScriptInterface { Context mContext; JavaScriptInterface(Context c) { mContext = c; } @JavascriptInterface public void FinishExtract(String url) { } } } </code></pre> <p>Now i think it's because the proguard file:</p> <pre><code># To enable ProGuard in your project, edit project.properties # to define the proguard.config property as described in that file. # # Add project specific ProGuard rules here. # By default, the flags in this file are appended to flags specified # in ${sdk.dir}/tools/proguard/proguard-android.txt # You can edit the include path and order by changing the ProGuard # include property in project.properties. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html # Add any project specific keep options here: # If your project uses WebView with JS, uncomment the following # and specify the fully qualified class name to the JavaScript interface # class: #-keepclassmembers class fqcn.of.javascript.interface.for.webview { # public *; #} -dontwarn org.apache.commons.codec.binary.** -dontwarn com.commonsware.cwac.sacklist.** -dontwarn com.commonsware.cwac.tlv.** -dontwarn com.nineoldandroids.** -dontwarn com.apps.model.** -keep class com.millennialmedia.android.** {*;} -keep public class cmn.Proguard$KeepMembers -keep public class * implements cmn.Proguard$KeepMembers -keepclassmembers class * implements cmn.Proguard$KeepMembers { &lt;methods&gt;; } -keepattributes *Annotation* -dontwarn android.webkit.JavascriptInterface -keep class com.apps.model.** { *; } -keepattributes *Annotation* </code></pre> <p>Did i need to add something to the <code>proguard</code> File? Did the problem can be something else?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload