VR Error while builidng ChromePublic APK on ToT !

298 views
Skip to first unread message

Sohan

unread,
Jun 20, 2017, 9:18:16 AM6/20/17
to Chromium-dev
Hi,

I am getting the following error while building (linking) ChromePublic APK on ToT !
MAJOR=61
MINOR=0
BUILD=3137
PATCH=0

8991/9038] SOLINK ./libchrome.cr.so
FAILED: libchrome.cr.so libchrome.cr.so.TOC lib.unstripped/libchrome.cr.so 
python "../../build/toolchain/gcc_solink_wrapper.py" --readelf="../../third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-readelf" --nm="../../third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-nm" --strip=../../third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-strip --sofile="./lib.unstripped/libchrome.cr.so" --tocfile="./libchrome.cr.so.TOC" --output="./libchrome.cr.so"  -- ../../third_party/llvm-build/Release+Asserts/bin/clang++ -shared -Wl,--fatal-warnings -fPIC -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro -Wl,-z,defs -Wl,--as-needed --gcc-toolchain=../../third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 -fuse-ld=gold -Wl,--icf=all -Wl,--no-undefined -Wl,--exclude-libs=libgcc.a -Wl,--exclude-libs=libc++_static.a -Wl,--exclude-libs=libvpx_assembly_arm.a --target=arm-linux-androideabi -Werror -nostdlib -Wl,--warn-shared-textrel --sysroot=../../third_party/android_tools/ndk/platforms/android-16/arch-arm -Wl,--version-script=/home/sohan/Chrome_Android/src/build/android/android_only_explicit_jni_exports.lst -Wl,-wrap,calloc -Wl,-wrap,free -Wl,-wrap,malloc -Wl,-wrap,memalign -Wl,-wrap,posix_memalign -Wl,-wrap,pvalloc -Wl,-wrap,realloc -Wl,-wrap,valloc -L../../third_party/android_tools/ndk/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a -o "./lib.unstripped/libchrome.cr.so" -Wl,-soname="libchrome.cr.so" @"./libchrome.cr.so.rsp"
obj/chrome/browser/libbrowser.a(chrome_jni_registrar.o):../../chrome/browser/android/chrome_jni_registrar.cc:GvrApi::kMethodsGvrApi: error: undefined reference to 'Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportSetExternalSurface'
obj/chrome/browser/libbrowser.a(chrome_jni_registrar.o):../../chrome/browser/android/chrome_jni_registrar.cc:GvrApi::kMethodsGvrApi: error: undefined reference to 'Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportSetSourceLayer'
obj/chrome/browser/libbrowser.a(chrome_jni_registrar.o):../../chrome/browser/android/chrome_jni_registrar.cc:GvrApi::kMethodsGvrApi: error: undefined reference to 'Java_com_google_vr_ndk_base_GvrApi_nativeBufferSpecSetMultiviewLayers'
obj/chrome/browser/libbrowser.a(chrome_jni_registrar.o):../../chrome/browser/android/chrome_jni_registrar.cc:GvrApi::kMethodsGvrApi: error: undefined reference to 'Java_com_google_vr_ndk_base_GvrApi_nativeExternalSurfaceCreateWithListeners'
obj/chrome/browser/libbrowser.a(chrome_jni_registrar.o):../../chrome/browser/android/chrome_jni_registrar.cc:GvrApi::kMethodsGvrApi: error: undefined reference to 'Java_com_google_vr_ndk_base_GvrApi_nativeExternalSurfaceDestroy'
obj/chrome/browser/libbrowser.a(chrome_jni_registrar.o):../../chrome/browser/android/chrome_jni_registrar.cc:GvrApi::kMethodsGvrApi: error: undefined reference to 'Java_com_google_vr_ndk_base_GvrApi_nativeExternalSurfaceGetId'
obj/chrome/browser/libbrowser.a(chrome_jni_registrar.o):../../chrome/browser/android/chrome_jni_registrar.cc:GvrApi::kMethodsGvrApi: error: undefined reference to 'Java_com_google_vr_ndk_base_GvrApi_nativeExternalSurfaceGetSurface'
obj/chrome/browser/libbrowser.a(chrome_jni_registrar.o):../../chrome/browser/android/chrome_jni_registrar.cc:GvrApi::kMethodsGvrApi: error: undefined reference to 'Java_com_google_vr_ndk_base_GvrApi_nativeUsingDynamicLibrary'
obj/chrome/browser/libbrowser.a(chrome_jni_registrar.o):../../chrome/browser/android/chrome_jni_registrar.cc:GvrApi::kMethodsGvrApi: error: undefined reference to 'Java_com_google_vr_ndk_base_GvrApi_nativeSetApplicationState'
obj/chrome/browser/libbrowser.a(chrome_jni_registrar.o):../../chrome/browser/android/chrome_jni_registrar.cc:GvrApi::kMethodsGvrApi: error: undefined reference to 'Java_com_google_vr_ndk_base_GvrApi_nativeSetDynamicLibraryLoadingEnabled'
obj/chrome/browser/libbrowser.a(chrome_jni_registrar.o):../../chrome/browser/android/chrome_jni_registrar.cc:GvrApi::kMethodsGvrApi: error: undefined reference to 'Java_com_google_vr_ndk_base_GvrApi_nativeRequestContextSharing'
obj/chrome/browser/libbrowser.a(chrome_jni_registrar.o):../../chrome/browser/android/chrome_jni_registrar.cc:GvrApi::kMethodsGvrApi: error: undefined reference to 'Java_com_google_vr_ndk_base_GvrApi_nativeOnSurfaceChangedReprojectionThread'
obj/chrome/browser/libbrowser.a(chrome_jni_registrar.o):../../chrome/browser/android/chrome_jni_registrar.cc:GvrApi::kMethodsGvrApi: error: undefined reference to 'Java_com_google_vr_ndk_base_GvrApi_nativePauseTrackingGetState'
obj/chrome/browser/libbrowser.a(chrome_jni_registrar.o):../../chrome/browser/android/chrome_jni_registrar.cc:GvrApi::kMethodsGvrApi: error: undefined reference to 'Java_com_google_vr_ndk_base_GvrApi_nativeResumeTrackingSetState'
obj/chrome/browser/libbrowser.a(chrome_jni_registrar.o):../../chrome/browser/android/chrome_jni_registrar.cc:GvrApi::kMethodsGvrApi: error: undefined reference to 'Java_com_google_vr_ndk_base_GvrApi_nativeIsFeatureSupported'
obj/chrome/browser/libbrowser.a(chrome_jni_registrar.o):../../chrome/browser/android/chrome_jni_registrar.cc:GvrApi::kMethodsGvrApi: error: undefined reference to 'Java_com_google_vr_ndk_base_GvrApi_nativeSetIdleListener'
obj/chrome/browser/libbrowser.a(chrome_jni_registrar.o):../../chrome/browser/android/chrome_jni_registrar.cc:NativeCallbacks::kMethodsNativeCallbacks: error: undefined reference to 'Java_com_google_vr_internal_controller_NativeCallbacks_handlePositionEvent'
obj/chrome/browser/libbrowser.a(chrome_jni_registrar.o):../../chrome/browser/android/chrome_jni_registrar.cc:NativeCallbacks::kMethodsNativeCallbacks: error: undefined reference to 'Java_com_google_vr_internal_controller_NativeCallbacks_handleBatteryEvent'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

