Commit 485e39b
authored
[docs] Set $(AndroidApiLevel)=28 in Configuration.Override.props.in (#3149)
If you copy `Configuration.Override.props.in` to
`Configuration.Override.props` and don't change `$(AndroidApiLevel)`
from it's default value of 24, the `src/Mono.Android` build fails:
obj/Debug/android-24/mcw/Java.Lang.Reflect.Parameter.cs(10,60): error CS0535: 'Parameter' does not implement interface member 'IAnnotatedElement.IsAnnotationPresent(Class)'
The cause of this error is because the parameters to `api-merge.exe`
are "wrong"; see also: 0778165:
mono --debug=casts ../../bin/BuildDebug/api-merge.exe -o "obj/Debug/android-24/mcw/api.xml" -s '../../bin/BuildDebug/api/api-*.xml.in' \
../../bin/BuildDebug/api/api-10.xml.in … \
--last-description=../../bin/BuildDebug/api/api-28.xml.in
`api-merge.exe` uses `$(AndroidPlatformId)` to determine the Android
API-level to generate `api.xml` for, and thus uses the default value
of API-28 (from `Configuration.props`), while the subsequent
`generator.exe` invocation reads the API-28 `api.xml` and generates
code for `$(AndroidApiLevel)` (API-24), and this mismatch causes the
CS0535 error.
This is a classic Don't Do That™: the `$(AndroidApiLevel)`,
`$(AndroidFrameworkVersion)`, and `$(AndroidPlatformId)` MSBuild
properties *must* be synchronized with each other, but
`$(AndroidPlatformId)` *wasn't even mentioned* -- making it hard to
be kept in sync with the other values -- and (arguably) the comments
did not sufficiently warn anybody that these values must be
synchronized with each other.
Update `$(AndroidApiLevel)` and `$(AndroidFrameworkVersion)` so that
they correspond to the current latest stable version, so that if
someone inadvertently copies just one of the values things are *less*
likely to blow up.
Additionally, add `$(AndroidPlatformId)` and add a comment to attempt
to further clarify that these values must be kept updated together.1 file changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
4 | 8 | | |
5 | | - | |
| 9 | + | |
6 | 10 | | |
7 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
8 | 14 | | |
9 | 15 | | |
10 | 16 | | |
| |||
0 commit comments