New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 917016 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
OOO until Feb 4th
Closed: Jan 9
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug

Blocking:
issue 620034



Sign in to add a comment

Android Studio (canary) gradle files fail to sync

Project Member Reported by dewittj@chromium.org, Dec 20

Issue description

Android studio 3.4 canary 8

I followed the steps in https://chromium.googlesource.com/chromium/src/+/HEAD/docs/android_studio.md but with a modification to the generate_gradle.py step:

  build/android/gradle/generate_gradle.py --output-directory out/and --canary --target //chrome/android:chrome_public_apk

Upon gradle sync, I get the following error:
ERROR: Could not set unknown property 'bootClasspath' for object of type org.gradle.api.tasks.compile.CompileOptions.

This occurs in the following generated file: out/and/gradle/chrome/android/chrome_public_apk/build.gradle

Context:
    tasks.withType(JavaCompile) {
      options.bootClasspath = "[u'/usr/local/google/home/dewittj/src/chrome/src/out/and/lib.java/third_party/android_tools/android.jar']"
    }

If I remove the bootClasspath line then I have no errors.
 
Cc: -wnwen@google.com
Owner: wnwen@chromium.org
Status: Assigned (was: Untriaged)
Will take a look, it's been a while since I've tried single target builds.
Thanks. I am using single target build because _all does not seem to let me debug.  I can open a separate bug for that issue if you like.
Hmm... I think that is the bigger issue here. A separate bug for _all debugging would be nice, thanks. Please assign it to me.
Blocking: 620034
Labels: DevX
Project Member

Comment 5 by bugdroid1@chromium.org, Dec 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/95d6c5b393eb5ce43fdbc998493a22bdedd47dcf

commit 95d6c5b393eb5ce43fdbc998493a22bdedd47dcf
Author: Peter Wen <wnwen@chromium.org>
Date: Thu Dec 20 23:47:44 2018

Android: Remove obsolete option for gradle

This option no longer exists in Android Studio 3.4+.

Bug:  917016 
Change-Id: I533d40288faf2693ad32fe9646d48073c30ac7c8
Reviewed-on: https://chromium-review.googlesource.com/c/1387155
Commit-Queue: Peter Wen <wnwen@chromium.org>
Reviewed-by: agrieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#618383}
[modify] https://crrev.com/95d6c5b393eb5ce43fdbc998493a22bdedd47dcf/build/android/gradle/android.jinja
[modify] https://crrev.com/95d6c5b393eb5ce43fdbc998493a22bdedd47dcf/build/android/gradle/generate_gradle.py
[modify] https://crrev.com/95d6c5b393eb5ce43fdbc998493a22bdedd47dcf/build/android/gyp/write_build_config.py

Status: Fixed (was: Assigned)
Status: Assigned (was: Fixed)
There is another problem preventing sync:

"The minSdk version should not be declared in the android manifest file. You can move the version from the manifest to the defaultConfig in the build.gradle file."

Seems like https://cs.chromium.org/chromium/src/build/android/gradle/manifest.jinja?rcl=bd96ec76b2bc6e7d6d4f714d3aa2bb6edb3998a3&l=9 needs to be updated as well.
Cc: wnwen@chromium.org
Owner: dewittj@chromium.org
Sure, sounds like you've identified the problem. I'll reassign this to you then.
Cc: -wnwen@chromium.org dewittj@chromium.org
Owner: wnwen@chromium.org
Seems like the problem is a little more involved. See https://crrev.com/c/1398398

Unless we add further custom processing of Android Manifests for single targets, this will be something that each dev has to remove. If you have a better suggestion or would like to add custom processing, let me know and I'd be happy to do code reviews. For now I've added explanation in the docs: https://crrev.com/c/1398396
Status: Fixed (was: Assigned)
The original issue is fixed. The new issue about minSdk and targetSdk is tracked here: https://crbug.com/841529
Project Member

Comment 11 by bugdroid1@chromium.org, Jan 9

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f8cc36fec254765b28a61075474dedb6cbd31b10

commit f8cc36fec254765b28a61075474dedb6cbd31b10
Author: Peter Wen <wnwen@chromium.org>
Date: Wed Jan 09 17:52:31 2019

Android: Update android studio instructions

Native files require all variants to be synced with gradle. Thus we must
turn off "only sync active variant" optimization in newer Android Studio
versions.

Also add instructions for handling AndroidManifest.xml errors.

Bug: 620034,  917016 
Change-Id: I00370328226c6cfe05de02f08188d74c32e97056
Reviewed-on: https://chromium-review.googlesource.com/c/1398396
Reviewed-by: Justin DeWitt <dewittj@chromium.org>
Commit-Queue: Peter Wen <wnwen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#621212}
[modify] https://crrev.com/f8cc36fec254765b28a61075474dedb6cbd31b10/docs/android_studio.md

Sign in to add a comment