Giter Club home page Giter Club logo

androidx's Introduction

AndroidX for .NET Android

GitHub License contributions welcome GitHub contributors Build Status

Microsoft creates and maintains .NET Android bindings for many of Google's AndroidX libraries.

These bindings will also continue to support Xamarin.Android projects for the remainder of its supported lifecycle.

What is AndroidX

AndroidX (also called Jetpack) is a suite of libraries that developers can use to access Android functionality using best practices that work consistently across Android versions and devices.

AndroidX is a replacement for Google's original Android Support Library which is no longer maintained.

Binding Policies

  • This repository binds over 200 AndroidX libraries that are published to NuGet.org. The full package list can be found in config.json.
  • AndroidX Java artifacts and some dependencies come from Google's Maven Respository.
  • Additional dependencies come from Maven/Sonatype Central.
  • Google's release notes for AndroidX libraries are available here.
  • The major/minor/patch version numbers mirror the bound AndroidX library version. For example, the NuGet Xamarin.AndroidX.Core 1.3.2.1 binds version 1.3.2 of the AndroidX library androidx.core:core.
    • The revision version number is used when a new NuGet needs to be built but the AndroidX library has not been updated.
  • We endeavor to release updated NuGets within a few weeks after new AndroidX releases, however large changes occasionally require more time.
  • In general, we do not bind pre-release libraries. As their API is not stable yet, it results in too much rework.

Details

Full list of maven artifact to NuGet mappings:

./docs/artifact-list.md

Full list of maven artifact with versions to NuGet mappings with versions:

./docs/artifact-list-with-versions.md

Support

Note that these packages are largely just autogenerated bindings around Google's AndroidX libraries. As such, our support is limited to issues caused by our bindings. For tutorials/samples/support using the libraries themselves, please refer to Google's documentation.

License

The license for this repository is specified in LICENSE.md

Each package published from this repository generally contains third-party code (ie: .jar/.aar) that is governed by its own license. Per-package license information is available in cgmanifest.json.

Building

Instructions for building this repository are specified in BUILDING.md

In depth building instructions: ./docs/build.md.

Contribution Guidelines

The Contribution Guidelines for this repository are listed in CONTRIBUTING.md

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information, see the .NET Foundation Code of Conduct.

.NET Foundation

This project is part of the .NET Foundation

androidx's People

Contributors

4brunu avatar bholmes avatar cheesebaron avatar conceptdev avatar cosminstirbu avatar dependabot[bot] avatar devronb avatar github-actions[bot] avatar jonathanpeppers avatar jpobst avatar mattleibow avatar moljac avatar newky2k avatar pjcollins avatar redth avatar tuyen-vuduc avatar vvolkgang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

androidx's Issues

Cannot find a child SupportMapFragment from an AndroidX Fragment

I think this is a known issue on the Google side, but I'm not sure if it has been sorted yet or is going to propagate to Xamarin soon:

Stack overflow issue

I have a SupportMapFragment, which inherits Support.V4.App.Fragment. Before I migrated to AndroidX I had this line:

_mapFragment = (SupportMapFragment)ChildFragmentManager.FindFragmentById(Resource.Id.map);

Now I get a casting error because the AndroidX fragment's child fragment manager doesn't return a support fragment.

Android.Material 1.1.0-rc1 Seems to have mismapped fields

After applying the suggested fix from #56 and rebuilding the library I'm running in to some sort of incompatibility with Material Visual on Android with Entry and Editor.

With the new version, on Android, the background color of Entry seems to come from TextColor instead of BackgroundColor, with BackgroundColor having no effect. From what I'm personally using in the library, this seems to be the only issue. These fields display as expected on iOS.

I don't know if this is the proper place to report this, so if I'm incorrect just let me know.

Below is what I'm seeing, Android:
Android
iOS:
iOS

Cannot find Migrate to androidx menu

I have seen that vs now supports migration tooling as an experimental feature that we have to turn on.

After turning on that feature I cannot find any way to use migration wizard. I am completely failed to find any doc about it. Then I learned from a twitter screenshot that option for migration will be appeared in my projects menu(under archive in build menu). But in my case I cannot find anything.

What am I missing ?

RC1 Release Preparation

@mattleibow

  • Migration Package: Copy mappings into github for source / nice completeness
  • Migration Package - Update version
  • Migration package - Check that warnings for installing nugets show correct version
  • Migration package - Check that all assemblies added to .props

@moljac

  • Create new FWLink for ProjectLink
  • Add Cake logic to check all <attr> nodes with interface in the path attribute do not have name="visibility" attributes (or throw error)
  • Fix Material version (the artifact is 1.0.0 yet the nuget is 1.1.0x) NOT ONLY Material
  • Bump to -rc1 nuget version
  • Add cake logic to check that the artifact version matches the nuget version prefix

java.lang.NoClassDefFoundError: androidx/lifecycle/LifecycleOwner (J2X9001)

Xamarin.Android Version (eg: 6.0):

Xamarin.Android
Version: 10.1.3.7 (Visual Studio Community)
Commit: xamarin-android/d16-4/d66aed0

Operating System & Version (eg: Mac OSX 10.11):

Mac OS X 10.15.2
Darwin 19.2.0 Darwin Kernel Version 19.2.0

Support Libraries Version (eg: 23.3.0):

Xamarin.AndroidX.Lifecycle.Common(2.1.0-preview06)
also tried (2.1.0-rc1)

Describe your Issue:

JARTOXML: Warning J2X9001: Couldn't load class ...: java.lang.NoClassDefFoundError: androidx/lifecycle/LifecycleOwner (J2X9001)

JARTOXML: Warning J2XA006: missing class error was raised while reflecting ... : androidx/lifecycle/LifecycleOwner (J2XA006)

Steps to Reproduce (with link to sample solution if possible):

Create a xamarin bindings project and bind java lib using jar2xml

Include any relevant Exception Stack traces, build logs, adb logs:

ACW javac error JAVAC0000: error: CommandsCompletedListener is not public in SystemAlarmDispatcher; cannot be accessed from outside package

Local builds on Mac

obj/Debug/android/src/mono/androidx/work/impl/background/systemalarm/SystemAlarmDispatcher_CommandsCompletedListenerImplementor.java(8,66): javac error JAVAC0000:  error: CommandsCompletedListener is not public in SystemAlarmDispatcher; cannot be accessed from outside package [/Users/Shared/Projects/d/X/AndroidX_master/samples/BuildAll/BuildAll/BuildAll.csproj]
obj/Debug/android/src/mono/androidx/work/impl/background/systemalarm/SystemAlarmDispatcher_CommandsCompletedListenerImplementor.java(8,66): javac error JAVAC0000: 		androidx.work.impl.background.systemalarm.SystemAlarmDispatcher.CommandsCompletedListener [/Users/Shared/Projects/d/X/AndroidX_master/samples/BuildAll/BuildAll/BuildAll.csproj]
obj/Debug/android/src/mono/androidx/work/impl/background/systemalarm/SystemAlarmDispatcher_CommandsCompletedListenerImplementor.java(8,66): javac error JAVAC0000:  [/Users/Shared/Projects/d/X/AndroidX_master/samples/BuildAll/BuildAll/BuildAll.csproj]

Building Error "java.lang.IllegalArgumentException: already added"

Hi,
I'm using latest Visual Studio 2019 version 16.4.2...
I have a Xamarin Android application targetting framework Android 10.0 (Q) that use the following packages..

Xamarin.Android.Support.v4 28.0.0.3
Xamarin.Android.Support.v7.AppCompat 28.0.0.3
Xamarin.Android.Support.v7.CardView 28.0.0.3
Xamarin.Android.Support.v7.Preference 28.0.0.3
Xamarin.Android.Support.v7.RecyclerView 28.0.0.3
Xamarin.Android.Support.Vector.Drawable 28.0.0.3
Xamarin.Android.Support.VersionedParcelable 28.0.0.3
Xamarin.Android.Support.ViewPager 28.0.0.3

..and this packages for enable Google FCM messaging..

Xamarin.GooglePlayServices.Base 71.1610.0
Xamarin.GooglePlayServices.Basement 71.1620.0
Xamarin.GooglePlayServices.Stats 71.1601.0
Xamarin.GooglePlayServices.Tasks 71.1601.0

Xamarin.Firebase.Common 71.1610.0
Xamarin.Firebase.Iid 71.1710.0
Xamarin.Firebase.Iid.Interop 71.1601.0
Xamarin.Firebase.Measurement.Connector 71.1701.0
Xamarin.Firebase.Messaging 71.1740.0

...After adding Xamarin.AndroidX.Migration 1.0.0-preview06 package and added missing Xamarin.AndroidX.* packagesโ€ฆ

