Hello,
I just checked out the latest tag in the chromium repo and something that was working previously now is giving me an assertion fail in a BUILD.gn. I cannot come up with a different solution and I was wondering if there is someone that could help me.
In the chromium webview BUILD.gn I am trying to add 3 .jar files I need. AFAIK, from the rules.gni file, the way to do it is using the template "android_java_prebuilt" and it worked just fine in previous version of chromium checkouts I have done, but is failing in the latest tag I have checked out (54.0.2796.3).
I am not going to copy the whole BUILD.gn but this is the extract that is giving me problems:
...
# GYP: //android_webview/android_webview_tests.gypi:android_webview_apk
android_apk("android_webview_apk") {
deps = [
":vrwebgl_zxing_jar",
":android_webview_apk_assets",
":android_webview_apk_resources",
"//android_webview:android_webview_java",
"//base:base_java",
"//base:base_java_test_support",
"//components/policy/android:policy_java_test_support",
"//content/public/android:content_java",
"//ui/android:ui_java",
]
...
android_java_prebuilt("vrwebgl_zxing_jar") {
jar_path = "shell/zxing-2.3.0/android-integration-2.3.0-supportv4.jar"
}
As you may see, the apk generation entry is referencing the jars I need to reference. Of course, these jars need to be included in the final APK too. This is the error I am getting:
ERROR at //build/config/android/internal_rules.gni:92:9: Assertion failed.
assert(false, "Invalid java target name: $_target_label")
^-----
Invalid java target name: //android_webview/test:vrwebgl_zxing_jar
See //build/config/android/internal_rules.gni:1676:5: whence it was called.
write_build_config(_build_config_target_name) {
^----------------------------------------------
See //build/config/android/rules.gni:1363:5: whence it was called.
java_prebuilt_impl(target_name) {
^--------------------------------
See //android_webview/test/BUILD.gn:340:1: whence it was called.
android_java_prebuilt("vrwebgl_zxing_jar") {
^-------------------------------------------
See //BUILD.gn:404:9: which caused the file to be included.
"//android_webview/test",
^-----------------------
From my understanding, the problem is that the names of the entries "android_java_prebuilt" is not correct. But, why is it working previously? I guess something has changed in ninja/gn?
Any help would be MUCH appreciated! Thanks in advance for you time!
Iker.