Misc docs cleanup and fixes (#155501)
This commit is contained in:
@@ -90,7 +90,7 @@ For example:
|
||||
to compile with a stack trace that may or may not really point to the plugin's
|
||||
code on disk.
|
||||
- If the plugin's code conflicts with the app's Android source code (for
|
||||
example, the plugin has a conflicting transitive dependancy), Gradle will
|
||||
example, the plugin has a conflicting transitive dependency), Gradle will
|
||||
generally fail to compile with difficult to translate stack traces.
|
||||
- These subprojects are added in an `afterEvaluate` hook in `flutter.gradle`.
|
||||
Generally adding any logic in `afterEvaluate` blocks is discouraged because it
|
||||
|
||||
@@ -1,27 +1,34 @@
|
||||
# Support a new Android API level Flutter (go/flutter-android-new-api-level)
|
||||
|
||||
## Objective
|
||||
|
||||
Provides a list of areas to consider and examples of former work for how to update Flutter to support a new version of the Android API. This happens every fall and Flutter developers expect to build against the latest versions quickly after they are available.
|
||||
|
||||
### Overview
|
||||
|
||||
#### Bump compile and target SDK versions in samples
|
||||
|
||||
Samples, especially add to app samples, represent apps that mirror the first types of users we see adopt new Android APIs.
|
||||
|
||||
Example PR: https://github.com/flutter/samples/pull/2368
|
||||
|
||||
#### New Android features
|
||||
|
||||
New Android features can require a broad spectrum of work. Some will require nothing from flutter. Some will require a lot of work, such as the support for “back preview”. The Android team generally needs to be aware and schedule work ahead of time.
|
||||
|
||||
#### Update Gradle/AGP support
|
||||
Sometimes newer versions of gradle are required to build without warning against a new version of Android API. The warning looks like
|
||||
|
||||
Sometimes newer versions of gradle are required to build without warning against a new version of Android API. The warning looks like:
|
||||
|
||||
```
|
||||
WARNING:We recommend using a newer Android Gradle plugin to use compileSdkPreview = "somenamedversion"
|
||||
This Android Gradle plugin (X.X.X) was tested up to compileSdk = XX
|
||||
```
|
||||
|
||||
Bump the gradle version used in the engine.
|
||||
|
||||
#### Update Robolectric
|
||||
|
||||
Robolectric is a dependency that allows us to write unit tests that run on a local development machine against the Android API surface without being on an Android device.
|
||||
Update what version of Robolectric we use in framework, engine and packages.
|
||||
|
||||
@@ -64,10 +71,12 @@ Specifically the value for “--device” `./script/tool_runner.sh firebase-test
|
||||
Example PR: https://github.com/flutter/packages/pull/4430
|
||||
|
||||
#### Update documentation
|
||||
|
||||
Update documentation page to indicate the new API is tested
|
||||
https://docs.flutter.dev/reference/supported-platforms.
|
||||
|
||||
#### Modify defaults
|
||||
|
||||
**In flutter/flutter:** Update default compile SDK version and target SDK version to the new API value.
|
||||
[Code here](../../../packages/flutter_tools/gradle/src/main/groovy/flutter.groovy).
|
||||
Follow comments in that file to update other locations that are assumed to be the same.
|
||||
@@ -90,11 +99,15 @@ https://github.com/flutter/engine/blob/9289cb6a36aa86990e3ffe0f20324dafa38e7c11/
|
||||
**In flutter/packages:** Set examples to build with the new API.
|
||||
|
||||
#### Test “Integration Test” package
|
||||
|
||||
Integration test is a package shipped in the Flutter tool for running integration tests on Flutter apps. Ensure that the integration test package has an example that targets the new API level on the most recent published stable version of the Flutter tool.
|
||||
|
||||
#### Related documents
|
||||
|
||||
[Emulators for Flutter Android Testing (PUBLICLY SHARED)](https://docs.google.com/document/d/10wYUcLcSTF4Epg2EUGoBqOkkOe4zxKHvYKjXFZAOgGs/edit?resourcekey=0-pltjPvEtVezXDADMbUwFHQ)
|
||||
|
||||
### Additional notes
|
||||
|
||||
#### Upload new SDK version to CIPD and consume in buildroot
|
||||
|
||||
See [Upgrading Engine's Android API version](https://github.com/flutter/flutter/blob/main/docs/platforms/android/Upgrading-Engine's-Android-API-version.md) for instructions, as this work is also required to build the engine against the new Android version.
|
||||
|
||||
@@ -35,7 +35,7 @@ To resolve it:
|
||||
|
||||
### Gradle task assembleDebug failed with exit code 1
|
||||
|
||||
If `assembleDebug` or `assembleRelease` failed but no error message can be seen, you are likely on a older Flutter version (`<= 1.9.1.hotfix4`) which may suppress the root cause of the error.
|
||||
If `assembleDebug` or `assembleRelease` failed but no error message can be seen, you are likely on an older Flutter version (`<= 1.9.1.hotfix4`) which may suppress the root cause of the error.
|
||||
|
||||
This problem can be solved in two ways:
|
||||
- Please try a more recent channel, like `beta` or `dev` and restart the compilation. It may still fail, but the error will now be printed
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
## Testing on Emulators in the Devicelab
|
||||
|
||||
While the Devicelab is typically for testing on Devices we have added support so that developers can now test Android changes via the LUCI recipes on an Android Emulator.
|
||||
|
||||
You can specify a new test via the .ci.yaml file in the repository. This allows the infra framework to run the test automatically with minimal work from the developer.
|
||||
You can specify a new test via the `.ci.yaml` file in the repository. This allows the infra framework to run the test automatically with minimal work from the developer.
|
||||
|
||||
### Adding a Brand New Target
|
||||
|
||||
Adding a new Devicelab Android Emulator test for Android feature changes requires the following steps:
|
||||
|
||||
Starting with the finished target yaml definition:
|
||||
|
||||
```
|
||||
```yaml
|
||||
- name: Linux_android android_defines_test
|
||||
recipe: devicelab/devicelab_drone
|
||||
presubmit: true
|
||||
@@ -51,6 +53,7 @@ Starting with the finished target yaml definition:
|
||||
f. `timeout` the timeout here is for the time to give the test to run before killing it.
|
||||
|
||||
### Updating an Existing Target
|
||||
|
||||
If you want to update an existing target you will only need to add the following changes:
|
||||
1. add a `dimensions` field as described above.
|
||||
2. Set the `device_type: "none"`.
|
||||
|
||||
@@ -47,7 +47,7 @@ This list may become outdated, so be sure to change any references to the old SD
|
||||
|
||||
1. Locate the desired Android Virtual Device (AVD) from https://chrome-infra-packages.appspot.com/p/chromium/tools/android/avd/linux-amd64/. You should look at the most recently updated AVD and verify that
|
||||
it has the desired `generic_android<API#>.textpb` for the API version that you are modifying the engine to support. Then, determine its build_id number by clicking on the AVD instance you would like to use and looking for the build_id tag.
|
||||
2. In each of the engine builders (at the time of writing: `ci/builders/linux_android_emulator_skia.json` & `ci/builders/linux_android_emulator.json`), find the `android_virtual_device` and `avd_cipd_version` depedency entries and update them to the versions you desire, e.g.
|
||||
2. In each of the engine builders (at the time of writing: `ci/builders/linux_android_emulator_skia.json` & `ci/builders/linux_android_emulator.json`), find the `android_virtual_device` and `avd_cipd_version` dependency entries and update them to the versions you desire, e.g.
|
||||
|
||||
```json
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ _This guide assumes you haven't manually modified your Android host project for
|
||||
|
||||
If you opt to migrate your standard `flutter create`d project, follow the following steps:
|
||||
|
||||
**1a.** If you don't have any of your own added code to `android/app/src/main/java/[your/package/name]/MainActivity.java` - remove the body of your `MainActivity.java` and change the `FlutterActivity` import. The new `FlutterActivity` no longer requires manually registering your plugins. It will now perform the registration automatically when the underlaying `FlutterEngine` is created.
|
||||
**1a.** If you don't have any of your own added code to `android/app/src/main/java/[your/package/name]/MainActivity.java` - remove the body of your `MainActivity.java` and change the `FlutterActivity` import. The new `FlutterActivity` no longer requires manually registering your plugins. It will now perform the registration automatically when the underlying `FlutterEngine` is created.
|
||||
|
||||
```diff
|
||||
// MainActivity.java
|
||||
|
||||
@@ -87,7 +87,7 @@ Flutter's View, not to the Android View they're actually trying to tap on.
|
||||
|
||||
### Background
|
||||
|
||||
Explaining our problems with accessbility (or "a11y") requires a brief detour
|
||||
Explaining our problems with accessibility (or "a11y") requires a brief detour
|
||||
into explaining a11y itself on Android, and how a11y typically works on Flutter.
|
||||
|
||||
Android itself builds up a tree of a11y nodes for each Android View rendered to
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Debugging issues on the Web
|
||||
|
||||
The tips below can help you debug Web issues quicker and file more readable Github issues.
|
||||
The tips below can help you debug Web issues quicker and file more readable GitHub issues.
|
||||
|
||||
## Chrome DevTools
|
||||
|
||||
|
||||
Reference in New Issue
Block a user