Skip to content
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

[Android] get_Map returns NULL POINTER EXCEPTION #73

Closed
andreabellitto opened this issue Sep 16, 2016 · 10 comments
Closed

[Android] get_Map returns NULL POINTER EXCEPTION #73

andreabellitto opened this issue Sep 16, 2016 · 10 comments

Comments

@andreabellitto
Copy link

I'm facing this problem on Android probably because i use this lib with Google Play Services ver. 32.x instead of 29.x, but to use some other library inside my project i'm forced to do so.

I'm constantly getting: "Method 'Android.Gms.Maps.MapView.get_Map' not found." and app crashes.

Please update this fanctastic lib to be compatible with newer Google Play Services version too.

@amay077
Copy link
Owner

amay077 commented Sep 19, 2016

Xamarin.Forms.GoogleMaps now supports Google Play services ver 32.x.

I published Xamarin.Forms.GoogleMaps 1.6.1-beta1, please try it!

@amay077 amay077 closed this as completed Sep 19, 2016
@andreabellitto
Copy link
Author

andreabellitto commented Sep 22, 2016

I'ts quiet strange, now my application crashes at start when executing this line of code:

Xamarin.FormsGoogleMaps.Init(this, bundle);

the error log says:

"System.TypeLoadException: Could not load type 'Xamarin.Forms.GoogleMaps.Android.MapRenderer' from assembly 'Xamarin.Forms.GoogleMaps.Android, Version=1.6.0.1, Culture=neutral, PublicKeyToken=null'.
"

I think that it's the same issue as:
#76

Maybe it's something related to Xamarin.Android 7.0 release.

@amay077 amay077 reopened this Sep 23, 2016
@hieumoscow
Copy link

I also have this issue with 1.6, Please help us

@amay077
Copy link
Owner

amay077 commented Sep 23, 2016

Hi @tematim , @hieumoscow , @belandsoft ,

Can you give me sample project for reproduce #73 or #76 ?
I can not repro these issues.

I tried these steps

  1. Create new Xamarin.Forms(XAML) solution.
  2. Add Xamarin.Forms.GoogleMaps v1.6.0 nuget package to PCL and Android project.
  3. Add INTERNET, ACCESS_NETWORK_STATE, ACCESS_FINE_LOCATION permissions to Android manifest.
  4. Write Google maps apiKey to MyApp.cs (similar this)
  5. Add Map view to XAML.
  6. Write Xamarin.FormsGoogleMap.Init to MainActivity.cs .

I can launch this app and see Google map.

XFSample.zip

And my develop environment information.
Anything difference?

=== Xamarin Studio Indie ===

Version 6.1 (build 5441)
Installation UUID: dd701dab-d74a-4c9b-a213-e8016e6aebc5
Runtime:
Mono 4.6.0 (mono-4.6.0-branch/746756c) (64-bit)
GTK+ 2.24.23 (Raleigh theme)

Package version: 406000245

=== NuGet ===

Version: 3.4.3.0

=== Xamarin.Profiler ===

Not Installed

=== Xamarin.Android ===

Version: 7.0.0.18 (Xamarin Indie)
Android SDK: /Users/hrnv/dev/sdks/android-sdk-macosx
Supported Android versions:
2.3 (API level 10)
4.0.3 (API level 15)
4.1 (API level 16)
4.2 (API level 17)
4.4 (API level 19)
4.4.87 (API level 20)
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)

SDK Tools Version: 25.1.7
SDK Platform Tools Version: 24
SDK Build Tools Version: 23.0.2

Java SDK: /usr
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Android Player ===

Version: 0.6.5
Location: /Applications/Xamarin Android Player.app

=== Apple Developer Tools ===

Xcode 8.0 (11246)
Build 8A218a

=== Xamarin.Mac ===

Not Installed

=== Xamarin.iOS ===

Version: 10.0.0.6 (Xamarin Indie)
Hash: 6c3fee4
Branch: xcode8
Build date: 2016-09-09 13:01:32-0400

=== Xamarin Inspector ===

Version: 0.9.0.14
Hash: 4d868da
Branch: master
Build date: Mon Jun 13 19:14:13 UTC 2016

=== Build Information ===

Release ID: 601005441
Git revision: 68292d1ab289911c815ddc715dd7cc29a9752f9f
Build date: 2016-09-09 04:43:23-04
Xamarin addins: ed25d008672663eeb9db55f1ccecb3c24d2fd3b2
Build lane: monodevelop-lion-cycle8

=== Operating System ===

Mac OS X 10.11.6
Darwin macmini.local 15.6.0 Darwin Kernel Version 15.6.0
Mon Aug 29 20:21:34 PDT 2016
root:xnu-3248.60.11~1/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

Gorilla Player 0.9.1.2
Xamarin Inspector 0.9.0.14

@andreabellitto
Copy link
Author

andreabellitto commented Sep 27, 2016

