Try removing the suffix in debug mode.
Also, make sure that in the proguard rules you have
-keepclassmembers class **.R$* {public static <fields>;} -keep class **.R$*
EDIT: After finding out the problem (suffix of the debug package ".debug"), try downloading the file as follows:
String path = "android.resource://" + getPackageName() + "/" + R.raw.my_web_file; Uri myFileUri = Uri.parse(path); File file = new File(myFileUri.toString()); webview.loadUrl(file.getAbsolutePath());
2nd EDIT: If this still does not work (although it works for me), try this: upload the file to webview using the input stream.
String prompt = ""; try { InputStream inputStream = getResources().openRawResource(R.raw.my_web_file); byte[] buffer = new byte[inputStream.available()]; inputStream.read(buffer); prompt = new String(buffer); inputStream.close(); } catch (IOException e) { e.printStackTrace(); } webview.loadData(prompt,"text/html","utf-8");
DDsix Feb 26 '16 at 8:43 2016-02-26 08:43
source share