Xamarin.AndroidX.Activity 1.0.0-preview06
Xamarin.AndroidX.Annotation 1.1.0-preview06
Xamarin.AndroidX.AppCompat 1.1.0-preview06
Xamarin.AndroidX.AppCompat.Resources 1.1.0-preview06
Xamarin.AndroidX.Arch.Core.Common 2.1.0-preview06
Xamarin.AndroidX.Arch.Core.Runtime 2.1.0-preview06
Xamarin.AndroidX.AsyncLayoutInflater 1.0.0-preview06
Xamarin.AndroidX.Browser 1.1.0-preview06
Xamarin.AndroidX.CardView 1.0.0-preview06
Xamarin.AndroidX.Collection 1.1.0-preview06
Xamarin.AndroidX.CoordinatorLayout 1.0.0-preview06
Xamarin.AndroidX.Core 1.1.0-preview06
Xamarin.AndroidX.CursorAdapter 1.0.0-preview06
Xamarin.AndroidX.CustomView 1.0.0-preview06
Xamarin.AndroidX.DocumentFile 1.0.1-preview06
Xamarin.AndroidX.DrawerLayout 1.0.0-preview06
Xamarin.AndroidX.Fragment 1.1.0-preview06
Xamarin.AndroidX.Interpolator 1.0.0-preview06
Xamarin.AndroidX.Legacy.Support.Core.UI 1.0.0-preview06
Xamarin.AndroidX.Legacy.Support.Core.Utils 1.0.0-preview06
Xamarin.AndroidX.Legacy.Support.V4 1.0.0-preview06
Xamarin.AndroidX.Lifecycle.Common 2.1.0-preview06
Xamarin.AndroidX.Lifecycle.LiveData 2.1.0-preview06
Xamarin.AndroidX.Lifecycle.LiveData.Core 2.1.0-preview06
Xamarin.AndroidX.Lifecycle.Runtime 2.1.0-preview06
Xamarin.AndroidX.Lifecycle.ViewModel 2.1.0-preview06
Xamarin.AndroidX.Loader 1.1.0-preview06
Xamarin.AndroidX.LocalBroadcastManager 1.0.0-preview06
Xamarin.AndroidX.Media 1.1.0-preview06
Xamarin.AndroidX.MultiDex 2.0.1-preview06
Xamarin.AndroidX.Preference 1.1.0-preview06
Xamarin.AndroidX.Print 1.0.0-preview06
Xamarin.AndroidX.RecyclerView 1.0.0-preview06
Xamarin.AndroidX.SavedState 1.0.0-preview06
Xamarin.AndroidX.SlidingPaneLayout 1.1.0-preview06
Xamarin.AndroidX.SwipeRefreshLayout 1.0.0-preview06
Xamarin.AndroidX.Transition 1.2.0-preview06
Xamarin.AndroidX.VectorDrawable 1.1.0-preview06
Xamarin.AndroidX.VectorDrawable.Animated 1.1.0-preview06
Xamarin.AndroidX.VersionedParcelable 1.1.0-preview06
Xamarin.AndroidX.ViewPager 1.0.0-preview06

Xamarin.Google.Android.Material 1.1.0-preview06

..the Build process show the follwing errorโ€ฆ

1>------ Build started: Project: ZetaHouseMobileApp, Configuration: Debug Any CPU ------
1> ZetaHouseMobileApp -> C:\GitHub\HelloAndroid\HelloAndroidApp\HelloAndroidApp\bin\Debug\ZetaHouseMobileApp.dll
1> Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/actions/ItemListIntents;
1> Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/actions/NoteIntents;
1> Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/actions/ReserveIntents;
1> Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/actions/SearchIntents;
1> Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/AccountPicker;
1> Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/BlockingServiceConnection;
1> Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/ConnectionResult;
1> Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/Feature;
1> Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/FirstPartyScopes;
1>
1> UNEXPECTED TOP-LEVEL EXCEPTION:
1> java.lang.RuntimeException: Translation has been interrupted
1> at com.android.dx.command.dexer.Main.processAllFiles(Main.java:614)
1> at com.android.dx.command.dexer.Main.runMonoDex(Main.java:310)
1> at com.android.dx.command.dexer.Main.runDx(Main.java:288)
1> at com.android.dx.command.dexer.Main.main(Main.java:244)
1> at com.android.dx.command.Main.main(Main.java:95)
1> Caused by: java.lang.InterruptedException: Too many errors
1> at com.android.dx.command.dexer.Main.processAllFiles(Main.java:606)
1> ... 4 more
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2613,3): error : java.lang.IllegalArgumentException: already added : Lcom/google/android/gms/actions/ItemListIntents;
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========

I dont undestand where is the problem in migration process to AndroidX.

I've just tried to uninstall all Xamarin.Firebase.* and Xamarin.GooglePlayServices.* packages , then readded but problem persists..

Thanks for any suggestions.
Best Regards.

ViewPager2's FragmentStateAdapter binding mismatches inherited generic `OnBindViewHolder` method

Xamarin.Android Version (eg: 6.0):

Xamarin.Android 10.1.4.0 (d16-4 e44d1ae)

Operating System & Version (eg: Mac OSX 10.11):

Windows 10 1909 (IDE: Visual Studio 2019 16.4.5)

Support Libraries Version (eg: 23.3.0):

Xamarin.AndroidX.ViewPager2 1.0.0

Describe your Issue:

The class FragmentStateAdapter which is used for the new ViewPager2 seems to have a Java binding issue regarding inheritance.

In Java, the FragmentStateAdapter class inherits the RecyclerView.Adapter class, which has the abstract onBindViewHolder method. This abstract method is implemented and sealed (marked final) by the FragmentStateAdapter class to get a chunk of its functionality working. In Java and Kotlin this means any implementation of FragmentStateAdapter does not require implementation of the onBindViewHolder method.

In the Xamarin binding there seems to be a mismatch in inheritance however. The signature of the of the OnBindViewHolder implementation in FragmentStateAdapter seems to mismatch with the OnBindViewHolder in the parent RecyclerView.Adapter class.

On the C# side of things, this causes the responsibility of implementing the abstract OnBindViewHolder in RecyclerView.Adapter to cascade down to the classes that inherit FragmentStateAdapter (since the implementation in FragmentStateAdapter mismatches it is now missing as far as the C# compiler is concerned)

If I try to implement the method in my FragmentStateAdapter subclasses to make sure the C# compiler shows no errors, the Java build error shown below appears instead:

JAVAC0000:  error: name clash: onBindViewHolder(ViewHolder,int) in MyTestActivity_MyPagerAdapter and onBindViewHolder(VH,int) in Adapter have the same erasure, yet neither overrides the other
	public void onBindViewHolder (androidx.recyclerview.widget.RecyclerView.ViewHolder p0, int p1)  where VH is a type-variable: VH extends ViewHolder declared in class Adapter

Possible cause

The issue seems to be caused by the following mismatch:

In Java, the generic signature onBindViewHolder(VH holder, int position) (where VH is a generic defined in the RecyclerView.Adapter class signature) is properly inherited by the method signature onBindViewHolder(FragmentViewHolder holder, int position).

In C#/Xamarin however, it seems the RecyclerView.Adapter doesn't have this generic aspect bound. Instead using the ViewHolder base type in place of the generic.
This likely causes the OnBindViewHolder(FragmentViewHolder holder, int position) method in the FragmentStateAdapter to mismatch with the now non-generic OnBindViewHolder(ViewHolder holder, int position) method in the RecyclerView.Adapter class

Can't compile on release mode

I'm not being able to compile my project on release mode anymore without "Use Shared Runtime" checked.

image

2> C:\Users\mario.nuget\packages\xamarin.androidx.migration\1.0.0-preview04\build\Xamarin.AndroidX.Migration.targets(212,9): error : The method or operation is not implemented.

2>C:\Users\mario.nuget\packages\xamarin.androidx.migration\1.0.0-preview04\build\Xamarin.AndroidX.Migration.targets(212,9): error : at Mono.Cecil.Pdb.NativePdbWriterProvider.GetSymbolWriter(ModuleDefinition module, Stream symbolStream)

2>C:\Users\mario.nuget\packages\xamarin.androidx.migration\1.0.0-preview04\build\Xamarin.AndroidX.Migration.targets(212,9): error : at Mono.Cecil.Pdb.PdbWriterProvider.GetSymbolWriter(ModuleDefinition module, Stream symbolStream)

2>C:\Users\mario.nuget\packages\xamarin.androidx.migration\1.0.0-preview04\build\Xamarin.AndroidX.Migration.targets(212,9): error : at Mono.Cecil.ModuleWriter.GetSymbolWriter(ModuleDefinition module, String fq_name, ISymbolWriterProvider symbol_writer_provider, WriterParameters parameters)

2>C:\Users\mario.nuget\packages\xamarin.androidx.migration\1.0.0-preview04\build\Xamarin.AndroidX.Migration.targets(212,9): error : at Mono.Cecil.ModuleWriter.Write(ModuleDefinition module, Disposable`1 stream, WriterParameters parameters)

2>C:\Users\mario.nuget\packages\xamarin.androidx.migration\1.0.0-preview04\build\Xamarin.AndroidX.Migration.targets(212,9): error : at Mono.Cecil.ModuleWriter.WriteModule(ModuleDefinition module, Disposable`1 stream, WriterParameters parameters)

2>C:\Users\mario.nuget\packages\xamarin.androidx.migration\1.0.0-preview04\build\Xamarin.AndroidX.Migration.targets(212,9): error : at Mono.Cecil.ModuleDefinition.Write(String fileName, WriterParameters parameters)

2>C:\Users\mario.nuget\packages\xamarin.androidx.migration\1.0.0-preview04\build\Xamarin.AndroidX.Migration.targets(212,9): error : at Xamarin.AndroidX.Migration.CecilMigrator.Migrate(String source, String destination) in D:\a\1\s\source\Xamarin.AndroidX.Migration\Migration\CecilMigrator.cs:line 117

2>C:\Users\mario.nuget\packages\xamarin.androidx.migration\1.0.0-preview04\build\Xamarin.AndroidX.Migration.targets(212,9): error : at Xamarin.AndroidX.Migration.CecilMigrator.Migrate(IEnumerable`1 assemblies) in D:\a\1\s\source\Xamarin.AndroidX.Migration\Migration\CecilMigrator.cs:line 50

2>C:\Users\mario.nuget\packages\xamarin.androidx.migration\1.0.0-preview04\build\Xamarin.AndroidX.Migration.targets(212,9): error : at Xamarin.AndroidX.Migration.BuildTasks.CecilfyFiles.Execute() in D:\a\1\s\source\Xamarin.AndroidX.Migration\BuildTasks\CecilfyFiles.cs:line 35

If I check the option, I can compile, but not deploy to a device.

image

========== Rebuild All: 2 succeeded, 0 failed, 0 skipped ==========

Lifecycle annotations seem to have wrong annotation javaName

Hello there,

It seems that the [Lifecycle.Event.OnStart], [Lifecycle.Event.OnStop] and other from the AndroidX.Lifecycle namespace have their java annotation counterparts set to the old libraries.

Found this while testing the migration in the Toggl app, we are using the old [Lifecycle.Event.OnStart], [Lifecycle.Event.OnStop] here:
https://github.com/toggl/mobileapp/blob/d79af0ab5522a325046baf19b4616cb086b1bc71/Toggl.Droid/Startup/TogglApplication.cs#L83-L99

Test branch: https://github.com/toggl/mobileapp/tree/doivid/androidx-migration-test

After migrating, we get this error while building:

TogglApplication.java(34, 25):  error: package android.arch.lifecycle does not exist
@android.arch.lifecycle.OnLifecycleEvent(android.arch.lifecycle.Lifecycle.Event.ON_START)
TogglApplication.java(43, 25):  error: package android.arch.lifecycle does not exist
@android.arch.lifecycle.OnLifecycleEvent(android.arch.lifecycle.Lifecycle.Event.ON_STOP)

Checking the generated source code, I found this:

namespace AndroidX.Lifecycle
{
  [Register("androidx/lifecycle/Lifecycle", DoNotGenerateAcw = true)]
  public abstract class Lifecycle : Java.Lang.Object
  {
 ...
     [Register("androidx/lifecycle/Lifecycle$Event", DoNotGenerateAcw = true)]
    public sealed class Event : Java.Lang.Enum
    {
      internal new static readonly JniPeerMembers _members = (JniPeerMembers) new XAPeerMembers("androidx/lifecycle/Lifecycle$Event", typeof (AndroidX.Lifecycle.Lifecycle.Event));

      [Register("ON_ANY")]
      public static AndroidX.Lifecycle.Lifecycle.Event OnAny
      {
        get
        {
          return Java.Lang.Object.GetObject<AndroidX.Lifecycle.Lifecycle.Event>(AndroidX.Lifecycle.Lifecycle.Event._members.StaticFields.GetObjectValue("ON_ANY.Landroidx/lifecycle/Lifecycle$Event;").Handle, JniHandleOwnership.TransferLocalRef);
        }
      }

      [Register("ON_CREATE")]
      public static AndroidX.Lifecycle.Lifecycle.Event OnCreate
      {
        get
        {
          return Java.Lang.Object.GetObject<AndroidX.Lifecycle.Lifecycle.Event>(AndroidX.Lifecycle.Lifecycle.Event._members.StaticFields.GetObjectValue("ON_CREATE.Landroidx/lifecycle/Lifecycle$Event;").Handle, JniHandleOwnership.TransferLocalRef);
        }
      }

      [Register("ON_DESTROY")]
      public static AndroidX.Lifecycle.Lifecycle.Event OnDestroy
      {
        get
        {
          return Java.Lang.Object.GetObject<AndroidX.Lifecycle.Lifecycle.Event>(AndroidX.Lifecycle.Lifecycle.Event._members.StaticFields.GetObjectValue("ON_DESTROY.Landroidx/lifecycle/Lifecycle$Event;").Handle, JniHandleOwnership.TransferLocalRef);
        }
      }

      [Register("ON_PAUSE")]
      public static AndroidX.Lifecycle.Lifecycle.Event OnPause
      {
        get
        {
          return Java.Lang.Object.GetObject<AndroidX.Lifecycle.Lifecycle.Event>(AndroidX.Lifecycle.Lifecycle.Event._members.StaticFields.GetObjectValue("ON_PAUSE.Landroidx/lifecycle/Lifecycle$Event;").Handle, JniHandleOwnership.TransferLocalRef);
        }
      }

      [Register("ON_RESUME")]
      public static AndroidX.Lifecycle.Lifecycle.Event OnResume
      {
        get
        {
          return Java.Lang.Object.GetObject<AndroidX.Lifecycle.Lifecycle.Event>(AndroidX.Lifecycle.Lifecycle.Event._members.StaticFields.GetObjectValue("ON_RESUME.Landroidx/lifecycle/Lifecycle$Event;").Handle, JniHandleOwnership.TransferLocalRef);
        }
      }

      [Register("ON_START")]
      public static AndroidX.Lifecycle.Lifecycle.Event OnStart
      {
        get
        {
          return Java.Lang.Object.GetObject<AndroidX.Lifecycle.Lifecycle.Event>(AndroidX.Lifecycle.Lifecycle.Event._members.StaticFields.GetObjectValue("ON_START.Landroidx/lifecycle/Lifecycle$Event;").Handle, JniHandleOwnership.TransferLocalRef);
        }
      }

      [Register("ON_STOP")]
      public static AndroidX.Lifecycle.Lifecycle.Event OnStop
      {
        get
        {
          return Java.Lang.Object.GetObject<AndroidX.Lifecycle.Lifecycle.Event>(AndroidX.Lifecycle.Lifecycle.Event._members.StaticFields.GetObjectValue("ON_STOP.Landroidx/lifecycle/Lifecycle$Event;").Handle, JniHandleOwnership.TransferLocalRef);
        }
      }

      internal new static IntPtr class_ref
      {
        get
        {
          return AndroidX.Lifecycle.Lifecycle.Event._members.JniPeerType.PeerReference.Handle;
        }
      }

      public override JniPeerMembers JniPeerMembers
      {
        get
        {
          return AndroidX.Lifecycle.Lifecycle.Event._members;
        }
      }

      protected override IntPtr ThresholdClass
      {
        get
        {
          return AndroidX.Lifecycle.Lifecycle.Event._members.JniPeerType.PeerReference.Handle;
        }
      }

      protected override System.Type ThresholdType
      {
        get
        {
          return AndroidX.Lifecycle.Lifecycle.Event._members.ManagedPeerType;
        }
      }

      internal Event(IntPtr javaReference, JniHandleOwnership transfer)
        : base(javaReference, transfer)
      {
      }

      [Register("valueOf", "(Ljava/lang/String;)Landroidx/lifecycle/Lifecycle$Event;", "")]
      public static unsafe AndroidX.Lifecycle.Lifecycle.Event ValueOf(string name)
      {
        IntPtr jobject = JNIEnv.NewString(name);
        try
        {
          JniArgumentValue* parameters = stackalloc JniArgumentValue[1];
          parameters[0] = new JniArgumentValue(jobject);
          return Java.Lang.Object.GetObject<AndroidX.Lifecycle.Lifecycle.Event>(AndroidX.Lifecycle.Lifecycle.Event._members.StaticMethods.InvokeObjectMethod("valueOf.(Ljava/lang/String;)Landroidx/lifecycle/Lifecycle$Event;", parameters).Handle, JniHandleOwnership.TransferLocalRef);
        }
        finally
        {
          JNIEnv.DeleteLocalRef(jobject);
        }
      }

      [Register("values", "()[Landroidx/lifecycle/Lifecycle$Event;", "")]
      public static unsafe AndroidX.Lifecycle.Lifecycle.Event[] Values()
      {
        return (AndroidX.Lifecycle.Lifecycle.Event[]) JNIEnv.GetArray(AndroidX.Lifecycle.Lifecycle.Event._members.StaticMethods.InvokeObjectMethod("values.()[Landroidx/lifecycle/Lifecycle$Event;", (JniArgumentValue*) null).Handle, JniHandleOwnership.TransferLocalRef, typeof (AndroidX.Lifecycle.Lifecycle.Event));
      }

      >>>>>> This package is from the old lib, right? <<<<<<<<<      
[Annotation("android.arch.lifecycle.OnLifecycleEvent(android.arch.lifecycle.Lifecycle.Event.ON_CREATE)")]
      public class OnCreateAttribute : Attribute
      {
      }

      >>>>>> This package is from the old lib, right? <<<<<<<<<      
[Annotation("android.arch.lifecycle.OnLifecycleEvent(android.arch.lifecycle.Lifecycle.Event.ON_START)")]
      public class OnStartAttribute : Attribute
      {
      }

      >>>>>> This package is from the old lib, right? <<<<<<<<<      
[Annotation("android.arch.lifecycle.OnLifecycleEvent(android.arch.lifecycle.Lifecycle.Event.ON_RESUME)")]
      public class OnResumeAttribute : Attribute
      {
      }

      
      >>>>>> This package is from the old lib, right? <<<<<<<<<
[Annotation("android.arch.lifecycle.OnLifecycleEvent(android.arch.lifecycle.Lifecycle.Event.ON_PAUSE)")]
      public class OnPauseAttribute : Attribute
      {
      }

      >>>>>> This package is from the old lib, right? <<<<<<<<<
[Annotation("android.arch.lifecycle.OnLifecycleEvent(android.arch.lifecycle.Lifecycle.Event.ON_STOP)")]
      public class OnStopAttribute : Attribute
      {
      }

      >>>>>> This package is from the old lib, right? <<<<<<<<<      
[Annotation("android.arch.lifecycle.OnLifecycleEvent(android.arch.lifecycle.Lifecycle.Event.ON_DESTROY)")]
      public class OnDestroyAttribute : Attribute
      {
      }

      >>>>>> This package is from the old lib, right? <<<<<<<<<
[Annotation("android.arch.lifecycle.OnLifecycleEvent(android.arch.lifecycle.Lifecycle.Event.ON_ANY)")]
      public class OnAnyAttribute : Attribute
      {
      }
    }
  }
}

MediaSessionCompat exists in multiple assemblies

Xamarin Android Version: 10.1.3.7

Operating System & Version: Mac OS 10.14.6

Support Libraries Version: 28.0.0.1

Describe your Issue:

I have a project with transitive dependencies which reference the Xamarin.Android.Support.Media.Compat package, and some which reference the newer Xamarin.AndroidX.Media package.

I have installed the Xamarin.AndroidX.Migration package.

When I attempt to reference the type MediaSessionCompat, I recieve the following error message:

Error CS0433: The type 'MediaSessionCompat' exists in both 'Xamarin.Android.Support.Media.Compat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' and 'Xamarin.AndroidX.Media, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' (CS0433)

I'm not sure if this scenario is supposed to be handled by the tooling, or if there is some other change I should have made to the project as part of the migration.

Many thanks for your help.

Original attribute defined here

After following the directions and installing the necessary nugets I was told to install, we still cannot compile. We get a ton of errors for "Original attribute defined here."

Any suggestions? The errors do not say where they are being spawned from. They started coming up about the same time we added the AndroidX.AppCompat nuget.

Any help would be appreciated.

image

[Question] XF4.5-pre2, move to androidX and android.support.*.dll.so files still showing in package lib folder

Picked up the new 4.5.0-pre2, fixed one missing reference to AndroidX.MediaRouter, and our app built.

Comparing the old vs new build (which uses aot startup profiling):

  • Looking at the apk assemblies folder, I can see that the Android.Support dlls are gone, replaced by a list of AndroidX dlls.
  • Looking into the lib folders, I see libaot files for both Android.Support and AndroidX. The number of android.support files is the same as before, but some of them are now smaller in size (all around 7KB).

Is this in any way expected or possibly reflecting an issue?

Problem with Dotfuscator

I couldn't compile my project using Dotfuscator:

Symbols were found but are not matching the assembly
at Mono.Cecil.ModuleDefinition.ReadSymbols(ISymbolReader reader, Boolean throwIfSymbolsAreNotMaching)
at Mono.Cecil.ModuleReader.ReadSymbols(ModuleDefinition module, ReaderParameters parameters)
at Mono.Cecil.ModuleReader.CreateModule(Image image, ReaderParameters parameters)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at Xamarin.AndroidX.Migration.CecilMigrator.Migrate(String source, String destination) in D:\a\1\s\source\Xamarin.AndroidX.Migration\CecilMigrator.cs:line 85
at Xamarin.AndroidX.Migration.CecilMigrator.Migrate(IEnumerable`1 assemblies) in D:\a\1\s\source\Xamarin.AndroidX.Migration\CecilMigrator.cs:line 50
at Xamarin.AndroidX.Migration.BuildTasks.CecilfyFiles.Execute() in D:\a\1\s\source\Xamarin.AndroidX.Migration.BuildTasks\CecilfyFiles.cs:line 35 x2Apps.CheckPlaca.App.Android C:\Users\mario.nuget\packages\xamarin.androidx.migration\1.0.0-preview02\build\Xamarin.AndroidX.Migration.targets 182

