Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Invalid parameter type android.content.SharedPreference in Xamarin Android binding #4319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
amitrkalghatgi opened this issue Feb 25, 2020 · 2 comments
Assignees
Labels
Area: Bindings Issues in Java Library Binding projects. need-info Issues that need more information from the author.

Comments

@amitrkalghatgi
Copy link

###Code snippet in java class part of framework.aar

void clear(SharedPreferences preferences);

SharedPreferences getStorage();

Expected Behavior

No warnings and bindings should be generated for the class using Shared Preference

Actual Behavior

BINDINGSGENERATOR: Warning BG8801: Invalid parameter type android.content.SharedPreferences in method Clear in managed type Com.xxxxxxxxx.xxxxxx.xxxxxxxx.

BINDINGSGENERATOR: Warning BG8701: Invalid return type android.content.SharedPreferences in method GetStorage in managed type Com.xxxxxxxxx.xxxxxx.xxxxxxxx.

Version Information

=== Visual Studio Community 2019 for Mac ===

Version 8.4.3 (build 12)
Installation UUID: ced5ca91-faaa-416f-8f1b-d2df0e8e1dd9
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 5.16.1.25 (issue-7441-d16-3-vsmac / 881172e73)

Package version: 606000155

=== Mono Framework MDK ===

Runtime:
Mono 6.6.0.155 (2019-08/296a9afdb24) (64-bit)
Package version: 606000155

=== Roslyn (Language Service) ===

3.4.0-beta4-19562-05+ff930dec4565e2bc424ad3bf3e22ecb20542c87d

=== NuGet ===

Version: 5.3.0.6192

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/3.1.101/Sdks
SDK Versions:
3.1.101
3.1.100
3.0.100
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.6.0/lib/mono/msbuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
3.1.1
3.1.0
3.0.0
2.1.15
2.1.13

=== Xamarin.Profiler ===

Version: 1.6.12.26
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Xamarin Designer ===

Version: 16.4.0.479
Hash: 074544417
Branch: remotes/origin/d16-4
Build date: 2020-01-22 22:50:22 UTC

=== Apple Developer Tools ===

Xcode 11.3.1 (15715)
Build 11C504

=== Xamarin.Mac ===

Version: 6.10.0.17 (Visual Studio Community)
Hash: 5f802ef53
Branch: xcode11.3
Build date: 2020-01-07 11:53:06-0500

=== Xamarin.iOS ===

Version: 13.10.0.17 (Visual Studio Community)
Hash: 5f802ef53
Branch: xcode11.3
Build date: 2020-01-07 11:53:06-0500

=== Xamarin.Android ===

Version: 10.1.3.7 (Visual Studio Community)
Commit: xamarin-android/d16-4/d66aed0
Android SDK: /Users/akalghatgi/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
7.0 (API level 24)
7.1 (API level 25)
8.0 (API level 26)
8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 29.0.4
SDK Build Tools Version: 28.0.3

Build Information:
Mono: fd9f379
Java.Interop: xamarin/java.interop/d16-4@c4e569f
ProGuard: xamarin/proguard@905836d
SQLite: xamarin/sqlite@46204c4
Xamarin.Android Tools: xamarin/xamarin-android-tools/master@9f4ed4b

=== Microsoft Mobile OpenJDK ===

Java SDK: /Users/akalghatgi/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 16.4.0.9
Hash: 3f7256f
Branch: remotes/origin/d16-4
Build date: 2020-01-14 22:19:04 UTC

=== Android Device Manager ===

Version: 16.4.0.30
Hash: f9172e2
Branch: remotes/origin/d16-4
Build date: 2020-01-14 22:19:24 UTC

=== Xamarin Inspector ===

Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 804030012
Git revision: 92973d97d9db919d8cc6d422e9c0599cf9995c47
Build date: 2020-01-24 17:47:54+00
Build branch: release-8.4
Xamarin extensions: 72721c588982f09029f051a38f484feb4c804227

=== Operating System ===

Mac OS X 10.15.1
Darwin 19.0.0 Darwin Kernel Version 19.0.0
Thu Oct 17 16:17:15 PDT 2019
root:xnu-6153.41.3~29/RELEASE_X86_64 x86_64

Log File

BINDINGSGENERATOR: Warning BG8801: Invalid parameter type android.content.SharedPreferences in method Clear in managed type Com.xxxxxxxxx.xxxxxx.xxxxxxxx.

BINDINGSGENERATOR: Warning BG8701: Invalid return type android.content.SharedPreferences in method GetStorage in managed type Com.xxxxxxxxx.xxxxxx.xxxxxxxx.

@amitrkalghatgi amitrkalghatgi added the Area: Bindings Issues in Java Library Binding projects. label Feb 25, 2020
@gugavaro gugavaro added this to the Under Consideration milestone Feb 25, 2020
@jpobst
Copy link
Contributor

jpobst commented Feb 25, 2020

I think this is caused by dotnet/java-interop#543, which has been fixed for the 16.5/8.5 release cycle. Updating to a 16.5 preview should fix it for you:

https://visualstudio.microsoft.com/vs/preview/
https://docs.microsoft.com/en-us/visualstudio/releasenotes/vs2019-mac-preview-relnotes

If that doesn't fix it, can you make a minimal .jar that displays the issue and attach it so I can investigate further?

@jpobst jpobst added the need-info Issues that need more information from the author. label Feb 25, 2020
@amitrkalghatgi
Copy link
Author

Yes... 16.5/8.5 release has the fix. Thanks..

@ghost ghost locked as resolved and limited conversation to collaborators Jun 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: Bindings Issues in Java Library Binding projects. need-info Issues that need more information from the author.
Projects
None yet
Development

No branches or pull requests

3 participants