0

Android: Upgrade to Android Studio 2.3

Support Clank development with the next version of Android Studio.

BUG=700438

Review-Url: https://codereview.chromium.org/2797703004
Cr-Commit-Position: refs/heads/master@{#462050}
This commit is contained in:
wnwen
2017-04-05 06:12:54 -07:00
committed by Commit bot
parent 7d699dd15b
commit fdea62ce25
3 changed files with 20 additions and 14 deletions

@ -745,7 +745,7 @@ def main():
_ExtractZips(generator.project_dir, zip_tuples)
logging.warning('Project created! (%d subprojects)', len(project_entries))
logging.warning('Generated projects work best with Android Studio 2.2')
logging.warning('Generated projects work with Android Studio 2.3')
logging.warning('For more tips: https://chromium.googlesource.com/chromium'
'/src.git/+/master/docs/android_studio.md')

@ -8,6 +8,6 @@ buildscript {
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:2.2.3"
classpath "com.android.tools.build:gradle:2.3.0"
}
}

@ -4,8 +4,6 @@
## Usage
**Note: currently only Android Studio 2.2 is supported**
Make sure you have followed
[android build instructions](android_build_instructions.md) already.
@ -26,6 +24,12 @@ to generate projects for:
build/android/gradle/generate_gradle.py --target //chrome/android:chrome_public_apk --target //android_webview/test:android_webview_apk
```
For those upgrading from Android Studio 2.2 to 2.3:
* Regenerate with `generate_gradle.py`.
* Clean up in `//third_party/android_tools` with `git clean -ffd`.
* Restart Android Studio with File -> "Invalidate Caches / Restart".
For first-time Android Studio users:
* Avoid running the setup wizard.
@ -57,8 +61,8 @@ Gradle sub-project.
Gradle supports source directories but not source files. However, some
directories in Chromium are split amonst multiple GN targets. To accommodate
this, the script detects such targets and creates exclude patterns to exclude
files not in the current target. You may still see them when editing, but they
are excluded in gradle tasks.
files not in the current target. You still see them when editing, but they are
excluded in gradle tasks.
***
Most generated .java files in GN are stored as `.srcjars`. Android Studio does
@ -100,6 +104,7 @@ includes `R.java`).
* `Shift + F6`: Rename variable
* `Ctrl + Alt + O`: Organize imports
* `Alt + Enter`: Quick Fix (use on underlined errors)
* `F2`: Find next error
### Building from the Command Line
@ -118,22 +123,23 @@ resources, native libraries, etc.
* Add the line `org.gradle.daemon=true` to `~/.gradle/gradle.properties`,
creating it if necessary.
## Status (as of Feb 7th, 2017)
## Status (as of April 4th, 2017)
### What works
* Tested with Android Studio v2.2.
* Tested with Android Studio v2.3.
* Java editing and gradle compile works.
* Instrumentation tests included as androidTest.
* Symlinks to existing .so files in jniLibs (doesn't generate them).
* Editing resource xml files.
* Java debugging (see
[here](/docs/android_debugging_instructions.md#Android-Studio))
[here](/docs/android_debugging_instructions.md#Android-Studio)).
### What doesn't work (yet) ([crbug](https://bugs.chromium.org/p/chromium/issues/detail?id=620034))
* Make gradle aware of assets
* Layout editor
* Add a mode in which gradle is responsible for generating `R.java`
* Add support for native code editing
* Make the "Make Project" button work correctly
* Proper file resolution and imports for overlapping modules.
* Make gradle aware of assets.
* Layout editor.
* Add a mode in which gradle is responsible for generating `R.java`.
* Add support for native code editing.
* Make the "Make Project" button work correctly.