Setting the DotfuscatorXamarinEnabled option to FALSE in my csproj solves the problem.

Static PreferenceManager.GetDefaultSharedPreferences missing.

Xamarin.Android Version (eg: 6.0):

Microsoft Visual Studio Community 2019
Version 16.4.2
Microsoft .NET Framework
Version 4.8.03752
Xamarin.Android SDK 10.1.1.0 (d16-4/f2c9364)

Operating System & Version (eg: Mac OSX 10.11):

Windows 10 (1909)

Support Libraries Version (eg: 23.3.0):

Xamarin.AndroidX.Preference 1.1.0-rc1

Describe your Issue:

PreferenceManager.GetDefaultSharedPreferences(this.context)
Error CS0117 'PreferenceManager' does not contain a definition for 'GetDefaultSharedPreferences'

The only static member available on PreferenceManager is SetDefaultValues (and the ones from base Object).

com.google.android.material-1.1.0-rc1 error on build

Need to add these lines to com.google.android.material/material/transforms/Metadata.xml for 1.1.0-rc1:

<remove-node path="/api/package[@name='com.google.android.material.button']/interface[@name='MaterialButton.OnPressedChangeListener']" />
<remove-node path="/api/package[@name='com.google.android.material.datepicker']/interface[@name='MaterialCalendar.OnDayClickListener']" />
<remove-node path="/api/package[@name='com.google.android.material.bottomappbar']/interface[@name='BottomAppBar.AnimationListener']" />

[Bug] [Android] System.IO.FileNotFoundException when <BundleAssemblies>True</BundleAssemblies>

Description

After upgrade from Xamarin.Forms 4.4.0.991640 to 4.5.282-pre4 I noticed that when

<BundleAssemblies>True</BundleAssemblies>

app crash on start with exception

System.IO.FileNotFoundException: Could not load file or assembly 'Xamarin.AndroidX.AppCompat.Resources, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.

My working setup for release in 4.4 is

<AndroidLinkMode>Full</AndroidLinkMode>
<AotAssemblies>True</AotAssemblies>
<AndroidEnableProfiledAot>false</AndroidEnableProfiledAot>
<EnableLLVM>True</EnableLLVM>
<BundleAssemblies>True</BundleAssemblies>

in 4.5 everything works fine only if

<AndroidLinkMode>Full</AndroidLinkMode>
<AotAssemblies>True</AotAssemblies>
<AndroidEnableProfiledAot>false</AndroidEnableProfiledAot>
<EnableLLVM>True</EnableLLVM> 
<BundleAssemblies>False</BundleAssemblies>

Steps to Reproduce

  1. Create new solution
  2. Upgrade Xamarin to 4.5.0.282-pre4
  3. Set:
<AndroidLinkMode>Full</AndroidLinkMode>
<AotAssemblies>True</AotAssemblies>
<AndroidEnableProfiledAot>false</AndroidEnableProfiledAot>
<EnableLLVM>True</EnableLLVM>
<BundleAssemblies>True</BundleAssemblies>
  1. Run app on the real device

Expected Behavior

App starts.

Actual Behavior

App crash with System.IO.FileNotFoundException exception.

Basic Information

  • Version with issue: 4.5.0.282-pre4
  • Last known good version: 4.4.0.991640
  • IDE: Visual Studio 2019
  • Platform Target Frameworks:
    • Android: Xamarin.Android 10.1
  • Android Support Library Version: 28.0.0.03, AndroidX 1.1.0
  • Nuget Packages:
  • Affected Devices: all

Unable to build app when using AndroidX.Lifecycle.Lifecycle.Event

Xamarin.Android Version (eg: 6.0):

9.5.0.27

Operating System & Version (eg: Mac OSX 10.11):

Windows 10 1903
VS 16.3.0 Preview 1

Support Libraries Version (eg: 23.3.0):

AndroidX 1.0 Preview 1

Describe your Issue:

Errors when building application.
Looks like annotations in file "source/androidx.lifecycle/lifecycle-common/additions/Additions.cs" are outdated:
[Annotation("android.arch.lifecycle.OnLifecycleEvent(android.arch.lifecycle.Lifecycle.Event.ON_CREATE)")]

Steps to Reproduce (with link to sample solution if possible):

Use code with attribute such as:
[Lifecycle.Event.OnStart()]
[Export]
public void OnAppForegrounded()

Include any relevant Exception Stack traces, build logs, adb logs:

Found in build traces:
error: package android.arch.lifecycle does not exist
javac.exe error : @android.arch.lifecycle.OnLifecycleEvent(android.arch.lifecycle.Lifecycle.Event.ON_START)

Binding AAR library that contains AndroidX cause "NoClassDefFoundError" for "androidx/lifecycle/LifecycleOwner"

Xamarin.Android Version (eg: 6.0):

Xamarin.Android SDK 9.1.7.0 (HEAD/ba9da7a76)
Xamarin.Android Reference Assemblies and MSBuild support.

Operating System & Version (eg: Mac OSX 10.11):

Windows 10

Microsoft Visual Studio Professional 2017
Version 15.9.16
VisualStudio.15.Release/15.9.16+28307.858
Microsoft .NET Framework
Version 4.8.03752

Support Libraries Version (eg: 23.3.0):

Xamarin.AndroidX.Lifecycle.Common v2.0.0-preview02

Describe your Issue:

Trying to create an AAR binding library that migrated to AndroidX (written in Java, using class androidx.lifecycle.LifecycleOwner), previously using support library and compiling correctly.

Xamarin.AndroidX.Lifecycle.Common dependency is added to the binding project, however still encountering the following error log:
https://pdftron.s3.amazonaws.com/custom/external/xamarin/androidx/androidx-error.txt

4>JARTOXML : warning J2XA006: missing class error was raised while reflecting com.pdftron.pdf.controls.AnnotationToolbar : androidx/lifecycle/LifecycleOwner
4>  java.lang.NoClassDefFoundError: androidx/lifecycle/LifecycleOwner (TaskId:138)
4>    at java.lang.ClassLoader.defineClass1(Native Method) (TaskId:138)
4>    at java.lang.ClassLoader.defineClass(ClassLoader.java:760) (TaskId:138)
4>    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) (TaskId:138)

Steps to Reproduce (with link to sample solution if possible):

Download the sample project, open solution "\projectSrc\PDFNetAndroidXamarin\PDFNetAndroidXamarin.sln"
Clean and build "PDFViewCtrlTools" project.

Link to sample:
http://pdftron.s3.amazonaws.com/custom/external/xamarin/androidx/to-Xamarin.zip

Include any relevant Exception Stack traces, build logs, adb logs:

https://pdftron.s3.amazonaws.com/custom/external/xamarin/androidx/androidx-error.txt

MediaRouter : OnDynamicRoutesChangedListener is not public in DynamicGroupRouteController

Xamarin.Android Version (eg: 6.0):

Xamarin.Android SDK 10.1.0.30 (d16-4/5e2fd06)

Operating System & Version (eg: Mac OSX 10.11):

Windows 10

Microsoft Visual Studio Enterprise 2019
Version 16.4.0
VisualStudio.16.Release/16.4.0+29519.181
Microsoft .NET Framework
Version 4.8.03752

Installed Version: Enterprise
...

Mono Debugging for Visual Studio 16.5.23 (1b51e8c)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager 5.4.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

...

VisualStudio.Mac 1.0
Mac Extension for Visual Studio

Xamarin 16.4.000.305 (d16-4@a9ec5d9)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 16.4.0.464 (remotes/origin/d16-4@4abf337c3)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 16.4.25 (579ee62)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 10.1.0.30 (d16-4/5e2fd06)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: e1ef774
Java.Interop: xamarin/java.interop@c4e569f
ProGuard: xamarin/proguard@905836d
SQLite: xamarin/sqlite@46204c4
Xamarin.Android Tools: xamarin/xamarin-android-tools@9f4ed4b

Xamarin.iOS and Xamarin.Mac SDK 13.8.2.2 (44c08f2)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

Support Libraries Version (eg: 23.3.0):

Xamarin.AndroidX.MediaRouter 1.1.0-preview06

Describe your Issue:

After updating from preview03 to preview06 I get the following build error (javac.exe error JAVAC0000)

OnDynamicRoutesChangedListener is not public in DynamicGroupRouteController; cannot be accessed from outside package
androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController.OnDynamicRoutesChangedListener Sample.Android C:\Projekte\xamarin-fingerprint\src\Sample.Android\obj\Debug\90\android\src\mono\androidx\mediarouter\media\MediaRouteProvider_DynamicGroupRouteController_OnDynamicRoutesChangedListenerImplementor.java 8

Steps to Reproduce (with link to sample solution if possible):

  1. checkout: smstuebe/xamarin-fingerprint@a5973df
  2. build: Sample.Android

Originally explicit return type now bound as Java.Lang.Object

Xamarin.Android Version (eg: 6.0):

Xamarin Android 10.1

Operating System & Version (eg: Mac OSX 10.11):

Windows 10 Build 1903

Support Libraries Version (eg: 23.3.0):

Example: Xamarin-AndroidX.Preference 1.0.0-preview06

Describe your Issue:

It seems that since preview03 of the AndroidX libraries some methods previously bound to a explicit return type now only return Java.Lang.Object.

For example, since 1.0.0-preview03 the method public <T extends Preference> findPreference (CharSequence key) (and its overloads) in PreferenceFragmentCompat, which was previously bound with a Preference return type, is now bound with a Java.Lang.Object return type.

While casting this Object to a Preference does work fine, it does add a extra layer of casting not originally present.

The issue seems to be related to the method return types being a implicit generic <T extends Preference> rather than the explicit return types these methods used to have in the pre-AndroidX support libraries.
Though the return type is defined as generic, a subclass of Preference is guaranteed through the extends Preference condition, so abstraction as far as Java.Lang.Object should not be necessary.

Duplicate type in Xamarin.AndroidX.Media/Xamarin.Android.Support.Media.Compat

Xamarin.Android Version (eg: 6.0):

16.6

Operating System & Version (eg: Mac OSX 10.11):

Windows

Support Libraries Version (eg: 23.3.0):

Xamarin.Android.Support.Media.Compat: 28.0.0.3
Xamarin.AndroidX.Media: 1.1.0

Describe your Issue:

Noticeable in https://github.com/toggl/mobileapp

The type Android.Support.V4.Media.Session.MediaSessionCompat.IOnActiveChangeListenerImplementor is in both Xamarin.AndroidX.Media.dll and Xamarin.Android.Support.Media.Compat.dll.

Among other problems this causes the Android designer to bark at the situation and disable custom controls rendering.

Since the type is autogenerated by Xamarin.Android there is likely a corner case somewhere.

AndroidX Migration w/ Xamarin.Forms 4.5.0.356 [Bug]

Description

After installing Xamarin.Forms 4.5.0.356 and updating all AndroidX packages the rebuild process produces the following error:

../Test/packages/Xamarin.AndroidX.Migration.1.0.0/build/monoandroid90/Xamarin.AndroidX.Migration.targets(9,9): Error: Could not find 1 Android X assemblies, make sure to install the following NuGet packages:
 - Xamarin.AndroidX.AppCompat.Resources
You can also copy-and-paste the following snippet into your .csproj file:
    <PackageReference Include="Xamarin.AndroidX.AppCompat.Resources" Version="1.1.0" /> (Test.Droid)

Steps to Reproduce

  1. Open Visual Studio for Mac v8.4.8
  2. Create a new Solution. Native App (iOS, Android)
  3. Retarget the .Droid project for Android 10.0. Set the minimum android version to 7.1
  4. Retarget all of the packages in the .Droid project. Add Xamarin.Forms 4.5.0.356 from Nuget.
  5. Wait for all packages to install
  6. Rebuild the .Droid application, a single error gets produced
../Test/packages/Xamarin.AndroidX.Migration.1.0.0/build/monoandroid90/Xamarin.AndroidX.Migration.targets(9,9): Error: Could not find 1 Android X assemblies, make sure to install the following NuGet packages:
 - Xamarin.AndroidX.AppCompat.Resources
You can also copy-and-paste the following snippet into your .csproj file:
    <PackageReference Include="Xamarin.AndroidX.AppCompat.Resources" Version="1.1.0" /> (Test.Droid)

Expected Behavior

The .Droid project rebuilds without errors.

Actual Behavior

Produces the error mentioned in the description:

../Test/packages/Xamarin.AndroidX.Migration.1.0.0/build/monoandroid90/Xamarin.AndroidX.Migration.targets(9,9): Error: Could not find 1 Android X assemblies, make sure to install the following NuGet packages:
 - Xamarin.AndroidX.AppCompat.Resources
You can also copy-and-paste the following snippet into your .csproj file:
    <PackageReference Include="Xamarin.AndroidX.AppCompat.Resources" Version="1.1.0" /> (Test.Droid)

Basic Information

  • Version with issue: 4.5.0.356
  • Last known good version: 4.4.0.991640
  • IDE: Visual Studio Xamarin 8.4.8
  • Platform Target Frameworks:
    • Android: 10.0
  • Nuget Packages:
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="monoandroid10.0" />
<package id="Plugin.CurrentActivity" version="2.1.0.4" targetFramework="monoandroid10.0" />
<package id="Plugin.Share" version="7.1.1" targetFramework="monoandroid10.0" />
<package id="Xam.Plugin.Connectivity" version="3.2.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Arch.Core.Common" version="1.1.1.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Arch.Core.Runtime" version="1.1.1.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Arch.Lifecycle.Common" version="1.1.1.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Arch.Lifecycle.LiveData" version="1.1.1.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Arch.Lifecycle.LiveData.Core" version="1.1.1.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Arch.Lifecycle.Runtime" version="1.1.1.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Arch.Lifecycle.ViewModel" version="1.1.1.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.Animated.Vector.Drawable" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.Annotations" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.AsyncLayoutInflater" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.Collections" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.Compat" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.CoordinaterLayout" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.Core.UI" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.Core.Utils" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.CursorAdapter" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.CustomTabs" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.CustomView" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.Design" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.DocumentFile" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.DrawerLayout" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.Fragment" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.Interpolator" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.Loader" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.LocalBroadcastManager" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.Media.Compat" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.Print" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.SlidingPaneLayout" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.SwipeRefreshLayout" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.Transition" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.v4" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.v7.AppCompat" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.v7.CardView" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.v7.RecyclerView" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.Vector.Drawable" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.VersionedParcelable" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.Android.Support.ViewPager" version="28.0.0.3" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.Activity" version="1.0.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.Annotation" version="1.1.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.AppCompat" version="1.1.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.AppCompat.Resources" version="1.1.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.Arch.Core.Common" version="2.1.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.Arch.Core.Runtime" version="2.1.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.AsyncLayoutInflater" version="1.0.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.Browser" version="1.0.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.CardView" version="1.0.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.Collection" version="1.1.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.CoordinatorLayout" version="1.1.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.Core" version="1.1.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.CursorAdapter" version="1.0.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.CustomView" version="1.0.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.DocumentFile" version="1.0.1" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.DrawerLayout" version="1.0.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.Fragment" version="1.1.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.Interpolator" version="1.0.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.Legacy.Support.Core.UI" version="1.0.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.Legacy.Support.Core.Utils" version="1.0.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.Legacy.Support.V4" version="1.0.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.Lifecycle.Common" version="2.1.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.Lifecycle.LiveData" version="2.1.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.Lifecycle.LiveData.Core" version="2.1.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.Lifecycle.Runtime" version="2.1.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.Lifecycle.ViewModel" version="2.1.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.Loader" version="1.1.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.LocalBroadcastManager" version="1.0.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.Media" version="1.1.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.Migration" version="1.0.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.MultiDex" version="2.0.1" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.Print" version="1.0.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.RecyclerView" version="1.1.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.SavedState" version="1.0.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.SlidingPaneLayout" version="1.0.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.SwipeRefreshLayout" version="1.0.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.Transition" version="1.2.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.VectorDrawable" version="1.1.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.VectorDrawable.Animated" version="1.1.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.VersionedParcelable" version="1.1.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.AndroidX.ViewPager" version="1.0.0" targetFramework="monoandroid10.0" />
<package id="Xamarin.Forms" version="4.5.0.356" targetFramework="monoandroid10.0" />
<package id="Xamarin.Google.Android.Material" version="1.0.0" targetFramework="monoandroid10.0" />
  • Affected Devices: All emulated devices. Also tested with Galaxy S8, Galaxy S9 and Google Pixel 4

Screenshots

Screen Shot 2020-03-05 at 3 18 28 PM

Reproduction Link

Open the zipped file below. The "Steps to Reproduce" are applied to the android project inside of the solution.

Test.zip

Workaround

