Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue 439 reqiured api 31 #453

Merged
merged 22 commits into from
Jan 24, 2022
Merged

Fix issue 439 reqiured api 31 #453

merged 22 commits into from
Jan 24, 2022

Conversation

moljac
Copy link
Member

@moljac moljac commented Dec 24, 2021

Does this change any of the generated binding API's?

yes. Downgraded versions to republish nuget packages.

Describe your contribution

Fix for #444

Copy link
Contributor

@jpobst jpobst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks close, we're going to need to update this, or else the .targets files end up in monoandroid90 in the NuGet and won't be found:

https://github.com/xamarin/AndroidX/blob/fix-issue-439-reqiured-api-31/Directory.Build.props#L25-L28

Because these locations are shared among all templates in this repo, I think we'll also have to update all the templates that use .targets files (Kotlin/KotlinX) to be MonoAndroid12.0. Or else we'll be putting their .targets files in /monoandroid12.0 when they are still expecting 9.0.


<ItemGroup>
@foreach (var art in @Model.MavenArtifacts) {
<AndroidJavaLibrary Include="$(MSBuildThisFileDirectory)..\..\jar\@(art.MavenArtifactId)-@(art.MavenArtifactVersion).jar" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anywhere you use @(AndroidJavaLibrary) make sure you check $(AndroidApplication) like we do here:

<AndroidJavaLibrary Condition=" '$(AndroidApplication)' == 'true' " Include="$(MSBuildThisFileDirectory)..\..\jar\@(art.MavenGroupId).@(art.MavenArtifactId).jar">

Otherwise developers' class libraries will "redistribute" this file.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. Working on that and not all artifacts in template sets are jars!!!! (BuildActions)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here:

https://github.com/xamarin/AndroidX/blob/f97553ff428f9b6ea754f173567d220048245a16/source/AndroidXTargets.cshtml#L47-L53

*.aar wil not be redistributed? Or do libraries remove *.aars?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jpobst @jonathanpeppers

@jpobst You added kotlin and kotlinx tamplate sets and they have @(AndroidJavaLibrary). Should I (can I) fix that too?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@(AndroidAarLibrary) is fine because it doesn't do anything in a class library. I would fix @(AndroidJavaLibrary) to check for $(AndroidApplication) if you find it in other places.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jpobst You added kotlin and kotlinx tamplate sets and they have @(AndroidJavaLibrary). Should I (can I) fix that too?

Yes, looks like those use <InputJar> and package a loose .jar, so they should be updated.


<ItemGroup>
@foreach (var art in @Model.MavenArtifacts) {
<AndroidJavaLibrary Include="$(MSBuildThisFileDirectory)..\..\jar\@(art.MavenArtifactId)-@(art.MavenArtifactVersion).jar" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check $(AndroidApplication).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand why we are adding these Targets.cshtml files in the first place. My understanding is we do not need them because these packages are using <EmbeddedJar>. We are not including the loose .jar file in the NuGet, so these Includes point to a file that doesn't exist.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kotlin - InputJar
kotlinx - InputJar also
other template sets are EmbeddedJar.

Should I make them InputJar and maybe we could share artifact and make nuget smaller?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise it would be embedded twice... Or am I wrong?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should focus this PR on fixing #439, and if there are additional unrelated changes we want to make we can handle them in separate PRs.


<ItemGroup>
@foreach (var art in @Model.MavenArtifacts) {
<AndroidJavaLibrary Include="$(MSBuildThisFileDirectory)..\..\jar\@(art.MavenArtifactId)-@(art.MavenArtifactVersion).jar" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another check for $(AndroidApplication).


<ItemGroup>
@foreach (var art in @Model.MavenArtifacts) {
<AndroidJavaLibrary Include="$(MSBuildThisFileDirectory)..\..\jar\@(art.MavenArtifactId)-@(art.MavenArtifactVersion).jar" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another check for $(AndroidApplication).


<ItemGroup>
@foreach (var art in @Model.MavenArtifacts) {
<AndroidJavaLibrary Include="$(MSBuildThisFileDirectory)..\..\jar\@(art.MavenArtifactId)-@(art.MavenArtifactVersion).jar" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another check for $(AndroidApplication).

@moljac
Copy link
Member Author

moljac commented Jan 12, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@moljac
Copy link
Member Author

moljac commented Jan 18, 2022

Note:

reported as removed, but available in the API:

#### Removed Type AndroidX.AppCompat.Graphics.Drawable.AnimatedStateListDrawableCompat
#### Removed Type AndroidX.AppCompat.Graphics.Drawable.DrawableContainer
#### Removed Type AndroidX.AppCompat.Graphics.Drawable.DrawableWrapper
### Removed Namespace AndroidX.AppCompat.Widget


#### Removed Type AndroidX.AppCompat.Widget.DrawableUtils
#### Removed Type AndroidX.AppCompat.Widget.ResourceManagerInternal
#### Removed Type AndroidX.AppCompat.Widget.TintContextWrapper
#### Removed Type AndroidX.AppCompat.Widget.TintInfo
#### Removed Type AndroidX.AppCompat.Widget.VectorEnabledTintResources



#### Removed Type AndroidX.Window.Layout.WindowLayoutInfo.Builder

#### Removed Type AndroidX.Window.Layout.IWindowInfoRepository
#### Removed Type AndroidX.Window.Layout.IWindowInfoRepositoryDecorator
#### Removed Type AndroidX.Window.Layout.WindowInfoRepository
#### Removed Type AndroidX.Window.Layout.WindowInfoRepositoryCompanion


#### Removed Type AndroidX.Window.Java.Layout.WindowInfoRepositoryCallbackAdapter


Copy link
Contributor

@jpobst jpobst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we still need to do this:

Looks close, we're going to need to update this, or else the .targets files end up in monoandroid90 in the NuGet and won't be found:

https://github.com/xamarin/AndroidX/blob/fix-issue-439-reqiured-api-31/Directory.Build.props#L25-L28

Because these locations are shared among all templates in this repo, I think we'll also have to update all the templates that use .targets files (Kotlin/KotlinX) to be MonoAndroid12.0. Or else we'll be putting their .targets files in /monoandroid12.0 when they are still expecting 9.0.

@@ -2,7 +2,8 @@
@using System.Linq
<Project Sdk="Xamarin.Legacy.Sdk">
<PropertyGroup>
<TargetFrameworks>MonoAndroid9.0;net6.0-android</TargetFrameworks>
<TargetFrameworks>MonoAndroid12.0;net6.0-android</TargetFrameworks>
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is <AndroidUseLatestPlatformSdk> needed?

Apparently it is deprecated and should not be used anymore:
https://github.com/xamarin/xamarin-forms-samples/issues/364

@moljac moljac merged commit 0cf7ce5 into main Jan 24, 2022
@moljac moljac deleted the fix-issue-439-reqiured-api-31 branch January 24, 2022 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants