Skip to content

WearOS app fails to compile when targeting net6.0-android #7003

@beeradmoore

Description

@beeradmoore

Android application type

Android for .NET (net6.0-android, etc.)

Affected platform version

VS4Mac 2022 Preview (17.0 build 8904), .NET 6.0.300, Xamarin.Android 12.3.0.3

Description

I have been trying to use net6.0-android as the target framework to build a WearOS wearable app after it was mentioned in an (unofficial) .NET MAUI Platforms Support gist that it was supported.

The warnings below seem to indicate android-31/optional/com.google.android.wearable.jar is missing when in actual fact com.google.android.wearable.jar does not exist in android-30/optional/ and android-28/optional/ which are the other folders I have there.

I am unsure if those warnings relate to the R8 compilation or not.

Repro:
WearOSMonoTest.zip
WearOSNet6Test.zip

Extra info:
I did update target framework on the first project to MonoAndroid12.0
I also updated TargetFramework to net6.0-android31 because that is what was listed as the required framework on nuget.org for the nugets I added but I don't believe this is required as it has the same issues if I use net6.0-android.

Steps to Reproduce

  1. Create new wear app using VS4Mac stable (in this case I called it WearOSMonoTest)
  2. Update all nuget files.
  3. Build and deploy app to confirm it is working.
  4. (see WearOSMonoTest.zip above)
  5. Create new net6.0-android app, dotnet new android --name WearOSNet6Test
  6. Update nugets/resources/code to match the WearOSMonoTest project.
  7. Build and deploy app to see .NET 6 in a WearOS app.
  8. Get compile issues (listed below)
  9. (see WearOSNet6Test.zip above)

Did you find any workaround?

Nope.

Relevant log output

obj/Debug/net6.0-android31/android/AndroidManifest.xml : warning XA4218: Unable to find //manifest/application/uses-library at path: /Users/bradmoore/Library/Developer/Xamarin/android-sdk-macosx/platforms/android-31/optional/com.google.android.wearable.jar
obj/Debug/net6.0-android31/android/AndroidManifest.xml : warning XA4218: Unable to find //manifest/application/uses-library at path: /Users/bradmoore/Library/Developer/Xamarin/android-sdk-macosx/platforms/android-31/optional/androidx.window.extensions.jar
obj/Debug/net6.0-android31/android/AndroidManifest.xml : warning XA4218: Unable to find //manifest/application/uses-library at path: /Users/bradmoore/Library/Developer/Xamarin/android-sdk-macosx/platforms/android-31/optional/androidx.window.sidecar.jar
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/32.0.300-rc.3.45/tools/Xamarin.Android.D8.targets(79,5): error : java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: obj/Debug/net6.0-android31/lp/59/jl/classes.jar : android/support/v4/app/INotificationSideChannel$Stub.class

Metadata

Metadata

Assignees

Labels

Area: App+Library BuildIssues when building Library projects or Application projects.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions