Closed muhammetsahin closed 5 years ago
Have a look at the Dependencies here: https://www.nuget.org/packages/Xamarin.Forms.GoogleMaps/3.2.0. This plugin currently targets android 8.1 currently and not android 9.0.
Downgrade your target version and you should be good to go.
Shows "green screen" when following cases.
Xamarin.FormsGoogleMaps.Init()
does not called in MainActivity.cs
.Please check these. If none of the these shall apply to, please report details.
@amay077 I just wanted to clarify the state of this issue.
Are you saying that the app must target Android 8 in order for the map control to work? We are on a countdown right now to target Android 9. Google has stated that any new app must target OS 9 starting in August and any updates after November will also require the app to target OS 9 also.
https://developer.android.com/distribute/best-practices/develop/target-sdk
Thanks
Hi @cbartonnh ,
Are you saying that the app must target Android 8 in order for the map control to work?
No. Xamarin.Forms.GoogleMaps can work on Android 9. You can use target Android 9 in your Apps.
Hi, Im new in Xamarin forms. I have inherited an application with the green screen error. Following with your recommendations, these are my errors:
Xamarin.FormsGoogleMaps.Init() does not called in MainActivity.cs. Xamarin.FormsGoogleMaps.Init() is called, and I found a method to check google play services wich is returning "OK"
Your Android emulator does not supported Google Play services: Here is the method I m using:
IsPlayServicesAvailable(); global::Xamarin.FormsGoogleMaps.Init(this, savedInstanceState);
` public bool IsPlayServicesAvailable() { var resultCode = GoogleApiAvailability.Instance.IsGooglePlayServicesAvailable(this); if (resultCode != ConnectionResult.Success) { if (GoogleApiAvailability.Instance.IsUserResolvableError(resultCode)) { Log.Debug(TAG, GoogleApiAvailability.Instance.GetErrorString(resultCode)); } else { Log.Debug(TAG, "This device is not supported"); Finish(); }
return false;
}
Log.Debug(TAG, "Google Play Services is available.");
return true;
}`
09-11 13:06:38.938 D/Mono (25407): Requesting loading reference 7 (of 9) of Xamarin.Forms.GoogleMaps.Android.dll
09-11 13:06:38.938 D/Mono (25407): Loading reference 7 of Xamarin.Forms.GoogleMaps.Android.dll asmctx DEFAULT, looking for Xamarin.GooglePlayServices.Base, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
09-11 13:06:38.938 D/Mono (25407): Assembly Ref addref Xamarin.Forms.GoogleMaps.Android[0xc8ee09c0] -> Xamarin.GooglePlayServices.Base[0xc8ee0cc0]: 3
09-11 13:06:38.941 D/Mono (25407): Requesting loading reference 6 (of 9) of Xamarin.Forms.GoogleMaps.Android.dll
09-11 13:06:38.941 D/Mono (25407): Loading reference 6 of Xamarin.Forms.GoogleMaps.Android.dll asmctx DEFAULT, looking for System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
09-11 13:06:38.941 D/Mono (25407): Assembly Ref addref Xamarin.Forms.GoogleMaps.Android[0xc8ee09c0] -> System[0xc8ee12c0]: 8
09-11 13:06:38.960 D/Mono (25407): DllImport searching in: '__Internal' ('(null)').
09-11 13:06:38.960 D/Mono (25407): Searching for 'java_interop_jnienv_call_object_method'.
09-11 13:06:38.960 D/Mono (25407): Probing 'java_interop_jnienv_call_object_method'.
09-11 13:06:38.960 D/Mono (25407): Found as 'java_interop_jnienv_call_object_method'.
09-11 13:06:39.009 I/mono-stdout(25407): Google Play Services Not Found
Google Play Services Not Found
Exception: Java.Lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/internal/zzbp; ---> Java.Lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.internal.zzbp" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/red24mobileclient.red24mobileclient-GxnZJkQFRl2E-nuuitb7aw==/base.apk"],nativeLibraryDirectories=[/data/app/red24mobileclient.red24mobileclient-GxnZJkQFRl2E-nuuitb7aw==/lib/x86, /data/app/red24mobileclient.red24mobileclient-GxnZJkQFRl2E-nuuitb7aw==/base.apk!/lib/x86, /system/lib]]
--- End of inner exception stack trace ---
at Java.Interop.JniEnvironment+StaticMethods.CallStaticIntMethod (Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue args) [0x0006e] in <42748fcc36b74733af2d9940a8f3cc8e>:0
at Android.Runtime.JNIEnv.CallStaticIntMethod (System.IntPtr jclass, System.IntPtr jmethod, Android.Runtime.JValue parms) [0x0000e] in <9a14097a65
a445eaa85f6a3a1ade52a3>:0
at Android.Gms.Maps.MapsInitializer.Initialize (Android.Content.Context context) [0x00047] in <0ef98d0b7df944fb8f20d9e078937bf5>:0
at Xamarin.FormsGoogleMaps.Init (Android.App.Activity activity, Android.OS.Bundle bundle, Xamarin.Forms.GoogleMaps.Android.PlatformConfig config) [0x00034] in
android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6669) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.internal.zzbp" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/red24mobileclient.red24mobileclient-GxnZJkQFRl2E-nuuitb7aw==/base.apk"],nativeLibraryDirectories=[/data/app/red24mobileclient.red24mobileclient-GxnZJkQFRl2E-nuuitb7aw==/lib/x86, /data/app/red24mobileclient.red24mobileclient-GxnZJkQFRl2E-nuuitb7aw==/base.apk!/lib/x86, /system/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134) at java.lang.ClassLoader.loadClass(ClassLoader.java:379) at java.lang.ClassLoader.loadCla ss(ClassLoader.java:312) ... 18 more 09-11 13:06:39.056 I/mono-stdout(25407): java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/internal/zzbp; 09-11 13:06:39.056 I/mono-stdout(25407): at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source:5) 09-11 13:06:39.056 I/mono-stdout(25407): at crc648f5dfb631c4d80fe.MainActivity.n_onCreate(Native Method) 09-11 13:06:39.056 I/mono-stdout(25407): at crc648f5dfb631c4d80fe.MainActivity.onCreate(MainActivity.java:30) 09-11 13:06:39.057 I/mono-stdout(25407): at android.app.Activity.performCreate(Activity.java:7136) 09-11 13:06:39.057 I/mono-stdout(25407): at android.app.Activity.performCreate(Activity.java:7127) 09-11 13:06:39.057 I/mono-stdout(25407): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271) 09-11 13:06:39.057 I/mono-stdout(25407): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893) 09-11 13:06:39.057 I/mono-stdout(25407): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048) 09-11 13:06:39.057 I/mono-stdout(25407): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) 09-11 13:06:39.057 I/mono-stdout(25407): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 09-11 13:06:39.057 I/mono-stdout(25407): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 09-11 13:06:39.058 I/mono-stdout(25407): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808) 09-11 13:06:39.058 I/mono-stdout(25407): at android.os.Handler.dispatchMessage(Handler.java:106) 09-11 13:06:39.058 I/mono-stdout(25407): at android.os.Looper.loop(Looper.java:193) 09-11 13:06:39.058 I/mono-stdout(25407): at android.app.ActivityThread.main(ActivityThread.java:6669) 09-11 13:06:39.058 I/mono-stdout(25407): at java.lang.reflect.Method.invoke(Native Method) 09-11 13:06:39.058 I/mono-stdout(25407): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 09-11 13:06:39.058 I/mono-stdout(25407): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 09-11 13:06:39.058 I/mono-stdout(25407): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.internal.zzbp" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/red24mobileclient.red24mobileclient-GxnZJkQFRl2E-nuuitb7aw==/base.apk"],nativeLibraryDirectories=[/data/app/red24mobileclient.red24mobileclient-GxnZJkQFRl2E-nuuitb7aw==/lib/x86, /data/app/red24mobileclient.red24mobileclient-GxnZJkQFRl2E-nuuitb7aw==/base.apk!/lib/x86, /system/lib]] 09-11 13:06:39.058 I/mono-stdout(25407): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134) 09-11 13:06:39.058 I/mono-stdout(25407): at java.lang.ClassLoader.loadClass(ClassLoader.java:379) 09-11 13:06:39.058 I/mono-stdout(25407): at java.lang.ClassLoader.loadClass(ClassLoader.java:312) 09-11 13:06:39.058 I/mono-stdout(25407): ... 18 more 09-11 13:06:39.058 I/mono-stdout(25407):
I have been googling but I didn't find the solution.
I have to install the following package: GeoCoordinate.NetCore This package solved my problem
I resolved it by installing Xamarin.Android.GooglePlayServices.Maps
VERSIONS
PLATFORMS
ACTUAL BEHAVIOR
Sample app map not show maps, only this text is showing : "Xamarin.Forms.GoogleMaps"
ACTUAL SCREENSHOTS/STACKTRACE
EXPECTED BEHAVIOR
The map should be displayed