No workaround was found. :(

Types from Xamarin.AndroidX.AppCompat.Resource not mapped correctly for preview03 packages

After upgrading to the preview03 versions of the support packages builds started failing for my Xamarin Forms Android project with the following error message:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2105,5): error MSB4018: The "LinkAssemblies" task failed unexpectedly. 
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2105,5): error MSB4018: Java.Interop.Tools.Diagnostics.XamarinAndroidException: error XA2006: Could not resolve reference to 'AndroidX.AppCompat.Graphics.Drawable.DrawableWrapper' (defined in assembly 'Xamarin.Forms.Platform.Android, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null') with scope 'Xamarin.AndroidX.AppCompat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. When the scope is different from the defining assembly, it usually means that the type is forwarded. ---> Mono.Cecil.ResolutionException: Failed to resolve AndroidX.AppCompat.Graphics.Drawable.DrawableWrapper

The linker seems to be looking for the DrawableWrapper definition in the Xamarin.AndroidX.AppCompat assembly, which is where it was defined prior to the preview03 release of the support package. It seems this type along with a few others were moved into a new Android library, androidx.appcompat.appcompat-resources, so they are now located in a new assembly for the Xamarin Android support packages, Xamarin.AndroidX.AppCompat.Resources.

I was able to get the build working by adding a _AndroidXAssembly definition for Xamarin.Android.AppCompat.Resources in Xamarin.AndroidX.Migration.props, and also updating the AndroidX .NET Assembly column values to Xamarin.AndroidX.AppCompat.Resources in androidx-mapping.csv for the types:

AndroidX.AppCompat.Graphics.Drawable.AnimatedStateListDrawableCompat
AndroidX.AppCompat.Graphics.Drawable.DrawableWrapper
AndroidX.AppCompat.Content.Res.AppCompatResources
AndroidX.AppCompat.Widget.DrawableUtils
AndroidX.AppCompat.Widget.TintContextWrapper
AndroidX.AppCompat.Widget.VectorEnabledTintResources

Add the new assemblies and artifacts to the migration .props

The list of Android Support and Android X assemblies need to be updated in the Xamarin.AndroidX.Migration.props.

These lists are simply to help the build skip out the assemblies we KNOW are already migrated - Android X is already Android X, or that should NOT be migrated - Android Support is never going to reach the device.

There is also a list of Android X artifacts that we know should not even be opened.

All of this is to speed up the build. Since the types are already Android X, they should never need updating and will be skipped. But 70+ dlls and 70+ jars does mean that it takes a good few milliseconds more than necessary.

Could not load file or assembly 'Xamarin.AndroidX.AppCompat.Resources'

Xamarin.Android Version (eg: 6.0):

Version: 10.1.3.7

Operating System & Version (eg: Mac OSX 10.11):

Mac OSX 10.15.2

Support Libraries Version (eg: 23.3.0):

28.0.3

Describe your Issue:

It works well until previous version a few days ago, but build error occurs today, then I upgrade dependency libraries to the newest, error changes to:

<PackageReference Include="Xamarin.AndroidX.Migration">
      <Version>1.0.0-preview05</Version>
      <Version>1.0.0-rc1</Version>
</PackageReference>
[MonoDroid] System.IO.FileNotFoundException: Could not load file or assembly 'Xamarin.AndroidX.AppCompat.Resources, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
[MonoDroid] File name: 'Xamarin.AndroidX.AppCompat.Resources, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
[MonoDroid]   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].Start[TStateMachine] (TStateMachine& stateMachine) [0x0002c] in <6b940a667a274fa48104ab71b2541709>:0 
[MonoDroid]   at Xamarin.Forms.Platform.Android.ResourceManager.GetFormsDrawableAsync (Android.Content.Context context, Xamarin.Forms.ImageSource imageSource, System.Threading.CancellationToken cancellationToken) [0x00033] in <a38b08ed6ae34fcca788cdc23b3fac01>:0 
[MonoDroid]   at Xamarin.Forms.Platform.Android.BottomNavigationViewUtils.SetMenuItemIcon (Android.Views.IMenuItem menuItem, Xamarin.Forms.ImageSource source, Android.Content.Context context) [0x00017] in <a38b08ed6ae34fcca788cdc23b3fac01>:0 
[MonoDroid]   at Xamarin.Forms.Platform.Android.BottomNavigationViewUtils.SetupMenu (Android.Views.IMenu menu, System.Int32 maxBottomItems, System.Collections.Generic.List`1[T] items, System.Int32 currentIndex, Google.Android.Material.BottomNavigation.BottomNavigationView bottomView, Android.Content.Context context) [0x001c8] in <a38b08ed6ae34fcca788cdc23b3fac01>:0 
[MonoDroid]   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) [0x00000] in <6b940a667a274fa48104ab71b2541709>:0 
[MonoDroid]   at Android.App.SyncContext+<>c__DisplayClass2_0.<Post>b__0 () [0x00000] in <78bc2a97e5be434ba8d7b494fe3c28fb>:0 
[MonoDroid]   at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <78bc2a97e5be434ba8d7b494fe3c28fb>:0 
[MonoDroid]   at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <78bc2a97e5be434ba8d7b494fe3c28fb>:0 
[MonoDroid]   at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.44(intptr,intptr)

Steps to Reproduce (with link to sample solution if possible):

Include any relevant Exception Stack traces, build logs, adb logs:

Android designer issue

after migrating it is the designer doesn't render controls from Android Support Library, instead youre asked to perform a nuget restore which does nothing. please fix this soon.

MotionLayout.ITransitionListener missing parameter names

Copy of this issue: xamarin/AndroidSupportComponents#225

Support Libraries Version (eg: 23.3.0):

Xamarin.Android.Support.Constraint.Layout 2.0.0-beta2
Xamarin.Android.Support.Constraint.Layout.Solver 2.0.0-beta2

Describe your Issue:

The interface ITransitionListner just has p0, p1, p2, p3 as names for the arguments you can pass into the method it defines.

void OnTransitionChange(MotionLayout p0, int p1, int p2, float p3)
void OnTransitionCompleted(MotionLayout p0, int p1)
void OnTransitionStarted(MotionLayout p0, int p1, int p2)
void OnTransitionTrigger(MotionLayout p0, int p1, bool p2, float p3)

I would expect them to be:

void OnTransitionChange(MotionLayout motionLayout, int startId, int endId, float progress) 
void OnTransitionCompleted(MotionLayout motionLayout, int currentId) 
void OnTransitionStarted(MotionLayout motionLayout, int startId, int endId) 
void OnTransitionTrigger(MotionLayout motionLayout, int triggerId, bool positive, float progress) 

See: https://developer.android.com/reference/androidx/constraintlayout/motion/widget/MotionLayout.TransitionListener

Steps to Reproduce (with link to sample solution if possible):

  1. Add Xamarin.Android.Support.Constraint.Layout 2.0.0-beta2
  2. Implement MotionLayout.ITransitionListener: private class MotionLayoutListener : Java.Lang.Object, MotionLayout.ITransitionListener
  3. Ask VS to implement methods

AndroidX Migration Fails with The Method or operation is not implemented

Visual Studio 2019 16.4

Callstack of the exception

The method or operation is not implemented.
at Mono.Cecil.Pdb.NativePdbWriterProvider.GetSymbolWriter(ModuleDefinition module, Stream symbolStream)
at Mono.Cecil.Pdb.PdbWriterProvider.GetSymbolWriter(ModuleDefinition module, Stream symbolStream)
at Mono.Cecil.ModuleWriter.GetSymbolWriter(ModuleDefinition module, String fq_name, ISymbolWriterProvider symbol_writer_provider, WriterParameters parameters)
at Mono.Cecil.ModuleWriter.Write(ModuleDefinition module, Disposable1 stream, WriterParameters parameters) at Mono.Cecil.ModuleWriter.WriteModule(ModuleDefinition module, Disposable1 stream, WriterParameters parameters)
at Mono.Cecil.ModuleDefinition.Write(String fileName, WriterParameters parameters)
at Xamarin.AndroidX.Migration.CecilMigrator.Migrate(String source, String destination) in D:\a\1\s\source\Xamarin.AndroidX.Migration\Migration\CecilMigrator.cs:line 117
at Xamarin.AndroidX.Migration.CecilMigrator.Migrate(IEnumerable`1 assemblies) in D:\a\1\s\source\Xamarin.AndroidX.Migration\Migration\CecilMigrator.cs:line 50
at Xamarin.AndroidX.Migration.BuildTasks.CecilfyFiles.Execute() in D:\a\1\s\source\Xamarin.AndroidX.Migration\BuildTasks\CecilfyFiles.cs:line 35 Muellerchur.Xamos.Mobile.Android

I attached a debugger and disassembled the method.

And the method has this Implementation.

public ISymbolWriter GetSymbolWriter(ModuleDefinition module, Stream symbolStream)
    {
      throw new NotImplementedException();
    }		

So it isn't implemented.

ACW javac error JAVAC0000: error: PagedListListener is not public in AsyncPagedListDiffer;

