Closed gmck closed 3 months ago
I've already reported this some time ago via #6375, the app still works for me even if you see the messages.
I also see those XA4218
warnings that I think have nor seen before in VS 17.0
Also, deploying an app to the simulator becomes a gamble. 90% of the times when I change my .xml files (e.g. styles.xml) and try to build+deploy the app, if fails with:
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
I also see those
XA4218
warnings that I think have nor seen before in VS 17.0
yes, this is new, but I also get it in VS2019 16.11.10 and started since last AndroidX Nuget updates from end of last week.
@jpobst / @moljac would you know if there is something new about these libraries?
Warning Unable to find //manifest/application/uses-library at path: C:\Program Files (x86)\Android\android-sdk\platforms\android-31\optional\androidx.window.sidecar.jar OBDNowPros C:\ProjectsVS2022Preview\Android12Pros\OBDNowPro\obj\Release\120\android\AndroidManifest.xml
Warning Unable to find //manifest/application/uses-library at path: C:\Program Files (x86)\Android\android-sdk\platforms\android-31\optional\androidx.window.extensions.jar OBDNowPros C:\ProjectsVS2022Preview\Android12Pros\OBDNowPro\obj\Release\120\android\AndroidManifest.xml
Warning Missing class androidx.window.extensions.WindowExtensions (referenced from: androidx.window.extensions.embedding.ActivityEmbeddingComponent androidx.window.embedding.EmbeddingCompat$Companion.embeddingComponent() and 3 other contexts) OBDNowPros C:\ProjectsVS2022Preview\Android12Pros\OBDNowPro\R8
Warning XA4218: Unable to find //manifest/application/uses-library at path: C:\Program Files (x86)\Android\android-sdk\platforms\android-31\optional\androidx.window.sidecar.jar 0
Warning XA4218: Unable to find //manifest/application/uses-library at path: C:\Program Files (x86)\Android\android-sdk\platforms\android-31\optional\androidx.window.extensions.jar
Would these be something new where you define <uses-library>
for these in your AndroidManifest.xml
? We might need to add some build-time support for this.
Also, deploying an app to the simulator becomes a gamble. 90% of the times when I change my .xml files (e.g. styles.xml) and try to build+deploy the app, if fails with:
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== ========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
We are tracking this in https://github.com/xamarin/xamarin-android/issues/6652. The IDE team have an internal ticket which they are working on. I'll keep #6652 as up to date as I can.
@conceptdev Would you be so kind and help? Do you have any experience with this?
@jpobst / @moljac would you know if there is something new about these libraries?
Warning Unable to find //manifest/application/uses-library at path: C:\Program Files (x86)\Android\android-sdk\platforms\android-31\optional\androidx.window.sidecar.jar OBDNowPros C:\ProjectsVS2022Preview\Android12Pros\OBDNowPro\obj\Release\120\android\AndroidManifest.xml Warning Unable to find //manifest/application/uses-library at path: C:\Program Files (x86)\Android\android-sdk\platforms\android-31\optional\androidx.window.extensions.jar OBDNowPros C:\ProjectsVS2022Preview\Android12Pros\OBDNowPro\obj\Release\120\android\AndroidManifest.xml Warning Missing class androidx.window.extensions.WindowExtensions (referenced from: androidx.window.extensions.embedding.ActivityEmbeddingComponent androidx.window.embedding.EmbeddingCompat$Companion.embeddingComponent() and 3 other contexts) OBDNowPros C:\ProjectsVS2022Preview\Android12Pros\OBDNowPro\R8 Warning XA4218: Unable to find //manifest/application/uses-library at path: C:\Program Files (x86)\Android\android-sdk\platforms\android-31\optional\androidx.window.sidecar.jar 0 Warning XA4218: Unable to find //manifest/application/uses-library at path: C:\Program Files (x86)\Android\android-sdk\platforms\android-31\optional\androidx.window.extensions.jar
Would these be something new where you define
<uses-library>
for these in yourAndroidManifest.xml
? We might need to add some build-time support for this.
I cannot find these types in any of Google's AndroidX packages:
androidx.window.extensions.WindowExtensions
androidx.window.extensions.embedding.ActivityEmbeddingComponent
But the latest releases of AndroidX do now generally have a dependency on AndroidX.Window
(via Xamarin.AndroidX.SlidingPaneLayout
).
It's my understanding that the sidecar and extensions code are what we ship on device (ie. Surface Duo), to provide the OEM-specific implementation of the Window Manager dual-screen/foldable API surface. Other OEMS (like Samsung) would ship their own packages (again, in their OS).
Android native (Kotlin/Java) apps that consume AndroidX Window Manager do not reference these libraries via gradle. Not sure where these warnings are coming from in Xamarin.Android.
On maven.google.com I don't see corresponding packages there either.
@jpobst do any of the .aar
files contain an AndroidManifest.xml
file with new <uses-library/>
entries?
Hmm, yes. The androidx.window.window.aar
AndroidManifest.xml
contains:
<application>
<uses-library
android:name="androidx.window.extensions"
android:required="false" />
<uses-library
android:name="androidx.window.sidecar"
android:required="false" />
</application>
Previously these would map to .jar
files in C:\Program Files (x86)\Android\android-sdk\platforms\android-32\optional
:
So I don't understand where these come from now...
@jonathanpeppers, @dellis1972, @jpobst
From the comments above, it would seem that the androidx.window stuff is being addressed, however, there has been no mention of the conflict between the two versions of System.Numeric.Vectors or has it been addressed in another issue?
There was a conflict between "System.Numerics.Vectors, Version=2.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
The solution for this one is to use .NET 6 unfortunately. The problem here is that Mono has a different version of this assembly, and some package is trying to bring in a newer version from NuGet.
For my project, upgrade Xamarin.AndroidX.Legacy.Support.V13 to newest 1.0.0.13 triggers the error, revert back to 1.0.0.12 and errors disappear.
Confirmed that version 1.0.0.12 on the Xamarin.AndroidX.Legacy.SupportV4 also makes this error go away. 1.0.0.13 has quite the breaking change for a point release.
Which error are you referring to? This issue lists 2 new warnings.
Which error are you referring to? This issue lists 2 new warnings.
For me it's the two XA4218 missing jars. androidx.window.sidecar.jar and androidx.window.extensions.jar
@jpobst I still get all the same warnings as to when I first reported it. I'm now using VS2022 17.3.0 Prev 1.1
For me it's the two XA4218 missing jars. androidx.window.sidecar.jar and androidx.window.extensions.jar
Sec! Missing androidx.window.sidecar.jar
???
Official google maven does not mention androidx.window.sidecar
artifact (neither jar
or aar
):
https://maven.google.com/web/index.html?q=androidx.window#androidx.window
if you step out of Microsoft world there are few pointers (though there is MS FTE working on the issue):
In
https://groups.google.com/a/chromium.org/g/java/c/bf9if0l3VJ4?pli=1
there is explanation (seems like internal classes and interfaces, kotlin vs java and R8/proguard tooling) and horrible workaround.
Seems that problem is 2+ years old. Seems our tooling just got better with surfacing warnings too.
Also related;
@jonathanpeppers @jpobst From AndroidX issue
TL&DR;
where would:
sun.misc.Signal
sun.misc.SignalHandler
java.lang.ClassValue
java.lang.instrument.ClassFileTransformer
come from???
Which error are you referring to? This issue lists 2 new warnings.
It was the ones I googled for that got me to this thread.
Warning Unable to find //manifest/application/uses-library at path: C:\Program Files (x86)\Android\android-sdk\platforms\android-31\optional\androidx.window.sidecar.jar Warning Unable to find //manifest/application/uses-library at path: C:\Program Files (x86)\Android\android-sdk\platforms\android-31\optional\androidx.window.extensions.jar
These were not files I intentionally included.
So something changed between the 1.0.0.12 and 1.0.0.13 releases that caused this since reverting made the error go away.
Ok, those are just warnings, not errors. It is suggested to ignore them.
For apps that end up with this in their manifest:
<application>
<uses-library
android:name="androidx.window.extensions"
android:required="false" />
<uses-library
android:name="androidx.window.sidecar"
android:required="false" />
</application>
We look for these libraries in platforms\android-*\optional
and if we don't find them, emit these warnings:
XA4218: Unable to find //manifest/application/uses-library at path: C:\Program Files (x86)\Android\android-sdk\platforms\android-31\optional\androidx.window.sidecar.jar 0
XA4218: Unable to find //manifest/application/uses-library at path: C:\Program Files (x86)\Android\android-sdk\platforms\android-31\optional\androidx.window.extensions.jar
We could remove these warnings, but I'm not sure that's the right path.
These libraries are passed to d8/r8 as a "reference" and they don't get included on the app. They are normally libraries that OEMs provide on certain devices. If we had them we could solve the XA4218
warning, and the d8/r8 warning.
I found one library:
Are we supposed to be using this somehow? It's only in alpha.
I still get all the same warnings as to when I first reported it. I'm now using VS2022 17.3.0 Prev 1.1
@gmck
These warnings are coming from AndroidX (Xamarin.AndroidX.Window
), VS updates will not fix it.
Ok, those are just warnings, not errors. It is suggested to ignore them.
Not good practice to simply 'ignore warnings'. Not how I like to write my programs. Thank you for your opinion.
@jonathanpeppers
It comes from Xamarin.AndroidX.Window.
Most Android apps will eventually depend on this package through a long enough dependency chain:
Microsoft.Maui.Dependencies
-> Xamarin.AndroidX.Navigation.Fragment
-> Xamarin.AndroidX.SlidingPaneLayout
-> Xamarin.AndroidX.Window
What about window-extensions
, though? It seems like r8 wants that .jar
to avoid some warnings? If that file was added to the AndroidExternalJavaLibrary
item group, it would go away.
We'd have to change something in Xamarin.Android to fix our warning, it could probably check the AndroidExternalJavaLibrary
item group to skip the warning.
What about window-extensions, though?
It might fix one of the warnings, but not the sidecar
one. The "jar" is also called window-extensions-1.0.0-alpha01.aar
so I'm not sure if that will work?
Maybe we should be looking at the required
attribute and not warning if it's false
?
<uses-library
android:name="androidx.window.extensions"
android:required="false" />
Granted, that's why it's only a warning and not an error.
The required="false"
, means it is a library only present on some devices (OEMs put it there).
The example is android.car.jar
:
Your app might use that but work on phones, and it would only be present on embedded Android Auto devices.
Maybe when these libraries are stable Google will add them to /optional
?
For apps that end up with this in their manifest:
<application> <uses-library android:name="androidx.window.extensions" android:required="false" /> <uses-library android:name="androidx.window.sidecar" android:required="false" /> </application>
Maybe we should not emit the warning when we cannot find the library in optional
if required
is false
?
@jonathanpeppers
We could remove these warnings, but I'm not sure that's the right path.
I would not do that. Warnings are not caused by us.
These libraries are passed to d8/r8 as a "reference" and they don't get included on the app. They are normally libraries that OEMs provide on certain devices. If we had them we could solve the
XA4218
warning, and the d8/r8 warning.I found one library:
This leads to correct official location
https://maven.google.com/web/index.html?q=androidx.window#androidx.window:window-extensions
Are we supposed to be using this somehow? It's only in alpha.
No. It was bound when androidx.window.*
was in preview for Screen Duo work, but not touched/updated afterwards.
https://github.com/xamarin/AndroidX/blob/main/config.json#L1325-L1348
see my comment:
https://github.com/xamarin/xamarin-android/issues/6809#issuecomment-1060800332
the warnings are still present in Visual Studio Version 17.3.0 Preview 6.0
the warnings are still present in Visual Studio Version 17.3.0 Preview 6.0
Thanks for the feedback, but Visual Studio version has nothing to do with this issue.
See: https://github.com/xamarin/xamarin-android/issues/6809#issuecomment-1138617639
I still get all the same warnings as to when I first reported it. I'm now using VS2022 17.3.0 Prev 1.1
@gmck
These warnings are coming from AndroidX (
Xamarin.AndroidX.Window
), VS updates will not fix it.
I have the same warnings after upgrading the project to a newer Xamarin version using VS 17.5.2. I didn't have the Xamarin.AndroidX.Window
package installed but still I got the errors. After installing this package just to test there were no changes in the build output log.
Both warnings are still present after migrating a Xamarin.Android app to .NET 8
Android application type
Classic Xamarin.Android (MonoAndroid12.0, etc.)
Affected platform version
VS2022 17.2.0 Preview 1.0
Description
After upgrading all my nugets to the latest versions, the following are new warnings.
Also attaching the MS Build log. Do you need anything else from me?
Could you please advise about the following, where it comes from etc? Missing class androidx.window.extensions.WindowExtensions (referenced from: androidx.window.extensions.embedding.ActivityEmbeddingComponent
Build04032022.zip
Steps to Reproduce
N/A
Did you find any workaround?
The app deploys and runs just fine.
Relevant log output
No response