Closed PaoloLeva closed 3 years ago
I tested the same on a Xamarin Forms "Blank App" (instead of Shell) and I get the same behavior. It works on Android 7 and 8, but it crashes on Android 9, 10 ,11
I saw this in the Application Output window, maybe it helps?
[AndroidRuntime] FATAL EXCEPTION: Thread-14
[AndroidRuntime] Process: com.paololeva.geoquizapp, PID: 5691
[AndroidRuntime] java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/ProtocolVersion;
[AndroidRuntime] at cz.b(:com.google.android.gms.dynamite_mapsdynamite@204215068@20.42.15 (100700-0):2)
[AndroidRuntime] at cy.a(:com.google.android.gms.dynamite_mapsdynamite@204215068@20.42.15 (100700-0):1)
[AndroidRuntime] at cf.a(:com.google.android.gms.dynamite_mapsdynamite@204215068@20.42.15 (100700-0):16)
[AndroidRuntime] at cf.run(:com.google.android.gms.dynamite_mapsdynamite@204215068@20.42.15 (100700-0):2)
[AndroidRuntime] Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.ProtocolVersion" on path: DexPathList[[zip file "/data/user_de/0/com.google.android.gms/app_chimera/m/0000000e/MapsDynamite.apk"],nativeLibraryDirectories=[/data/user_de/0/com.google.android.gms/app_chimera/m/0000000e/MapsDynamite.apk!/lib/x86, /data/user_de/0/com.google.android.gms/app_chimera/m/0000000e/MapsDynamite.apk!/lib/armeabi-v7a, /data/user_de/0/com.google.android.gms/app_chimera/m/0000000e/MapsDynamite.apk!/lib/armeabi, /system/lib]]
[AndroidRuntime] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
[AndroidRuntime] at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
[AndroidRuntime] at az.loadClass(:com.google.android.gms.dynamite_dynamiteloader@204215068@20.42.15 (100700-0):3)
[AndroidRuntime] at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
[AndroidRuntime] ... 4 more
[] Thread 0xcb3ef970 may have been prematurely finalized
[] * Assertion at /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mono/utils/mono-threads.c:650, condition `info' not met, function:mono_thread_info_current,
[libc] Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 5792 (Thread-14), pid 5691 (leva.geoquizapp)
I found a solution here: https://developers.google.com/maps/documentation/android-sdk/config#specify_requirement_for_apache_http_legacy_library If you have the same problem please follow the instructions above
VERSIONS
PLATFORMS
ACTUAL BEHAVIOR
I have taken a sample Shell Xamarin Forms App and added GoogleMaps. On Android it works on Android 7 and 8, but if I use Android 9, 10 or 11 as soon as the map appears the app crashes. It works well on iOS. I only tested on Emulators. I set the Minimum Android version to 7.0 and I tried setting different values for Target version but without any change
ACTUAL SCREENSHOTS/STACKTRACE
When I click on the Tab in my test app on containing the map on Android 9 ,10, or 11, I see the map for a split second and then the app crashes/closes down. It does not crash in the code is just the app on the device that closes down. In Android 7 and 8 the map is shown correctly.
In the Application Output window I see the following:
EXPECTED BEHAVIOR
The tab with the Map should be shown as in Android 7 and 8 and in iOS.
HOW TO REPRODUCE
I use the standard code for Shell Xamarin Forms Apps with only the changes required to include GoogleMaps package.
here is my page (the one that crashes)
the code behind is just standard it only calls
InitializeComponent()
and also the ViewModel contains only standard code.Here is my "MainActivity.cs"
I added the API key in the manifest, and this is correct as I can test in Android 7 and 8