New issue
Advanced search Search tips

Issue 891996 link

Starred by 3 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Specify minSdkVersion, targetSdkVersion, packageName in GN rather than in AndroidManifest.xml

Project Member Reported by agrieve@chromium.org, Oct 4

Issue description

Specifying these three values in Gradle files is common practice.

There are a couple spots in our build pipeline that would benefit from knowing minSdkVeriosion in GN:
* When dexing,
* When proguarding (with r8)


Additionally specifying targetSdkVersion and packageName in GN would allow us to stop using jinja templates for several simple AndroidManfest.xml files. E.g.:
 * https://cs.chromium.org/chromium/src/chrome/android/javatests/AndroidManifest.xml
 * https://cs.chromium.org/chromium/src/chrome/android/modules/vr/AndroidManifest.xml
 * https://cs.chromium.org/chromium/src/testing/android/empty_apk/AndroidManifest.xml

List of all manifests that are templates (~1/4 of them are "simple"):
https://cs.chromium.org/search/?q=file:androidmanifest.xml+%5C%7B%5C%7B&sq=package:chromium&type=cs


minSdkVersion in GN is being added here:
https://chromium-review.googlesource.com/c/chromium/src/+/1258059

Note that "aapt2 link" supports setting these values in the manifest via:
--min-sdk-version
--target-sdk-version
--rename-manifest-package
--rename-instrumentation-target-package


When going ahead with this, we should set a build-wide default minSdkVersion and targetSdkVersion so that these values are always present for targets. It should be an error for an AndroidManifest.xml to have a <uses-sdk> tag in it, so that we don't need to enforce that it matches the GN value.

 
Labels: QuickFix
Cc: jbudorick@chromium.org
 Issue 762034  has been merged into this issue.

Sign in to add a comment