You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context: 485e39b
Context: eb08bb4
...and doubtless others...
Three MSBuild properties control the `android.jar` which is bound and
the `$(TargetFrameworkVersion)` of `Mono.Android.dll`:
* `$(AndroidApiLevel)`: The API level that is bound. Must be an int.
* `$(AndroidFrameworkVersion)`: The `$(TargetFrameworkVersion)` of
the generated `Mono.Android.dll`. Must be *mostly* parseable by
`System.Version` except with a leading `v`, e.g. `v10.0`.
* `$(AndroidPlatformId)`: The "ID" of the API level.
*Most* of the time, `$(AndroidApiLevel)` and `$(AndroidPlatformId)`
will be *identical*: for API-29, they're both `29`.
Where they differ is for new *preview* API levels, such as API-R:
`$(AndroidApiLevel)` will be 30, but `$(AndroidPlatformId)` is `R`.
The distinction is important because various filesystem paths within
the Android SDK use the "id" and *not* the API level when they differ,
e.g. the API-R `android.jar` is installed into:
$(AndroidSdkDirectory)/platforms/android-R/android.jar
We thus need to be *careful* when distinguishing between
`$(AndroidApiLevel)` and `$(AndroidPlatformId)`, using the former when
an integer is *required*, and using the latter whenever it refers to
filesystem paths.
Unfortunately, we *haven't* been careful, because these values really
only differ for ~4 months out of the year, and for only one
`$(TargetFrameworkVersion)` version.
Start bringing some sanity...and finding bugs while we do so:
`api-xml-adjuster.targets` should use `%(AndroidApiInfo.Id)` and *not*
`%(AndroidApiLevel.Level)`, as it references filesystem locations.
Consequently, `src/Mono.Android/Profiles/api-30.params.txt` must be
renamed to `src/Mono.Android/Profiles/api-R.params.txt` so that it
correctly embeds the `$(AndroidPlatformId)` value.
`Mono.Android.targets` should likewise use `$(AndroidPlatformId)` and
not `$(AndroidApiLevel)` when using filesystem paths from the SDK.
For good measure, `Mono.Android.csproj` now overrides
`$(IntermediateOutputPath)` to contain `$(AndroidPlatformId)`, because
why not (MOAR CONSISTENCY!).
These changes, unfortunately, introduce breakage, which will need to
be addressed:
*Because* API-R was installed into
`$(AndroidSdkDirectory)/platforms/android-R`, `api-versions.xml`
*was not previously used* because `Mono.Android.targets` was using
`$(AndroidApiLevel)`, and `platforms/android-30/data/api-version.xml`
does not yet exist. (It will come June! But not now.) As it didn't
exist, it hit the fallback path and used
`platform-tools/api/api-versions.xml` (4cd2060). You would *think*
this wouldn't be a problem, but the API-R `api-versions.xml` is
*missing* members relative to platform-tools, resulting in members
*missing* `RegisterAttribute.ApiSince` values, which
`Microsoft.DotNet.ApiCompat.exe` reports, e.g.:
CannotChangeAttribute : Attribute 'Android.Runtime.RegisterAttribute' on 'Java.Lang.StringBuilder.TrimToSize()' changed from '[RegisterAttribute("trimToSize", "()V", "", ApiSince=9)]' in the contract to '[RegisterAttribute("trimToSize", "()V", "")]' in the implementation
dotnet/java-interop@568d24ac added support to allow
`generator --apiversions` to be specified multiple times. Take
advantage of this new support to pass in the `api-versions.xml` files
from *both* `platforms/android-R` *and* `platform-tools/api` when
binding API levels > API-29. (Attempting to do this for *all*
versions which have both resulted in bizarre API compat errors, as
the `RegisterAttribute.ApiSince` value was *cleared*. ?!)
This works around the deficiency in API-R's `api-versions.xml` and
allows us to retain correct `RegisterAttribute.ApiSince` values.
Aside: to manually build the API-R binding, use:
msbuild /p:AndroidPlatformId=R /p:AndroidApiLevel=30 /p:AndroidFrameworkVersion=v10.0.99 src/Mono.Android/Mono.Android.csproj /v:diag > b.txt
Copy file name to clipboardExpand all lines: tests/api-compatibility/acceptable-breakages-v10.0.99.txt
+10-22Lines changed: 10 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,4 @@
1
1
Compat issues with assembly Mono.Android:
2
-
CannotAddAbstractMembers : Member 'Android.Telephony.CellInfo.CellIdentity' is abstract in the implementation but is missing in the contract.
3
-
CannotAddAbstractMembers : Member 'Android.Telephony.CellInfo.CellSignalStrength' is abstract in the implementation but is missing in the contract.
4
-
CannotAddAbstractMembers : Member 'Android.Telephony.CellInfo.CellIdentity.get()' is abstract in the implementation but is missing in the contract.
5
-
CannotAddAbstractMembers : Member 'Android.Telephony.CellInfo.CellSignalStrength.get()' is abstract in the implementation but is missing in the contract.
6
2
InterfacesShouldHaveSameMembers : Interface member 'Android.App.Application.IActivityLifecycleCallbacks.OnActivityPostCreated(Android.App.Activity, Android.OS.Bundle)' is present in the implementation but not in the contract.
7
3
InterfacesShouldHaveSameMembers : Interface member 'Android.App.Application.IActivityLifecycleCallbacks.OnActivityPostDestroyed(Android.App.Activity)' is present in the implementation but not in the contract.
8
4
InterfacesShouldHaveSameMembers : Interface member 'Android.App.Application.IActivityLifecycleCallbacks.OnActivityPostPaused(Android.App.Activity)' is present in the implementation but not in the contract.
@@ -24,11 +20,7 @@ InterfacesShouldHaveSameMembers : Interface member 'Android.Database.ICursor.Not
24
20
InterfacesShouldHaveSameMembers : Interface member 'Android.Database.ICursor.SetNotificationUris(Android.Content.ContentResolver, System.Collections.Generic.IList<Android.Net.Uri>)' is present in the implementation but not in the contract.
25
21
InterfacesShouldHaveSameMembers : Interface member 'Android.Media.AudioRecord.IOnRoutingChangedListener.Android.Media.IAudioRoutingOnRoutingChangedListener.OnRoutingChanged(Android.Media.IAudioRouting)' is present in the implementation but not in the contract.
26
22
InterfacesShouldHaveSameMembers : Interface member 'Android.Media.AudioTrack.IOnRoutingChangedListener.Android.Media.IAudioRoutingOnRoutingChangedListener.OnRoutingChanged(Android.Media.IAudioRouting)' is present in the implementation but not in the contract.
27
-
InterfacesShouldHaveSameMembers : Interface member 'Android.Media.MediaCas.IEventListener.OnPluginStatusUpdate(Android.Media.MediaCas, System.Int32, System.Int32)' is present in the implementation but not in the contract.
28
-
InterfacesShouldHaveSameMembers : Interface member 'Android.Media.MediaCas.IEventListener.OnResourceLost(Android.Media.MediaCas)' is present in the implementation but not in the contract.
29
23
InterfacesShouldHaveSameMembers : Interface member 'Android.Media.MediaCas.IEventListener.OnSessionEvent(Android.Media.MediaCas, Android.Media.MediaCas.Session, System.Int32, System.Int32, System.Byte[])' is present in the implementation but not in the contract.
30
-
InterfacesShouldHaveSameMembers : Interface member 'Android.OS.IBinder.SuggestedMaxIpcSizeBytes' is present in the implementation but not in the contract.
31
-
InterfacesShouldHaveSameMembers : Interface member 'Android.OS.IBinder.SuggestedMaxIpcSizeBytes.get()' is present in the implementation but not in the contract.
32
24
InterfacesShouldHaveSameMembers : Interface member 'Android.Preferences.IPreferenceDataStore.GetBoolean(System.String, System.Boolean)' is present in the implementation but not in the contract.
33
25
InterfacesShouldHaveSameMembers : Interface member 'Android.Preferences.IPreferenceDataStore.GetFloat(System.String, System.Single)' is present in the implementation but not in the contract.
34
26
InterfacesShouldHaveSameMembers : Interface member 'Android.Preferences.IPreferenceDataStore.GetInt(System.String, System.Int32)' is present in the implementation but not in the contract.
@@ -135,28 +127,14 @@ InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IComparator.ThenCo
135
127
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IComparator.ThenComparingLong(Java.Util.Functions.IToLongFunction)' is present in the implementation but not in the contract.
136
128
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IIterator.ForEachRemaining(Java.Util.Functions.IConsumer)' is present in the implementation but not in the contract.
137
129
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IList.Java.Lang.IIterable.Spliterator()' is present in the implementation but not in the contract.
138
-
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IList.Of()' is present in the implementation but not in the contract.
139
-
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IList.Of(Java.Lang.Object)' is present in the implementation but not in the contract.
140
-
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IList.Of(Java.Lang.Object, Java.Lang.Object)' is present in the implementation but not in the contract.
141
-
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IList.Of(Java.Lang.Object, Java.Lang.Object, Java.Lang.Object)' is present in the implementation but not in the contract.
142
-
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IList.Of(Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object)' is present in the implementation but not in the contract.
143
-
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IList.Of(Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object)' is present in the implementation but not in the contract.
144
-
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IList.Of(Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object)' is present in the implementation but not in the contract.
145
-
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IList.Of(Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object)' is present in the implementation but not in the contract.
146
-
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IList.Of(Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object)' is present in the implementation but not in the contract.
147
-
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IList.Of(Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object)' is present in the implementation but not in the contract.
148
-
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IList.Of(Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object)' is present in the implementation but not in the contract.
149
-
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IList.Of(Java.Lang.Object[])' is present in the implementation but not in the contract.
150
130
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IList.ReplaceAll(Java.Util.Functions.IUnaryOperator)' is present in the implementation but not in the contract.
151
131
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IList.Sort(Java.Util.IComparator)' is present in the implementation but not in the contract.
152
132
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IMap.Compute(Java.Lang.Object, Java.Util.Functions.IBiFunction)' is present in the implementation but not in the contract.
153
133
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IMap.ComputeIfAbsent(Java.Lang.Object, Java.Util.Functions.IFunction)' is present in the implementation but not in the contract.
154
134
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IMap.ComputeIfPresent(Java.Lang.Object, Java.Util.Functions.IBiFunction)' is present in the implementation but not in the contract.
155
-
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IMap.Entry(Java.Lang.Object, Java.Lang.Object)' is present in the implementation but not in the contract.
156
135
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IMap.ForEach(Java.Util.Functions.IBiConsumer)' is present in the implementation but not in the contract.
157
136
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IMap.GetOrDefault(Java.Lang.Object, Java.Lang.Object)' is present in the implementation but not in the contract.
158
137
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IMap.Merge(Java.Lang.Object, Java.Lang.Object, Java.Util.Functions.IBiFunction)' is present in the implementation but not in the contract.
159
-
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IMap.Of()' is present in the implementation but not in the contract.
160
138
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IMap.Of(Java.Lang.Object, Java.Lang.Object)' is present in the implementation but not in the contract.
161
139
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IMap.Of(Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object)' is present in the implementation but not in the contract.
162
140
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.IMap.Of(Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object, Java.Lang.Object)' is present in the implementation but not in the contract.
@@ -249,3 +227,13 @@ InterfacesShouldHaveSameMembers : Interface member 'Java.Util.Functions.IPredica
249
227
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.Functions.IUnaryOperator.Identity()' is present in the implementation but not in the contract.
250
228
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.Streams.ICollector.Of(Java.Util.Functions.ISupplier, Java.Util.Functions.IBiConsumer, Java.Util.Functions.IBinaryOperator, Java.Util.Functions.IFunction, Java.Util.Streams.CollectorCharacteristics[])' is present in the implementation but not in the contract.
251
229
InterfacesShouldHaveSameMembers : Interface member 'Java.Util.Streams.ICollector.Of(Java.Util.Functions.ISupplier, Java.Util.Functions.IBiConsumer, Java.Util.Functions.IBinaryOperator, Java.Util.Streams.CollectorCharacteristics[])' is present in the implementation but not in the contract.
230
+
MembersMustExist : Member 'Android.Telephony.CellInfoCdma.CellIdentity.get()' does not exist in the implementation but it does exist in the contract.
231
+
MembersMustExist : Member 'Android.Telephony.CellInfoCdma.CellSignalStrength.get()' does not exist in the implementation but it does exist in the contract.
232
+
MembersMustExist : Member 'Android.Telephony.CellInfoGsm.CellIdentity.get()' does not exist in the implementation but it does exist in the contract.
233
+
MembersMustExist : Member 'Android.Telephony.CellInfoGsm.CellSignalStrength.get()' does not exist in the implementation but it does exist in the contract.
234
+
MembersMustExist : Member 'Android.Telephony.CellInfoLte.CellIdentity.get()' does not exist in the implementation but it does exist in the contract.
235
+
MembersMustExist : Member 'Android.Telephony.CellInfoLte.CellSignalStrength.get()' does not exist in the implementation but it does exist in the contract.
236
+
MembersMustExist : Member 'Android.Telephony.CellInfoTdscdma.CellIdentity.get()' does not exist in the implementation but it does exist in the contract.
237
+
MembersMustExist : Member 'Android.Telephony.CellInfoTdscdma.CellSignalStrength.get()' does not exist in the implementation but it does exist in the contract.
238
+
MembersMustExist : Member 'Android.Telephony.CellInfoWcdma.CellIdentity.get()' does not exist in the implementation but it does exist in the contract.
239
+
MembersMustExist : Member 'Android.Telephony.CellInfoWcdma.CellSignalStrength.get()' does not exist in the implementation but it does exist in the contract.
0 commit comments