Skip to content

Commit a6fc4cd

Browse files
[docs] notes on binding gradle-wrapper.jar (#7529)
Context: #7527 (comment) Update docs to give some examples on excluding files that you wouldn't want to bind.
1 parent b61f677 commit a6fc4cd

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Documentation/guides/OneDotNetBindingProjects.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,27 @@ Default Android related file globbing behavior is defined in [AutoImport.props][
6868
This behavior can be disabled for Android items by setting `$(EnableDefaultAndroidItems)` to `false`, or
6969
all default item inclusion behavior can be disabled by setting `$(EnableDefaultItems)` to `false`.
7070

71+
Undesired `.jar` or `.aar` files could be included with the default
72+
wildcards. In one case a `AndroidStudio\gradle\wrapper\gradle-wrapper.jar`
73+
file was unintentionally being bound, yielding C# compiler errors:
74+
75+
Org.Gradle.Cli.AbstractCommandLineConverter.cs(11,89): error CS0535: 'Download' does not implement interface member 'IDownload.Download(URI, File)'
76+
Org.Gradle.Wrapper.Download.cs(10,60): error CS0535: 'AbstractCommandLineConverter' does not implement interface member 'ICommandLineConverter.Convert(ParsedCommandLine, Object)'
77+
78+
To solve this issue, you can either remove the specific file in your `.csproj`:
79+
80+
```xml
81+
<ItemGroup>
82+
<AndroidLibrary Remove="AndroidStudio\gradle\wrapper\gradle-wrapper.jar" />
83+
</ItemGroup>
84+
```
85+
86+
Or exclude *all* files within that folder:
87+
88+
```xml
89+
<AndroidLibrary Remove="AndroidStudio\**\*" />
90+
```
91+
7192
[default-items]: https://github.com/xamarin/xamarin-android/blob/main/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/Sdk/AutoImport.props
7293

7394
## Migration Considerations

0 commit comments

Comments
 (0)