@amay077
Ok, this is my sample project, note 2 main bugs:

  1. crash at Droid application start.
  2. not working iOS map pin onclick event delegate. (on the app interface you need to open menu' and tap on the "stop map" entry than move the map to make appear a pin)

OrariGTT.zip

Development environment info:

'Microsoft Visual Studio Community 2015
Versione 14.0.25431.01 Update 3
Microsoft .NET Framework
Versione 4.6.01586

Edizione installata: Community

Microsoft Visual Studio Tools for Applications 2015 00322-20000-00000-AA382
Microsoft Visual Studio Tools for Applications 2015

Visual Basic 2015 00322-20000-00000-AA382
Microsoft Visual Basic 2015

Visual C# 2015 00322-20000-00000-AA382
Microsoft Visual C# 2015

Visual C++ 2015 00322-20000-00000-AA382
Microsoft Visual C++ 2015

Windows Phone SDK 8.0 - ITA 00322-20000-00000-AA382
Windows Phone SDK 8.0 - ITA

ASP.NET and Web Tools 2015.1 14.1.20907.0
ASP.NET and Web Tools 2015.1

ASP.NET Web Frameworks and Tools 2012.2 4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013 5.2.40314.0
For additional information, visit http://www.asp.net/

Azure App Service Tools v2.9.5 14.0.20810.0
Azure App Service Tools v2.9.5

Azure Data Lake Node 1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio 2.1.0000.0
Microsoft Azure Data Lake Tools for Visual Studio

Clang with Microsoft CodeGen 14.0.25516
Clang with Microsoft CodeGen

Command Bus, Event Stream and Async Manager Merq
Provides ICommandBus, IEventStream and IAsyncManager MEF services for loosely coupled Visual >Studio extension components communication and integration.

EclipseAndroidImporter 1.0
Import Android projects from Eclipse.

Gestione pacchetti NuGet 3.5.0
Gestione pacchetti NuGet in Visual Studio. Per altre informazioni su NuGet, visitare il sito Web >http://docs.nuget.org/.

GitHub.VisualStudio 1.0
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

GorillaPlayerPackage Extension 1.0
GorillaPlayerPackage Visual Studio Extension Detailed Info

KofePackagePackage Extension 1.0
KofePackagePackage Visual Studio Extension Detailed Info

Microsoft .NET Core Tools (Preview 2) 14.1.20907.0
Microsoft .NET Core Tools (Preview 2)

Microsoft Azure Hive Query Language Service 2.1.0000.0
Language service for Hive query

Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Pacchetto di Strumenti Application Insights per Visual Studio 7.7.10922.3
Strumenti Application Insights per Visual Studio

Servizio di linguaggio JavaScript 2.0
Servizio di linguaggio JavaScript

Sistema del progetto JavaScript 2.0
Sistema del progetto JavaScript

SQL Server Analysis Services 13.0.1700.68
Microsoft SQL Server Analysis Services Designer
Version 13.0.1700.68

SQL Server Data Tools 14.0.60812.0
Microsoft SQL Server Data Tools

SQL Server Integration Services
Microsoft SQL Server Integration Services Designer
Version 13.0.1601.5

SQL Server Reporting Services 13.0.1700.68
Microsoft SQL Server Reporting Services Designers
Version 13.0.1700.68

Strumenti comuni di Azure 1.8
Fornisce servizi comuni da usare con Servizi mobili di Azure e gli strumenti di Microsoft Azure.

Strumenti di Microsoft Azure 2.9
Strumenti di Microsoft Azure per Microsoft Visual Studio 2015 - versione 2.9.40715.2

Strumenti di Servizi Mobili di Microsoft Azure 1.4
Strumenti di Servizi Mobili di Microsoft Azure

ToolWindowHostedEditor 1.0
Hosting json editor into a tool window

TypeScript 1.8.36.0
Strumenti TypeScript per Visual Studio

Visual C++ per lo sviluppo di app per dispositivi mobili multipiattaforma (Android) 14.0.25401.00
Visual C++ per lo sviluppo di app per dispositivi mobili multipiattaforma (Android)

Visual Studio Tools for Universal Windows Apps 14.0.25527.01
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

Visualizzatore PreEmptive Analytics 1.2
Estensione di Microsoft Visual Studio per visualizzare i riepiloghi aggregati dal prodotto PreEmptive Analytics.

Xamarin 4.2.0.695 (7603786)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android 7.0.1.2 (c1d1c79)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS 10.0.0.1 (29910bb)
Visual Studio extension to enable development for Xamarin.iOS.

XAML Spy 3.0.2
XAML Spy for Visual Studio
Copyright © First Floor Software. All rights reserved.

The visual runtime inspector for Android, iOS and Windows
http://xamlspy.com '

@amay077
Copy link
Owner

amay077 commented Sep 28, 2016

Thanks @belandsoft , I'll check it. 👍

@amay077
Copy link
Owner

amay077 commented Sep 29, 2016

  1. crash at Droid application start.

I reproduced it.
The cause is Xamarin.Forms-Ver2.3.3-pre2 have breaking changes.

ref - https://forums.xamarin.com/discussion/comment/222650/#Comment_222650

I can not support Xamarin.Forms 2.3.3-pre2 because this is pre-release version.
Let’s wait and see before we make a decision.

@hieumoscow
Copy link

In my case I fixed it by upgrading XF from Xamarin.Forms 2.2.0.31 to 2.3.0.49. Cheers :)

@amay077
Copy link
Owner

amay077 commented Oct 25, 2016

I put this on ice.
If you request again then I will reopen.

@amay077 amay077 closed this as completed Oct 25, 2016
@JuanuMusic
Copy link

Hey, I just updated all Xamarin packages from NuGet and started getting this same exception.
Method 'Android.Gms.Maps.MapView.get_Map' not found.

Is there any way to solve it or is it a bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants