Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Issue 734793002: Fix "Class resolved by unexpected DEX" in uiautomator tests (Closed)

Created:
6 years, 1 month ago by davileen
Modified:
6 years ago
CC:
chromium-reviews, klundberg+watch_chromium.org, yfriedman+watch_chromium.org, jbudorick+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

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 Committed: https://crrev.com/57dc71e6bf75f6f249c941a70c9139e1316516f9 Cr-Commit-Position: refs/heads/master@{#306315}

Patch Set 1 #

Patch Set 2 : Add neverlink variable #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -14 lines) Patch
M build/java_prebuilt.gypi View 1 3 chunks +23 lines, -14 lines 0 comments Download

Messages

Total messages: 20 (5 generated)
davileen
On 2014/11/17 23:36:36, davileen wrote: > mailto:davileen@amazon.com changed reviewers: > + mailto:dtrainor@chromium.org Hi David, Here's ...
6 years, 1 month ago (2014-11-17 23:48:03 UTC) #2
David Trainor- moved to gerrit
+cjhopman. He knows this area much better than me.
6 years, 1 month ago (2014-11-18 19:31:40 UTC) #4
cjhopman
On 2014/11/17 23:48:03, davileen wrote: > On 2014/11/17 23:36:36, davileen wrote: > > mailto:davileen@amazon.com changed ...
6 years, 1 month ago (2014-11-18 20:38:22 UTC) #5
davileen
On 2014/11/18 20:38:22, cjhopman wrote: > On 2014/11/17 23:48:03, davileen wrote: > > On 2014/11/17 ...
6 years, 1 month ago (2014-11-18 23:46:27 UTC) #6
cjhopman
Wow, sorry for the delay here. I drafted a reply but failed to send it... ...
6 years ago (2014-11-24 01:29:32 UTC) #7
davileen
> How about adding a flag to build/java_prebuilt.gypi that makes it so that the > ...
6 years ago (2014-11-27 01:47:10 UTC) #8
davileen
On 2014/11/27 01:47:10, davileen wrote: > > How about adding a flag to build/java_prebuilt.gypi that ...
6 years ago (2014-11-29 00:21:47 UTC) #9
cjhopman
lgtm
6 years ago (2014-12-01 21:41:22 UTC) #10
cjhopman
On 2014/12/01 21:41:22, cjhopman wrote: > lgtm Also, for making changes to android_tools. Here's our ...
6 years ago (2014-12-01 22:22:09 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/734793002/20001
6 years ago (2014-12-01 22:41:20 UTC) #13
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_x64_rel on tryserver.chromium.win (http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel/builds/16093)
6 years ago (2014-12-02 00:28:37 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/734793002/20001
6 years ago (2014-12-02 00:39:32 UTC) #17
commit-bot: I haz the power
Committed patchset #2 (id:20001)
6 years ago (2014-12-02 01:31:30 UTC) #18
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/57dc71e6bf75f6f249c941a70c9139e1316516f9 Cr-Commit-Position: refs/heads/master@{#306315}
6 years ago (2014-12-02 01:33:14 UTC) #19
davileen
6 years ago (2014-12-08 18:45:38 UTC) #20
Message was sent while issue was closed.
On 2014/12/01 22:22:09, cjhopman wrote:
> On 2014/12/01 21:41:22, cjhopman wrote:
> > lgtm
> 
> Also, for making changes to android_tools. Here's our internal instructions (I
> think they'll work for you, if not I'll make the change myself):
> 
> (Note, you shouldn't have to re-clone the repo, just do this in
> third_party/android_tools)
> 
> Make sure your SSH public key has been added to https://gerrit.chromium.org/
> Checkout the android_tools repo
> git clone ssh://<username>@gerrit.chromium.org:29418/android_tools.git
> # Set user.name and user.email if you didn't set them globally
> git config user.name "Your Name"
> git config user.email mailto:"your.id@chromium.org"
> Make your change and commit normally
> <make your changes>
> git commit -a
> Push the change for review (make sure you have your @chromium.org account set
> for git as described above)
> git push ssh://<username>@gerrit.chromium.org:29418/android_tools.git
> HEAD:refs/for/master
> Add reviewers and get LGTM's and add navabi or rmcilroy.
> If you need to upload an updated patch use the same command above, but make
sure
> to add "Change-Id: ********" to your local commit message where that change-id
> is taken from the gerrit page for this issue.
> Once you have your LGTM, notify aurimas, navabi or rmcilroy to commit the
change
> (this last part needs to change to let people commit their own changes to
> android_tools).
> Don't forget to roll Chromium to the new commit in android_tools repository by
> modifying the DEPS file in the src/ directory, like this

Hi,

I didn't manage to get these steps to work, and posting a bug to infra didn't
help (https://code.google.com/p/chromium/issues/detail?id=438457), so I'd love
to take you up on your offer of making the change yourself.

Thanks,
David

Powered by Google App Engine
This is Rietveld 408576698