dotnet / dotnet/android-libraries

Xamarin.AndroidX.Compose.Runtime.Annotation.Android and Xamarin.AndroidX.SavedState.SavedState.Compose incorrectly include .aar files as AndroidJavaLibrary instead of AndroidAarLibrary in .targets files

Open
#1,383 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
317
Forks
73
Avg merge
1d 8h
Merged PRs (30d)
17

Description

### Android framework version

net10.0-android

### Affected platform version

net10.0

### Description

The .targets files shipped in both build/ and buildTransitive/ for this package include the file aar/runtime-annotation-android.aar using the AndroidJavaLibrary MSBuild item type:

build/net10.0-android36.0/Xamarin.AndroidX.Compose.Runtime.Annotation.Android.targets
```



```

AndroidJavaLibrary is intended for .jar files. The correct item type for .aar files is AndroidAarLibrary. Using AndroidJavaLibrary for an .aar causes any tools that iterate over that item list expecting plain Java bytecode to fail, and silently drops any resources, AndroidManifest.xml entries, and native libs contained in the AAR.

Xamarin.AndroidX.SavedState.SavedState.Compose has the same issue.

### Steps to Reproduce

Just look into package
https://nuget.info/packages/Xamarin.AndroidX.SavedState.SavedState.Compose/1.4.0.2
Check build/net10.0-android36.0/Xamarin.AndroidX.SavedState.SavedState.Compose.targets
https://nuget.info/packages/Xamarin.AndroidX.Compose.Runtime.Annotation.Android/1.10.4.1
Check build/net10.0-android36.0/Xamarin.AndroidX.Compose.Runtime.Annotation.Android.targets

### Did you find any workaround?

```






```

### Relevant log output

```shell

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.