Fuse Community

Possible Bug with MapView?

I am getting this error while running my app on my Galaxy S8+.

C:\Users\Caleb\Desktop\GitHub Repos\eskape\Eskape\build\Android\Debug\app\src\main\java\com\fusetools\maps\FuseMap.java:178: error: cannot access SafeParcelable
MarkerOptions opt = new MarkerOptions().position(new LatLng(lat, lng));
^
class file for com.google.android.gms.common.internal.safeparcel.SafeParcelable not found
C:\Users\Caleb\Desktop\GitHub Repos\eskape\Eskape\build\Android\Debug\app\src\main\java\com\fusetools\maps\FuseMap.java:291: error: cannot access AbstractSafeParcelable
CameraPosition.builder()
^
class file for com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable not found

  • What went wrong:
    Execution failed for task ‘:app:compileDebugJavaWithJavac’

I am pretty sure I have Mapview set up, I have this in my .unoproject

"Packages": [
    "Fuse",
    "FuseJS",
	  "Fuse.Maps",
    "Fuse.BasicTheme",
    "Fuse.CameraRoll",
    "Fuse.Launcher",
    "Uno.Permissions",
  ],
"Android": {
    "Geo": {
      "ApiKey": "AIzaSyAOIdJepbQNV4gxJNCvheKOyqMVNV9Cu5Q"
    },
}

And here I set it up

<NativeViewHost Height="300" >
					<MapView Latitude="33.424564" Longitude="-111.833267" Zoom="10">
						<MapMarker Latitude="33.424564" Longitude="-111.833267" Label="Home"/>
					</MapView>
				</NativeViewHost>

Your code is the same of mine so I guess it is not the code itself the issue:

"Packages": [
    "Fuse",
    "FuseJS",
    "Fuse.Maps",
    "Fuse.GeoLocation",
    "Fuse.Launcher",
    "Fuse.Share",
    "Fuse.CameraRoll"
],

<NativeViewHost>
    <MapView Latitude="{data.latitude}" Longitude="{data.longitude}" ShowMyLocation="True" ShowMyLocationButton="True" Zoom="15">
        <StackPanel>
            <Text Value="LAT: {myLatitude}" />
            <Text Value="LNG: {myLongitude}" />
        </StackPanel>
        <MapMarker Latitude="{myLatitude}" Longitude="{myLongitude}"  />
        <MapMarker Latitude="{data.latitude}" Longitude="{data.longitude}" />
    </MapView>
</NativeViewHost>

My .unoproj has "Fuse.GeoLocation", only because I use geolocation features.

What version of Fuse are you running? Because it works fine on my iOS devices/tests, so its something that is Android specific.

Also a question about map markers. So, its easy to run a function when a marker is tapped, but is there a way to find when the marker gets deselected? Like, not just tapped on another marker, but when they tap on a blank part of the map or screen, it deselects the marker right? How do you connect that to a function.

It could be the version of the maps services… what’s your version?

The current version in fuselibs is 12: https://github.com/fuse-open/fuselibs/blob/master/Source/Fuse.Maps/Android/MapView.uno#L17

Try changing it in:
fuselibs/Source/Fuse.Maps/Android/MapView.uno

I’m currently using 16:

[Require("Gradle.Dependency.Implementation", "com.google.android.gms:play-services-maps:16.0.0")]