Looks like some Java VR deps,

I tried adding "is_java_debug = true" but it didn't help. 
My gn args are,
target_os = "android"
target_cpu = "arm"  # (default)
is_debug = true  # (default)

# Other args you may want to set:
is_component_build = true
is_clang = true
symbol_level = 1  # Faster build with fewer symbols. -g1 rather than -g2
enable_incremental_javac = true  # Much faster; experimental
is_java_debug = true

I tried disabling the enable_incremental_javac, but it doesnt solve.

I tried re-running gclient runhooks and installing build deps, but the error persists.

Any pointers ?

Thanks,
Sohan

Biao She

unread,
Jun 20, 2017, 2:40:13 PM6/20/17
to soh...@chromium.org, Chromium-dev
Investigating it now. It is probably my mistake. Java_com_google_vr_ndk_base_GvrApi_nativeBufferViewportSetExternalSurface was never used and we probably shouldn't register it in jni.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/208697b7-f504-428d-b395-68bfa1a8d03f%40chromium.org.

Biao She

unread,
Jun 20, 2017, 3:14:47 PM6/20/17
to Chromium-dev, soh...@chromium.org
Actually, I read the error message wrong. nativeBufferViewportSetExternalSurface is indeed used. I though it is another function with similar name.

Do you see any error message when you run "gclient runhooks"? It should download a new version of third_party/gvr-android-sdk/libgvr_shim_static_arm.a. The error messages suggest that you stuck with an older version of the library.

One way to check if you have correct library is to run "shasum third_party/gvr-android-sdk/libgvr_shim_static_arm.a" and check if the hash code is the same as your third_party/gvr-android-sdk/libgvr_shim_static_arm.a.sha1
And it should be a951bb4b47a6a250c2705cec4a772b606d1b39ae

Sohan

unread,
Jun 20, 2017, 3:32:17 PM6/20/17
to Chromium-dev, soh...@chromium.org
Thanks for checking. Though i didnt find the runhooks error, but i will re-check.
Yes, you are right, they do not match.

shasum third_party/gvr-android-sdk/libgvr_shim_static_arm.a
a65b912586f1292188c42774d8b93534c6eda3a1  third_party/gvr-android-sdk/libgvr_shim_static_arm.a

while third_party/gvr-android-sdk/libgvr_shim_static_arm.a.sha1 is a951bb4b47a6a250c2705cec4a772b606d1b39ae

Thanks,
Sohan

Biao She

unread,
Jun 21, 2017, 9:41:16 AM6/21/17
to Chromium-dev, soh...@chromium.org
That's odd. gclient runhooks should download the library according to the value in .sha1 value.

Sohan

unread,
Jun 21, 2017, 3:36:53 PM6/21/17
to Chromium-dev, soh...@chromium.org
Yeah..something strange happening to the gclient sync off late.

So, to ensure i get the right version of the libgvr code, i deleted the third_party/gvr-android-sdk, and ran gclient sync. But now, the third_party/gvr-android-sdk only had src/ and no other files. Strange :/
After mutiple failures, I decided to delete my entire chromium src/ and run a fresh "fetch --nohooks android", install build deps, ran runhooks (https://chromium.googlesource.com/chromium/src/+/master/docs/android_build_instructions.md )

But, now i have a different error, on running gn gen args, i get

sohan@heBrick ~/Chrome_Android/src ((detached from origin/master)) $ gn gen --args='target_os="android"' out/Default
ERROR at //build/config/android/rules.gni:2808:9: Script returned non-zero exit code.
        exec_script("//build/android/gyp/aar.py",
        ^----------
Current dir: /home/sohan/Chrome_Android/src/out/Default/
Command: python -- /home/sohan/Chrome_Android/src/build/android/gyp/aar.py --input-file ../../third_party/android_support_test_runner/lib/rules-0.5.aar --list
Returned 1.
stderr:

Traceback (most recent call last):
  File "/home/sohan/Chrome_Android/src/build/android/gyp/aar.py", line 114, in <module>
    sys.exit(main())
  File "/home/sohan/Chrome_Android/src/build/android/gyp/aar.py", line 81, in main
    with zipfile.ZipFile(aar_file) as z:
  File "/usr/lib/python2.7/zipfile.py", line 756, in __init__
    self.fp = open(file, modeDict[mode])
IOError: [Errno 2] No such file or directory: '../../third_party/android_support_test_runner/lib/rules-0.5.aar'

See //third_party/android_support_test_runner/BUILD.gn:21:1: whence it was called.
android_aar_prebuilt("rules_java") {
^-----------------------------------
See //build/config/android/internal_rules.gni:122:23: which caused the file to be included.
            deps += [ "${_target_label}__build_config" ]


I found some bug (https://bugs.chromium.org/p/webrtc/issues/detail?id=5578) asking to run
build/android/play_services/update.py download, but that doesnt help either.

Not sure why gclient sync wont report what is the problem. Heres the log.


 $ gclient sync
Syncing projects: 100% (108/108), done.                                                    

________ running '/usr/bin/python src/build/landmines.py' in '/home/sohan/Chrome_Android'

________ running '/usr/bin/python src/third_party/depot_tools/update_depot_tools_toggle.py --disable' in '/home/sohan/Chrome_Android'

________ running '/usr/bin/python src/tools/remove_stale_pyc_files.py src/android_webview/tools src/build/android src/gpu/gles2_conform_support src/infra src/ppapi src/printing src/third_party/catapult src/third_party/closure_compiler/build src/third_party/WebKit/Tools/Scripts src/tools' in '/home/sohan/Chrome_Android'

________ running '/usr/bin/python src/build/download_nacl_toolchains.py --mode nacl_core_sdk sync --extract' in '/home/sohan/Chrome_Android'

________ running '/usr/bin/python src/build/linux/sysroot_scripts/install-sysroot.py --running-as-hook' in '/home/sohan/Chrome_Android'
Jessie amd64 sysroot image already up to date: /home/sohan/Chrome_Android/src/build/linux/debian_jessie_amd64-sysroot
Jessie i386 sysroot image already up to date: /home/sohan/Chrome_Android/src/build/linux/debian_jessie_i386-sysroot

________ running '/usr/bin/python src/build/vs_toolchain.py update' in '/home/sohan/Chrome_Android'

________ running '/usr/bin/python src/build/mac_toolchain.py' in '/home/sohan/Chrome_Android'

________ running '/usr/bin/python src/third_party/binutils/download.py' in '/home/sohan/Chrome_Android'

________ running '/usr/bin/python src/tools/clang/scripts/update.py --if-needed' in '/home/sohan/Chrome_Android'
Updating Clang to 305735-1...
Clang is already up to date.

________ running '/usr/bin/python src/build/util/lastchange.py -o src/build/util/LASTCHANGE' in '/home/sohan/Chrome_Android'

________ running '/usr/bin/python src/build/util/lastchange.py -m SKIA_COMMIT_HASH -s src/third_party/skia --header src/skia/ext/skia_commit_hash.h' in '/home/sohan/Chrome_Android'

________ running '/usr/bin/python src/third_party/depot_tools/download_from_google_storage.py --no_resume --platform=win32 --no_auth --bucket chromium-gn -s src/buildtools/win/gn.exe.sha1' in '/home/sohan/Chrome_Android'
The current platform doesn't match "win32", skipping.

________ running '/usr/bin/python src/third_party/depot_tools/download_from_google_storage.py --no_resume --platform=darwin --no_auth --bucket chromium-gn -s src/buildtools/mac/gn.sha1' in '/home/sohan/Chrome_Android'
The current platform doesn't match "darwin", skipping.

________ running '/usr/bin/python src/third_party/depot_tools/download_from_google_storage.py --no_resume --platform=linux* --no_auth --bucket chromium-gn -s src/buildtools/linux64/gn.sha1' in '/home/sohan/Chrome_Android'
0> File src/buildtools/linux64/gn exists and SHA1 matches. Skipping.
Success!
Downloading 1 files took 0.002840 second(s)

________ running '/usr/bin/python src/third_party/depot_tools/download_from_google_storage.py --no_resume --platform=win32 --no_auth --bucket chromium-clang-format -s src/buildtools/win/clang-format.exe.sha1' in '/home/sohan/Chrome_Android'
The current platform doesn't match "win32", skipping.

________ running '/usr/bin/python src/third_party/depot_tools/download_from_google_storage.py --no_resume --platform=darwin --no_auth --bucket chromium-clang-format -s src/buildtools/mac/clang-format.sha1' in '/home/sohan/Chrome_Android'
The current platform doesn't match "darwin", skipping.

________ running '/usr/bin/python src/third_party/depot_tools/download_from_google_storage.py --no_resume --platform=linux* --no_auth --bucket chromium-clang-format -s src/buildtools/linux64/clang-format.sha1' in '/home/sohan/Chrome_Android'
0> File src/buildtools/linux64/clang-format exists and SHA1 matches. Skipping.
Success!
Downloading 1 files took 0.003210 second(s)

________ running '/usr/bin/python src/third_party/depot_tools/download_from_google_storage.py --no_resume --platform=win32 --no_auth --bucket chromium-browser-clang/orderfiles -d src/chrome/build' in '/home/sohan/Chrome_Android'
The current platform doesn't match "win32", skipping.

________ running '/usr/bin/python src/third_party/depot_tools/download_from_google_storage.py --no_resume --platform=win32 --no_auth --bucket chromium-luci -d src/tools/luci-go/win64' in '/home/sohan/Chrome_Android'
The current platform doesn't match "win32", skipping.

________ running '/usr/bin/python src/third_party/depot_tools/download_from_google_storage.py --no_resume --platform=darwin --no_auth --bucket chromium-luci -d src/tools/luci-go/mac64' in '/home/sohan/Chrome_Android'
The current platform doesn't match "darwin", skipping.

________ running '/usr/bin/python src/third_party/depot_tools/download_from_google_storage.py --no_resume --platform=linux* --no_auth --bucket chromium-luci -d src/tools/luci-go/linux64' in '/home/sohan/Chrome_Android'
0> File src/tools/luci-go/linux64/isolate exists and SHA1 matches. Skipping.
Success!
Downloading 1 files took 0.016837 second(s)

________ running '/usr/bin/python src/third_party/depot_tools/download_from_google_storage.py --no_resume --platform=linux* --no_auth --bucket chromium-eu-strip -s src/build/linux/bin/eu-strip.sha1' in '/home/sohan/Chrome_Android'
0> File src/build/linux/bin/eu-strip exists and SHA1 matches. Skipping.
Success!
Downloading 1 files took 0.000755 second(s)

________ running '/usr/bin/python src/third_party/depot_tools/download_from_google_storage.py --no_resume --platform=win32 --no_auth --bucket chromium-drmemory -s src/third_party/drmemory/drmemory-windows-sfx.exe.sha1' in '/home/sohan/Chrome_Android'
The current platform doesn't match "win32", skipping.

________ running '/usr/bin/python src/build/get_syzygy_binaries.py --output-dir=src/third_party/syzygy/binaries --revision=dbb218b6d05ff1c17a4d86252b10880c2d8ebe08 --overwrite --copy-dia-binaries' in '/home/sohan/Chrome_Android'
INFO:get_syzygy_binaries.py:Output directory does not exist, skipping cleanup.

________ running '/usr/bin/python src/third_party/depot_tools/download_from_google_storage.py --no_resume --platform=win32 --directory --recursive --no_auth --num_threads=16 --bucket chromium-apache-win32 src/third_party/apache-win32' in '/home/sohan/Chrome_Android'
The current platform doesn't match "win32", skipping.

________ running '/usr/bin/python src/third_party/instrumented_libraries/scripts/download_binaries.py' in '/home/sohan/Chrome_Android'

________ running '/usr/bin/python src/third_party/depot_tools/download_from_google_storage.py --no_resume --no_auth -u --bucket v8-wasm-fuzzer -s src/v8/test/fuzzer/wasm_corpus.tar.gz.sha1' in '/home/sohan/Chrome_Android'
0> File src/v8/test/fuzzer/wasm_corpus.tar.gz exists and SHA1 matches. Skipping.
Success!
Downloading 1 files took 0.001977 second(s)

________ running '/usr/bin/python src/third_party/WebKit/Source/devtools/scripts/local_node/node.py --running-as-hook --version' in '/home/sohan/Chrome_Android'

________ running '/usr/bin/python src/third_party/depot_tools/download_from_google_storage.py --no_resume --platform=linux* --extract --no_auth --bucket chromium-nodejs/6.9.4 -s src/third_party/node/linux/node-linux-x64.tar.gz.sha1' in '/home/sohan/Chrome_Android'
0> File src/third_party/node/linux/node-linux-x64.tar.gz exists and SHA1 matches. Skipping.
Success!
Downloading 1 files took 0.018922 second(s)

________ running '/usr/bin/python src/third_party/depot_tools/download_from_google_storage.py --no_resume --platform=darwin --extract --no_auth --bucket chromium-nodejs/6.9.4 -s src/third_party/node/mac/node-darwin-x64.tar.gz.sha1' in '/home/sohan/Chrome_Android'
The current platform doesn't match "darwin", skipping.

________ running '/usr/bin/python src/third_party/depot_tools/download_from_google_storage.py --no_resume --platform=win32 --no_auth --bucket chromium-nodejs/6.9.4 -s src/third_party/node/win/node.exe.sha1' in '/home/sohan/Chrome_Android'
The current platform doesn't match "win32", skipping.

________ running '/usr/bin/python src/third_party/depot_tools/download_from_google_storage.py --no_resume --extract --no_auth --bucket chromium-nodejs -s src/third_party/node/node_modules.tar.gz.sha1' in '/home/sohan/Chrome_Android'
0> File src/third_party/node/node_modules.tar.gz exists and SHA1 matches. Skipping.
Success!
Downloading 1 files took 0.006450 second(s)

________ running '/usr/bin/python src/tools/perf/conditionally_execute --gyp-condition fetch_telemetry_dependencies=1 src/third_party/catapult/telemetry/bin/fetch_telemetry_binary_dependencies' in '/home/sohan/Chrome_Android'
Not found "fetch_telemetry_dependencies=1" condition in GYP_DEFINES="[]". Skip script execution.

________ running '/usr/bin/python src/third_party/depot_tools/download_from_google_storage.py --no_resume --no_auth --bucket chromium-android-tools/checkstyle -s src/third_party/checkstyle/checkstyle-7.6.1-all.jar.sha1' in '/home/sohan/Chrome_Android'
0> File src/third_party/checkstyle/checkstyle-7.6.1-all.jar exists and SHA1 matches. Skipping.
Success!

Can anyone please help ?

Thanks,
Sohan

Sohan

unread,
Jun 22, 2017, 9:14:27 AM6/22/17
to Chromium-dev, soh...@chromium.org
Okay. So after a few sync, delete cycles. I am finally able to build ChromePublic apk fine.

Thanks Biao for checking though :)

Thanks,
Sohan
Reply all
Reply to author
Forward
0 new messages