diff options
author | davileen <davileen@amazon.com> | 2014-12-01 17:31:22 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-02 01:32:45 +0000 |
commit | 57dc71e6bf75f6f249c941a70c9139e1316516f9 (patch) | |
tree | 6460922ff8935e8d9dfe364cc78f0a748d5659f1 /build/java_prebuilt.gypi | |
parent | 66d584dda1791ea6efafb6951ce9255d352dc89f (diff) | |
download | chromium_src-57dc71e6bf75f6f249c941a70c9139e1316516f9.zip chromium_src-57dc71e6bf75f6f249c941a70c9139e1316516f9.tar.gz chromium_src-57dc71e6bf75f6f249c941a70c9139e1316516f9.tar.bz2 |
Fix "Class resolved by unexpected DEX" in uiautomator tests
Attemping to run uiautomator tests on a Nexus fails with the following error:
W/dalvikvm(32338): Class resolved by unexpected DEX: Lorg/chromium/chrome/shell/uiautomator/DummyTest;(0x416544d0):0x5b738000 ref [Lcom/android/uiautomator/testrunner/ UiAutomatorTestCase;] Lcom/android/uiautomator/testrunner/UiAutomatorTestCase;(0x416544d0):0x5b6dc000
W/dalvikvm(32338): (Lorg/chromium/chrome/shell/uiautomator/DummyTest; had used a different Lcom/android/uiautomator/testrunner/UiAutomatorTestCase; during pre-verification)
W/dalvikvm(32338): Unable to resolve superclass of Lorg/chromium/chrome/shell/uiautomator/DummyTest; (96)
W/dalvikvm(32338): Link of class 'Lorg/chromium/chrome/shell/uiautomator/DummyTest;' failed
D/AndroidRuntime(32338): Shutting down VM
W/dalvikvm(32338): threadid=1: thread exiting with uncaught exception (group=0x4164abc0)
E/UiAutomatorTestRunner(32338): uncaught exception
E/UiAutomatorTestRunner(32338): java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
This error occurs because uiautomator.jar is built into
out/Debug/lib.java/chrome_shell_uiautomator_tests.dex.jar. This results in two
different implementations of uiautomator classes on the device hence the
dalvik error.
The 'chrome_shell_uiautomator_tests' gyp target uses the uiautomator_test.gypi
include. uiautomator.gypi dexes all dependent jars into a single .dex.jar.
Since chrome_shell_uiautomator_tests has a transitive dependence,
through chrome_shell_uiautomator_tests_java, on uiautomator.gyp,
the uiautomator jar used for compilation will be built into its output.
If we ignore chrome_shell_uiautomator_tests and instead just build
chrome_shell_uiautomator_tests_java we can successfully run uiautomator tests.
This gyp target already generates dexed jars through java.gypi (which calls
dex_action.gypi).
This commit removes uiautomator_test.gypi and renames
chrome_shell_uiautomator_tests_java to chrome_shell_uiautomator_tests.
BUG=434080
Review URL: https://codereview.chromium.org/734793002
Cr-Commit-Position: refs/heads/master@{#306315}
Diffstat (limited to 'build/java_prebuilt.gypi')
-rw-r--r-- | build/java_prebuilt.gypi | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/build/java_prebuilt.gypi b/build/java_prebuilt.gypi index a3a8cc0..8efc4ef 100644 --- a/build/java_prebuilt.gypi +++ b/build/java_prebuilt.gypi @@ -27,6 +27,7 @@ 'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)', 'android_jar': '<(android_sdk)/android.jar', 'input_jars_paths': [ '<(android_jar)' ], + 'neverlink%': 0, 'proguard_config%': '', 'proguard_preprocess%': '0', 'variables': { @@ -46,7 +47,13 @@ 'all_dependent_settings': { 'variables': { 'input_jars_paths': ['<(dex_input_jar_path)'], - 'library_dexed_jars_paths': ['<(dex_path)'], + 'conditions': [ + ['neverlink == 1', { + 'library_dexed_jars_paths': [], + }, { + 'library_dexed_jars_paths': ['<(dex_path)'], + }], + ], }, }, 'conditions' : [ @@ -76,18 +83,20 @@ }, ], }], - ], - 'actions': [ - { - 'action_name': 'dex_<(_target_name)', - 'message': 'Dexing <(_target_name) jar', - 'variables': { - 'dex_input_paths': [ - '<(dex_input_jar_path)', - ], - 'output_path': '<(dex_path)', - }, - 'includes': [ 'android/dex_action.gypi' ], - }, + ['neverlink == 0', { + 'actions': [ + { + 'action_name': 'dex_<(_target_name)', + 'message': 'Dexing <(_target_name) jar', + 'variables': { + 'dex_input_paths': [ + '<(dex_input_jar_path)', + ], + 'output_path': '<(dex_path)', + }, + 'includes': [ 'android/dex_action.gypi' ], + }, + ], + }], ], } |