java.lang.NoSuchMethodError: no static method "Lorg/chromium/ui/base/ResourceBundle;.getLocalePakResourcePath(Ljava/lang/String;Z)Ljava/lang/String;"

518 views
Skip to first unread message

Avishek Nath

unread,
Jul 20, 2020, 3:24:26 AM7/20/20
to android-webview-dev
Hi,
 I have created a Android Standalone Chromium WebView library using chromium Java Code and "libstandalonelibwebviewchromium.so"("webview_instrumentation_apk"). When I am trying to run the the android application getting this error

"org.chromium W/System.err: java.lang.NoSuchMethodError: no static method "Lorg/chromium/ui/base/ResourceBundle;.getLocalePakResourcePath(Ljava/lang/String;Z)Ljava/lang/String;"

"org.chromium A/chromium: [FATAL:jni_android.cc(173)] Failed to find static method getLocalePakResourcePath (Ljava/lang/String;Z)Ljava/lang/String;"

Nate Fischer

unread,
Jul 20, 2020, 1:54:32 PM7/20/20
to Avishek Nath, android-webview-dev
Are you building system_webview_apk and calling android.webkit.* framework APIs in your app, or are you trying to bundle WebView (Java and C++) code directly into your app? We do not support the latter case.

Nate Fischer | Software Engineer | ntf...@google.com



--
You received this message because you are subscribed to the Google Groups "android-webview-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-webview...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/android-webview-dev/ec3f6591-fd72-4f26-b88b-e26df904b7fao%40chromium.org.

Avishek Nath

unread,
Jul 21, 2020, 6:40:41 AM7/21/20
to android-webview-dev, Nate Fischer, android-webview-dev, Avishek Nath
I am building  "webview_instrumentation_apk". I have taken Java code from the chromium github souce code and created my own Android application. I have also used gn and autoninja to build shared library(.SO file) and put it in jniLibs.  

Nate Fischer

unread,
Jul 21, 2020, 1:01:51 PM7/21/20
to Avishek Nath, android-webview-dev
We don't support using webview_instrumentation_apk from an application, sorry. We only support using system_webview_apk to implement the android.webkit.* framework APIs. If I've understood correctly, I don't think it's easy to support your use case.

I would recommend trying the supported path first (https://chromium.googlesource.com/chromium/src/+/HEAD/android_webview/docs/quick-start.md). Even if this isn't exactly what you're trying to achieve, being able to build this successfully would be a prerequisite for trying more advanced setups. If you have any questions about that document or the steps it outlines, the folks on this mailing list would be happy to help.
Nate Fischer | Software Engineer | ntf...@google.com


Avishek Nath

unread,
Jul 22, 2020, 6:56:25 AM7/22/20
to android-webview-dev, Nate Fischer, android-webview-dev, Avishek Nath
I have checked and confirmed that, when I generate a debug build by adding is_debug=true in the GN Command line configuration, generated .SO file methods are readable but when
is_debug=false  they are not readable. I have used nm -gD libstandalonelibwebviewchromium.so  to get the native shared library method list. 

Is there any way to stop native shared library(.SO file) from getting obfuscated when generating Chromium release build in android?

I have added the lists in the attachment... please help...
NativeMethodList-Official.txt
NativeMethodList-Debug.txt

Torne (Richard Coles)

unread,
Jul 22, 2020, 10:43:24 AM7/22/20
to Avishek Nath, android-webview-dev, Nate Fischer
Our build obfuscates the Java code and the native code names together such that they match each other (primarily to reduce binary size). If you are not building the Java code with our build system, it won't work.

It sounds like you're building our Java code using your app's own build system. This is unlikely to be easy to get to work - we do a lot of special and unusual things in our build. You'll almost certainly need to find a way to build the Chromium code using Chromium's build system; I'm not sure how you would then integrate that into your app. As we've mentioned, we don't support or recommend this. If you include Chromium code in your own app you'll need to update it every few weeks forever to keep up with security updates, amongst other things.

Allen Gu

unread,
Sep 27, 2020, 2:13:13 AM9/27/20
to android-webview-dev, to...@chromium.org, android-webview-dev, Nate Fischer, avina...@gmail.com
Any updates with this problem?    Whether the problem has been  solved and  completed?

whether we can build  webview_instrumentation_apk ,using chromium Java Code and "libstandalonelibwebviewchromium.so  in own build_system (aka android studio gradle)

As Toby  said, 
"This is unlikely to be easy to get to work - we do a lot of special and unusual things in our build. You'll almost certainly need to find a way to build the Chromium code using Chromium's build system; "

Allen Gu

unread,
Sep 28, 2020, 9:03:59 AM9/28/20
to android-webview-dev, Allen Gu, to...@chromium.org, android-webview-dev, Nate Fischer, avina...@gmail.com
I have build a apk outside of chromium build system, and it runs & display website ok。
 
I taken Java code from the chromium github souce code and created my own Android application. 
I  also used gn and autoninja to build all related stuff into a single aar, such as shared library(libstandalonelibwebviewchromium.so) ,and res,assets。

and then, I put the aar into my own android studio project, build a apk via gradle。



Avishek Nath

unread,
Nov 2, 2020, 12:39:44 AM11/2/20
to android-webview-dev, guhua...@gmail.com
Hi,
I have also able to create an AAR file containing the SO file and Java files in the Android Gradle build system. WebPages load fine but performance is not good. I have a particular need to draw waveforms using the embedded WebView but the performance is not good, the whole page lags.

Have you found any other way to tackle this problem? 

hu song

unread,
Jul 29, 2021, 4:43:32 AM7/29/21
to android-webview-dev, guhua...@gmail.com, to...@chromium.org, android-webview-dev
HI guhua
      You said "I  also used gn and autoninja to build all related stuff into a single aar, such as shared library(libstandalonelibwebviewchromium.so) ,and res,assets." Do you use "dist_aar" gn command to generate aar file?
Currently, I use "dist_aar" command to make a webview aar file and have some problems. 1."dist_aar" can't support assets (Integrator app can include webview aar's assets to solve this issue ) 2.aar file should have R.txt file to handle android resources. Follow chromium docs "A target-specific R.java is generated for each android_library() target that sets resources_package. Resource IDs are not known at this phase, so all values are set as placeholders." android_library just generates dummy resource ids, real resources ids are generated by apk build process. "dist_aar" command just merge all R.txt, not get correct ids. How to generate R.txt file which have correct resource IDs.Do you meet these problems, and how to solve them. Thanks!

John Dagdelen

unread,
Sep 28, 2023, 3:40:52 PM9/28/23
to android-webview-dev, hu song, guhua...@gmail.com

Hi Allen and Hu, 

I'm tying to build an app that packages a newer version of chromium webview as an AAR instead of an APK. Could you guys explain how you were able to do it? That would be a huge help and I'd even be willing to hire you as a contractor to help us with this.

Best regards,
John Dagdelen
Reply all
Reply to author
Forward
0 new messages