DevOps CI error

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(535,3): warning XA0119: Using Fast Deployment and a Code Shrinker at the same time is not recommended. Use Fast Deployment for Debug configurations and a Code Shrinker for Release configurations. [/Users/runner/runners/2.165.0/work/1/s/samples/BuildAll/BuildAll/BuildAll.csproj]
obj/Debug/android/src/mono/androidx/paging/AsyncPagedListDiffer_PagedListListenerImplementor.java(8,39): javac error JAVAC0000:  error: PagedListListener is not public in AsyncPagedListDiffer; cannot be accessed from outside package [/Users/runner/runners/2.165.0/work/1/s/samples/BuildAll/BuildAll/BuildAll.csproj]
obj/Debug/android/src/mono/androidx/paging/AsyncPagedListDiffer_PagedListListenerImplementor.java(8,39): javac error JAVAC0000: 		androidx.paging.AsyncPagedListDiffer.PagedListListener [/Users/runner/runners/2.165.0/work/1/s/samples/BuildAll/BuildAll/BuildAll.csproj]
obj/Debug/android/src/mono/androidx/paging/AsyncPagedListDiffer_PagedListListenerImplementor.java(8,39): javac error JAVAC0000:  [/Users/runner/runners/2.165.0/work/1/s/samples/BuildAll/BuildAll/BuildAll.csproj]
obj/Debug/android/src/mono/androidx/work/impl/background/systemalarm/SystemAlarmDispatcher_CommandsCompletedListenerImplementor.java(8,66): javac error JAVAC0000:  error: CommandsCompletedListener is not public in SystemAlarmDispatcher; cannot be accessed from outside package [/Users/runner/runners/2.165.0/work/1/s/samples/BuildAll/BuildAll/BuildAll.csproj]
obj/Debug/android/src/mono/androidx/work/impl/background/systemalarm/SystemAlarmDispatcher_CommandsCompletedListenerImplementor.java(8,66): javac error JAVAC0000: 		androidx.work.impl.background.systemalarm.SystemAlarmDispatcher.CommandsCompletedListener [/Users/runner/runners/2.165.0/work/1/s/samples/BuildAll/BuildAll/BuildAll.csproj]
obj/Debug/android/src/mono/androidx/work/impl/background/systemalarm/SystemAlarmDispatcher_CommandsCompletedListenerImplementor.java(8,66): javac error JAVAC0000:  [/Users/runner/runners/2.165.0/work/1/s/samples/BuildAll/BuildAll/BuildAll.csproj]

Xamarin.AndroidX.Navigation.Runtime

AndroidX.Navigation NavController DestinationChangedEventArgs still using P0, P1, P2 variables for NavController, NavDestination and Bundle.

Compiler Issue with AndroidX.RecyclerView

Xamarin.Android Version (eg: 6.0):

Xamarin.Android Reference Assemblies and MSBuild support.
    Mono: fd9f379
    Java.Interop: xamarin/java.interop/d16-4@c4e569f
    ProGuard: xamarin/proguard/master@905836d
    SQLite: xamarin/sqlite/3.28.0@46204c4
    Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-5@9f4ed4b

Operating System & Version (eg: Mac OSX 10.11):

  • Windows 10 18363
  • Visual Studio 16.4.5

Support Libraries Version (eg: 23.3.0):

  • Xamarin.Android Support Libraries 28.0.0.3 (see repro project for details)
  • Compile with: Android 10 Q
  • Target SDK: 29
  • Min SDK: 15

Describe your Issue:

When a Xamarin.Forms component has a dependency on Android.Support.v7.RecyclerView, the AndroidX RecyclerView type is used by accident when the project's Linker is set to SDK Assemblies Only

This results in an a build error claiming the setHasStableIds method cannot be resolved.

Steps to Reproduce (with link to sample solution if possible):

Setup

  1. Download the reproducible project from here (all assembly references and NuGet packages are installed).
  2. Make sure project in Release configuration and the Android project is set as Startup

Run 1 - Control Test

  1. Set LinkerBehavior to None
  2. Rebuild Solution (to restore NuGet packages and complete 1st build)
  3. => Observe a successful build

Run 2 - Reproducible Test

  1. Set LinkerBehavior to SDK Assemblies Only
  2. Clean project and Rebuild
  3. => Observe the error listed below.

Include any relevant Exception Stack traces, build logs, adb logs:

Error Mono.Linker.MarkException: Error processing method: 'System.Void Telerik.XamarinForms.DataControlsRenderer.Android.ItemsControlRenderer::OnElementAttached(Telerik.XamarinForms.DataControls.ItemsControl)' in assembly: 'Telerik.XamarinForms.DataControls.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void AndroidX.RecyclerView.Widget.RecyclerView/Adapter::set_HasStableIds(System.Boolean)

Telerik Code

The location that error is thrown in in our adapter class. I am unable to share the full source code, but I can still identify how we're expecting the type to be android.support.v7.widget.RecyclerView

Notice the following:

  1. The class imports android.support.v7.widget.RecyclerView
  2. The CTOR is expecting setHasStableIds() to be available in the SDK's RecyclerView Adapter
import android.support.v7.widget.RecyclerView;
...

public abstract class ListViewAdapterBase extends RecyclerView.Adapter<ListViewHolder> {
    ...
    public ListViewAdapterBase() {
        [dedacted]
        [dedacted]
        [dedacted]
        this.setHasStableIds(true);
    }
    ...
}

Workaround Attempt

I tried to avoid this by telling the compiler to linkskip Xamarin.Android.Support.v7.RecyclerView. However, it doesn't work. Is there another assembly I can add to workaround the issue?

the only solution I could find was to uninstall Xamarin.AndroidX.RecyclerView. Once it (and dependencies) were uninstalled, the build works when linking out SDK Assemblies.

Assembly 'Xamarin.Android.Support.v4' is using '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported.

Xamarin.Android Version (eg: 6.0):

AndroidX

Operating System & Version (eg: Mac OSX 10.11):

MacOSX builds on Azure DevOps

Support Libraries Version (eg: 23.3.0):

Describe your Issue:

Error

An error occurred when executing task 'migration-tests'.

