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

[android] update Xamarin.Google.Guava.ListenableFuture #5305

Closed
wants to merge 5 commits into from

Conversation

jonathanpeppers
Copy link
Member

Fixes: xamarin/AndroidX#509

Building a MAUI project with a certain set of AndroidX dependencies:

<PackageReference Include="Xamarin.AndroidX.Core" Version="1.7.0" />
<PackageReference Include="Xamarin.AndroidX.Camera.Lifecycle" Version="1.0.2.3" />
<PackageReference Include="Xamarin.AndroidX.Camera.Camera2" Version="1.0.2.3" />
<PackageReference Include="Xamarin.AndroidX.Camera.View" Version="1.0.0.5-alpha20" />

Fails with:

Xamarin.Android.D8.targets(79,5): error : java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException:
Compilation failed to complete, origin: /Users/imac/.nuget/packages/xamarin.google.guava.listenablefuture/1.0.0.5/buildTransitive/net6.0-android31.0/../../jar/guava-listenablefuture.jar : com/google/common/util/concurrent/ListenableFuture.class

If we look at the contents of:

C:\Program Files\dotnet\packs\Microsoft.Maui.Controls.Ref.android\6.0.200-preview.14.5099\ref\net6.0-android30.0\Microsoft.Maui.Controls.aar

There is a libs\FCEFAF10B0757418.jar inside that contains the
contents of guava-listenablefuture.jar!

This was a fix for Xamarin.Google.Guava.*:

xamarin/XamarinComponents#1313

MAUI is not using the latest version of this package, so we can
specify Xamarin.Google.Guava.ListenableFuture explicitly. Now there
are no .jar files in Microsoft.Maui.aar.

Another approach is to update to the very latest AndroidX packages --
right now we are blocked on trying to get them all on the
dotnet-public feed. So we can take that approach later on.

Fixes: xamarin/AndroidX#509

Building a MAUI project with a certain set of AndroidX dependencies:

    <PackageReference Include="Xamarin.AndroidX.Core" Version="1.7.0" />
    <PackageReference Include="Xamarin.AndroidX.Camera.Lifecycle" Version="1.0.2.3" />
    <PackageReference Include="Xamarin.AndroidX.Camera.Camera2" Version="1.0.2.3" />
    <PackageReference Include="Xamarin.AndroidX.Camera.View" Version="1.0.0.5-alpha20" />

Fails with:

    Xamarin.Android.D8.targets(79,5): error : java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException:
    Compilation failed to complete, origin: /Users/imac/.nuget/packages/xamarin.google.guava.listenablefuture/1.0.0.5/buildTransitive/net6.0-android31.0/../../jar/guava-listenablefuture.jar : com/google/common/util/concurrent/ListenableFuture.class

If we look at the contents of:

    C:\Program Files\dotnet\packs\Microsoft.Maui.Controls.Ref.android\6.0.200-preview.14.5099\ref\net6.0-android30.0\Microsoft.Maui.Controls.aar

There is a `libs\FCEFAF10B0757418.jar` inside that contains the
contents of `guava-listenablefuture.jar`!

This was a fix for `Xamarin.Google.Guava.*`:

xamarin/XamarinComponents#1313

MAUI is not using the latest version of this package, so we can
specify `Xamarin.Google.Guava.ListenableFuture` explicitly. Now there
are no `.jar` files in `Microsoft.Maui.aar`.

Another approach is to update to the very latest AndroidX packages --
right now we are blocked on trying to get them all on the
`dotnet-public` feed. So we can take that approach later on.
Copy link
Contributor

@moljac moljac left a comment

Choose a reason for hiding this comment

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

LGTM

@jonathanpeppers
Copy link
Member Author

So Microsoft.Maui.aar is now fixed, there are no lib\*.jar files at all now:

image

However, some things still fail to build complaining about guava, need to look into it...

@jonathanpeppers jonathanpeppers marked this pull request as draft March 15, 2022 14:17
@jonathanpeppers
Copy link
Member Author

This package also has it inside!

https://www.nuget.org/api/v2/package/Xamarin.AndroidX.Concurrent.Futures/1.1.0.5

The 1.1.0.6 one seems ok.

@jonathanpeppers
Copy link
Member Author

I keep hitting issues here with other dependencies, I think we just need to update AndroidX to fix this problem.

@nickvansimaeys
Copy link

Do you know if there is an update on this or a workaround? I am still unable to start up my .NET MAUI project

jonathanpeppers added a commit to jonathanpeppers/maui that referenced this pull request Mar 25, 2022
Context: dotnet#5305
Fixes: xamarin/AndroidX#509

Update to the latest AndroidX packages, so we also use the latest
Xamarin.Google.Guava.ListenableFuture

This currently has build failures:

  src\Core\src\Platform\Android\Navigation\StackNavigationManager.cs(145,41): error CS1061: 'NavController' does not contain a definition for 'BackStack' and no accessible extension method 'BackStack' accepting a first argument of type 'NavController' could be found (are you missing a using directive or an assembly reference?)
  src\Core\src\Platform\Android\Navigation\StackNavigationManager.cs(188,48): error CS1061: 'NavController' does not contain a definition for 'BackStack' and no accessible extension method 'BackStack' accepting a first argument of type 'NavController' could be found (are you missing a using directive or an assembly reference?)
  src\Core\src\Platform\Android\Navigation\StackNavigationManager.cs(245,51): error CS1061: 'NavController' does not contain a definition for 'BackStack' and no accessible extension method 'BackStack' accepting a first argument of type 'NavController' could be found (are you missing a using directive or an assembly reference?)

Looking at:

    ~\.nuget\packages\xamarin.androidx.navigation.runtime\2.4.1\lib\net6.0-android31.0\Xamarin.AndroidX.Navigation.Runtime.dll

I can't find:

    [Register("androidx/navigation/NavController", DoNotGenerateAcw = true)]
    public class NavController : Object
    {
        public unsafe virtual IDeque BackStack
        {
            [Register("getBackStack", "()Ljava/util/Deque;", "GetGetBackStackHandler")]
            get;

But it's not documented here either:

https://developer.android.com/reference/androidx/navigation/NavController
@jonathanpeppers
Copy link
Member Author

Closing in favor of #5588

Redth pushed a commit that referenced this pull request Mar 29, 2022
* [android] update to the latest AndroidX packages

Context: #5305
Fixes: xamarin/AndroidX#509

Update to the latest AndroidX packages, so we also use the latest
Xamarin.Google.Guava.ListenableFuture

This currently has build failures:

  src\Core\src\Platform\Android\Navigation\StackNavigationManager.cs(145,41): error CS1061: 'NavController' does not contain a definition for 'BackStack' and no accessible extension method 'BackStack' accepting a first argument of type 'NavController' could be found (are you missing a using directive or an assembly reference?)
  src\Core\src\Platform\Android\Navigation\StackNavigationManager.cs(188,48): error CS1061: 'NavController' does not contain a definition for 'BackStack' and no accessible extension method 'BackStack' accepting a first argument of type 'NavController' could be found (are you missing a using directive or an assembly reference?)
  src\Core\src\Platform\Android\Navigation\StackNavigationManager.cs(245,51): error CS1061: 'NavController' does not contain a definition for 'BackStack' and no accessible extension method 'BackStack' accepting a first argument of type 'NavController' could be found (are you missing a using directive or an assembly reference?)

Looking at:

    ~\.nuget\packages\xamarin.androidx.navigation.runtime\2.4.1\lib\net6.0-android31.0\Xamarin.AndroidX.Navigation.Runtime.dll

I can't find:

    [Register("androidx/navigation/NavController", DoNotGenerateAcw = true)]
    public class NavController : Object
    {
        public unsafe virtual IDeque BackStack
        {
            [Register("getBackStack", "()Ljava/util/Deque;", "GetGetBackStackHandler")]
            get;

But it's not documented here either:

https://developer.android.com/reference/androidx/navigation/NavController

* - replace with BackQueue

* - fix tests

* $(NoWarn) XA4218

* $(MSBuildWarningsAsMessages) I mean

Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
@github-actions github-actions bot locked and limited conversation to collaborators Dec 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

error : java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException
6 participants