Details

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(514,3): error XA0121: Assembly 'Xamarin.Android.Support.v4' is using '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author. [/Users/runner/runners/2.164.6/work/1/s/tests/AndroidXMigrationTests/Aarxercise.Old.Support/Aarxercise.Old.Support.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(514,3): error XA0121: Assembly 'Xamarin.Android.Support.v4' is using '[assembly: Java.Interop.JavaLibraryReferenceAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author. [/Users/runner/runners/2.164.6/work/1/s/tests/AndroidXMigrationTests/Aarxercise.Old.Support/Aarxercise.Old.Support.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(514,3): error XA0121: Assembly 'Xamarin.Android.Support.v4' is using '[assembly: Android.IncludeAndroidResourcesFromAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author. [/Users/runner/runners/2.164.6/work/1/s/tests/AndroidXMigrationTests/Aarxercise.Old.Support/Aarxercise.Old.Support.csproj]

Steps to Reproduce (with link to sample solution if possible):

Include any relevant Exception Stack traces, build logs, adb logs:

Originally explicit Preference return type now bound as Java.Lang.Object

Xamarin.Android Version (eg: 6.0):

Microsoft Visual Studio Professional 2019
Version 16.4.2
VisualStudio.16.Release/16.4.2+29613.14
Microsoft .NET Framework
Version 4.8.03752

Xamarin.Android SDK 10.1.1.0 (d16-4/f2c9364)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: bef1e63
Java.Interop: xamarin/java.interop@c4e569f
ProGuard: xamarin/proguard@905836d
SQLite: xamarin/sqlite@46204c4
Xamarin.Android Tools: xamarin/xamarin-android-tools@9f4ed4b

Operating System & Version (eg: Mac OSX 10.11):

Windows 10 (1909)

Support Libraries Version (eg: 23.3.0):

Xamarin.AndroidX.Preference 1.1.0-rc1

Describe your Issue:

As described in issue #19, the originally explicit Preference return values for the "findPreference" methods were bound as Java.Lang.Object since preview03. A fix was made to the transform metadata in commit 7a839db but release 1.1.0-rc1 following this fix still has the generic return type binding. As requested in the original issue I have opened a new issue on this.

Excerpt from PreferenceFragmentCompat object metadata:

public Java.Lang.Object FindPreference(string key);
[JavaTypeParameters(new[] { "T extends androidx.preference.Preference" })]
[Register("findPreference", "(Ljava/lang/CharSequence;)Landroidx/preference/Preference;", "GetFindPreference_Ljava_lang_CharSequence_Handler")]
public virtual Java.Lang.Object FindPreference(ICharSequence key);

Authenticating with BiometricPrompt during OnResume()

Xamarin.Android Version (eg: 6.0):

9.0

Operating System & Version (eg: Mac OSX 10.11):

Winsdows 10

Support Libraries Version (eg: 23.3.0):

AndroidX v1.0.0-rc1

Describe your Issue:

W/BiometricPromptCompat( 5060): Not launching prompt. authenticate() called after onSaveInstanceState()

Calling the Biometric Prompt during OnResume() dismisses the dialog with an error saying that the prompt cannot be launched after onSaveInstanceState() has been called.

Wrapping the call to BiometricManager in a fragment transaction with CommitAllowingStateLoss() also does not have any effect

Steps to Reproduce (with link to sample solution if possible):

Calling the Biometric Prompt during OnResume()

        public async Task<bool> Authenticate(CancellationToken cancellationToken)
        {
            var promptInfo = new BiometricPrompt.PromptInfo.Builder()
                .SetTitle("Login")
                .SetNegativeButtonText("Cancel")
                .Build();

            var activity = _activityResolver();
            var executor = Executors.NewSingleThreadExecutor();
            var handler = new BiometricsAuthenticationHandler();

            using var dialog = new BiometricPrompt((FragmentActivity) activity, executor, handler);
            await using (cancellationToken.Register(() => dialog.CancelAuthentication()))
            {
                dialog.Authenticate(promptInfo);
                return await handler.Task;
            }
        }

Include any relevant Exception Stack traces, build logs, adb logs:

W/BiometricPromptCompat( 5060): Not launching prompt. authenticate() called after onSaveInstanceState()

JAR libraries with identical names and inconsistent contents (`lint.jar`)

JAR libraries with identical names and inconsistent contents (lint.jar)

jar-libraries-with-identical-names-and-inconsistent-contents-lint-jar.md

Blocking issue for newest AndroidX updates (also needed for GPS-FB with AndroidX prerelease)

dotnet cake -t=clean && dotnet cake -t=ci

Building samples results in following error:

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1092,3): 
error : 
You have Jar libraries, 
    lint.jar, 
    lint.jar, 
    lint.jar, 
that have the identical name with inconsistent file contents. 
Please make sure to remove any conflicting libraries in EmbeddedJar, InputJar and AndroidJavaLibrary. 
[samples/BuildAll/BuildAll/BuildAll.csproj]

3 lint.jar files are dependencies for 3 artifacts:

$ find . -type f -name lint.jar -exec ls -al {} \;
33755 Feb  1  1980 ./externals/androidx.fragment/fragment/lint.jar
20773 Feb  1  1980 ./externals/androidx.work/work-runtime/lint.jar
10997 Feb  1  1980 ./externals/androidx.annotation/annotation-experimental/lint.jar

Attempt No.1 - remove physically 3 lint.jar files from externals/ folder:

Link:

https://github.com/xamarin/AndroidX/blob/master_based_updates_202002/build.cake#L224-L254

Code:

Task ("binderate")
	.IsDependentOn("binderate-config-verify")
	.Does (() =>
{
	var configFile = MakeAbsolute(new FilePath("./config.json")).FullPath;
	var basePath = MakeAbsolute(new DirectoryPath ("./")).FullPath;

	// Run the dotnet tool for binderator
	RunProcess("xamarin-android-binderator",
		$"--config=\"{configFile}\" --basepath=\"{basePath}\"");

	// format the targets file so they are pretty in the package
	var targetsFiles = GetFiles("generated/**/*.targets");
	var xmlns = (XNamespace)"http://schemas.microsoft.com/developer/msbuild/2003";
	foreach (var targets in targetsFiles) {
		var xdoc = XDocument.Load(targets.FullPath);
		xdoc.Save(targets.FullPath);
	}

	// different lint.jar files in artifacts causing R8 errors
	FilePathCollection files = GetFiles("./externals/**/lint.jar");
	foreach(FilePath file in files)
	{
		Information($"Deleting: {file}");
		if (cleanup)
		{
			DeleteFile(file);
		}
	}

});

Attempt No.2 was to change binderator Razor project template

Link:

https://github.com/xamarin/AndroidX/blob/master_based_updates_202002/source/AndroidXProject.cshtml#L145-L146

Code:

  @if (@Model.MavenArtifacts.Count > 0) {
  <ItemGroup>
    @foreach (var art in @Model.MavenArtifacts) 
    {
      if (art.MavenArtifactPackaging == "aar") 
      {
    <InputJar Include="..\..\externals\@(art.MavenGroupId)\@(art.MavenArtifactId)\classes.jar" />
    <!-- For those artifacts with lib/ folder -->
    <InputJar 
      Condition="Exists('..\..\externals\@(art.MavenGroupId)\@(art.MavenArtifactId)\libs\')"
      Include="..\..\externals\@(art.MavenGroupId)\@(art.MavenArtifactId)\libs\*.jar" 
      />
      } 
      else 
      {
    <InputJar Include="..\..\externals\@(art.MavenGroupId)\@(art.MavenArtifactId).jar" />
      }
    <InputJar Remove="..\..\externals\@(art.MavenGroupId)\@(art.MavenArtifactId)\lint.jar" />
    <InputJar Remove="..\..\externals\@(art.MavenGroupId)\@(art.MavenArtifactId)\**\lint.jar" />
    }
  </ItemGroup>
  }

With both attempts - issue still persists.

Original attribute defined here | already defined with incompatible format

Following the migration steps to migrate to the new AndroidX API's done successfully : Build without error, but After removing Migration package I get a lot of error, this is an excerpt:

...
Error		Original attribute defined here.	MyProject.Android	--PATH HERE -- \MyProject.Android\obj\Debug\100\lp\113\jl\res\values\values.xml	148	
Error		Original attribute defined here.	MyProject.Android	--PATH HERE -- \MyProject.Android\obj\Debug\100\lp\135\jl\res\values\values.xml	31	
Error		Original attribute defined here.	MyProject.Android	--PATH HERE -- \MyProject.Android\obj\Debug\100\lp\135\jl\res\values\values.xml	68	
Error		Original attribute defined here.	MyProject.Android	--PATH HERE -- \MyProject.Android\obj\Debug\100\lp\135\jl\res\values\values.xml	87	

...

Error		Attribute "fontProviderFetchTimeout" already defined with incompatible format.	MyProject.Android	--PATH HERE -- \MyProject.Android\obj\Debug\100\lp\34\jl\res\values\values.xml	52	
Error		Attribute "fontStyle" already defined with incompatible format.	MyProject.Android	--PATH HERE -- \MyProject.Android\obj\Debug\100\lp\34\jl\res\values\values.xml	62	
Error		Attribute "layout_anchorGravity" already defined with incompatible format.	MyProject.Android	--PATH HERE -- \MyProject.Android\obj\Debug\100\lp\35\jl\res\values\values.xml	29	
Error		Attribute "layout_insetEdge" already defined with incompatible format.	MyProject.Android	--PATH HERE -- \MyProject.Android\obj\Debug\100\lp\35\jl\res\values\values.xml	68	
Error		Attribute "layout_dodgeInsetEdges" already defined with incompatible format.	MyProject.Android	--PATH HERE -- \MyProject.Android\obj\Debug\100\lp\35\jl\res\values\values.xml	85	
Error		Attribute "layout_scrollFlags" already defined with incompatible format.	MyProject.Android	--PATH HERE -- \MyProject.Android\obj\Debug\100\lp\41\jl\res\values\values.xml	59	
Error		Attribute "fabAlignmentMode" already defined with incompatible format.	MyProject.Android	--PATH HERE -- \MyProject.Android\obj\Debug\100\lp\41\jl\res\values\values.xml	78	
Error		Attribute "labelVisibilityMode" already defined with incompatible format.	MyProject.Android	--PATH HERE -- \MyProject.Android\obj\Debug\100\lp\41\jl\res\values\values.xml	84	
...

remove Bin & Obj folders, restart vs studio not fixing the problem

  • vs : 2019 16.4.1
  • XF : 4.4.0.991265

can anyone help
Thank you

Missing theme Theme.MaterialComponents.DayNight.DarkActionBar

Xamarin.Android Version (eg: 6.0):

10.1.0.1

Operating System & Version (eg: Mac OSX 10.11):

Windows 10

Support Libraries Version (eg: 23.3.0):

AndroidX Preview 1

Describe your Issue:

Some themes are missing (esp. for DayNight Support)

Steps to Reproduce (with link to sample solution if possible):

Add Nuget package Xamarin.Google.Android.Material and refer to the theme

Include any relevant Exception Stack traces, build logs, adb logs:

Build Error when using the AndroidXMigration Tool.

I am seeing the following build error when using the migration tool

"/Users/dean/Documents/Sandbox/Xamarin/xamarin-android/bin/TestDebug/temp/AndroidXMigrationFalse/UnnamedProject.csproj" (Build;SignAndroidPackage target) (1:7) ->
(_AndroidXJetifyEmbeddedFiles target) -> 
  /Users/dean/.nuget/packages/xamarin.androidx.migration/1.0.0-preview04/build/Xamarin.AndroidX.Migration.targets(279,9): error : Method not found: Xamarin.AndroidX.Migration.MigrationPair Xamarin.AndroidX.Migration.MigrationPair.op_Implicit(System.ValueTuple`2<string, string>) [/Users/dean/Documents/Sandbox/Xamarin/xamarin-android/bin/TestDebug/temp/AndroidXMigrationFalse/UnnamedProject.csproj]
/Users/dean/.nuget/packages/xamarin.androidx.migration/1.0.0-preview04/build/Xamarin.AndroidX.Migration.targets(279,9): error :   at System.Collections.Generic.List`1[T].AddEnumerable (System.Collections.Generic.IEnumerable`1[T] enumerable) [0x00059] in <b814b509d4ad406fb40c6c93e38929e7>:0  [/Users/dean/Documents/Sandbox/Xamarin/xamarin-android/bin/TestDebug/temp/AndroidXMigrationFalse/UnnamedProject.csproj]
/Users/dean/.nuget/packages/xamarin.androidx.migration/1.0.0-preview04/build/Xamarin.AndroidX.Migration.targets(279,9): error :   at System.Collections.Generic.List`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] collection) [0x00062] in <b814b509d4ad406fb40c6c93e38929e7>:0  [/Users/dean/Documents/Sandbox/Xamarin/xamarin-android/bin/TestDebug/temp/AndroidXMigrationFalse/UnnamedProject.csproj]
/Users/dean/.nuget/packages/xamarin.androidx.migration/1.0.0-preview04/build/Xamarin.AndroidX.Migration.targets(279,9): error :   at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x00018] in <549f46d1789f4a51aa5fa1e7d715fe0d>:0  [/Users/dean/Documents/Sandbox/Xamarin/xamarin-android/bin/TestDebug/temp/AndroidXMigrationFalse/UnnamedProject.csproj]
/Users/dean/.nuget/packages/xamarin.androidx.migration/1.0.0-preview04/build/Xamarin.AndroidX.Migration.targets(279,9): error :   at Xamarin.AndroidX.Migration.BuildTasks.JetifyFiles.Execute () [0x000f1] in <c3268ca5c57e420e808ebcfa18e95191>:0  [/Users/dean/Documents/Sandbox/Xamarin/xamarin-android/bin/TestDebug/temp/AndroidXMigrationFalse/UnnamedProject.csproj]

Mono Version: Mono JIT compiler version 6.4.0.198 (2019-06/fe64a4765e6 Wed Sep 18 14:14:51 EDT 2019)
XamarinAndroid: Master.

I am attaching builds logs and the complete zipped directory of a test project.

build.log
msbuild.binlog.zip
AndroidXMigrationTrue.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.