Open jitenders859 opened 5 years ago
go to user flutter sdk path
same problem please give me ans.
go to user flutter sdk path .pub-cache/hosted/pub.dartlang.org/MapViewPlugin.kt
replace this val cameraDict = mapOptions["cameraPosition"] as Map<String, Any> with val cameraDict = mapOptions["cameraPosition"] as Map<String, Any>
both are same lines... what are saying to replace
go to user flutter sdk path .pub-cache/hosted/pub.dartlang.org/MapViewPlugin.kt
replace line no 167 to 180 with this code:
val mapOptions = call.argument<Map<String, Any>>("mapOptions")
val cameraDict = mapOptions!!["cameraPosition"] as Map<String, Any>
initialCameraPosition = getCameraPosition(cameraDict)
toolbarActions = getToolbarActions(call.argument<List<Map<String, Any>>>("actions"))
showUserLocation = mapOptions!!["showUserLocation"] as Boolean
showMyLocationButton = mapOptions!!["showMyLocationButton"] as Boolean
showCompassButton = mapOptions!!["showCompassButton"] as Boolean
hideToolbar = mapOptions!!["hideToolbar"] as Boolean
mapTitle = mapOptions!!["title"] as String
if (mapOptions!!["mapViewType"] != null) {
val mappedMapType: Int? = mapTypeMapping.get(mapOptions!!["mapViewType"]);
if (mappedMapType != null) mapViewType = mappedMapType;
}
it works for me
Hi @Saddi993 I do exactly the same with your sugestion but still get this error:
Launching lib\main.dart on SM G920V in debug mode...
e: C:\flutter\.pub-cache\hosted\pub.dartlang.org\map_view-0.0.14\android\src\main\kotlin\com\apptreesoftware\mapview\MapViewPlugin - Copy.kt: (27, 7): Redeclaration: MapViewPlugin
e: C:\flutter\.pub-cache\hosted\pub.dartlang.org\map_view-0.0.14\android\src\main\kotlin\com\apptreesoftware\mapview\MapViewPlugin - Copy.kt: (168, 34): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Map<String, Any>?
e: C:\flutter\.pub-cache\hosted\pub.dartlang.org\map_view-0.0.14\android\src\main\kotlin\com\apptreesoftware\mapview\MapViewPlugin - Copy.kt: (171, 36): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Map<String, Any>?
e: C:\flutter\.pub-cache\hosted\pub.dartlang.org\map_view-0.0.14\android\src\main\kotlin\com\apptreesoftware\mapview\MapViewPlugin - Copy.kt: (172, 40): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Map<String, Any>?
e: C:\flutter\.pub-cache\hosted\pub.dartlang.org\map_view-0.0.14\android\src\main\kotlin\com\apptreesoftware\mapview\MapViewPlugin - Copy.kt: (173, 37): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Map<String, Any>?
e: C:\flutter\.pub-cache\hosted\pub.dartlang.org\map_view-0.0.14\android\src\main\kotlin\com\apptreesoftware\mapview\MapViewPlugin - Copy.kt: (174, 31): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Map<String, Any>?
e: C:\flutter\.pub-cache\hosted\pub.dartlang.org\map_view-0.0.14\android\src\main\kotlin\com\apptreesoftware\mapview\MapViewPlugin - Copy.kt: (175, 28): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Map<String, Any>?
e: C:\flutter\.pub-cache\hosted\pub.dartlang.org\map_view-0.0.14\android\src\main\kotlin\com\apptreesoftware\mapview\MapViewPlugin - Copy.kt: (177, 21): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Map<String, Any>?
e: C:\flutter\.pub-cache\hosted\pub.dartlang.org\map_view-0.0.14\android\src\main\kotlin\com\apptreesoftware\mapview\MapViewPlugin - Copy.kt: (178, 66): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Map<String, Any>?
e: C:\flutter\.pub-cache\hosted\pub.dartlang.org\map_view-0.0.14\android\src\main\kotlin\com\apptreesoftware\mapview\MapViewPlugin.kt: (27, 7): Redeclaration: MapViewPlugin
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':map_view:compileDebugKotlin'.
> Compilation error. See log for more details
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
hi @Saddi993 i am facing same error and by your solution it work 👍 . but when app was installed there is nothing and only show Text 'Google Map Box' -_-
getting error while flutter run
Gradle task 'assembleDebug'... e: /Users/mac/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/map_view-0.0.14/android/src/main/kotlin/com/apptreesoftware/mapview/MapViewPlugin.kt: (168, 34):Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Map<String, Any>? e: /Users/mac/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/map_view-0.0.14/android/src/main/kotlin/com/apptreesoftware/mapview/MapViewPlugin.kt: (171, 36):Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Map<String, Any>? e: /Users/mac/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/map_view-0.0.14/android/src/main/kotlin/com/apptreesoftware/mapview/MapViewPlugin.kt: (172, 40):Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Map<String, Any>? e: /Users/mac/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/map_view-0.0.14/android/src/main/kotlin/com/apptreesoftware/mapview/MapViewPlugin.kt: (173, 37):Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Map<String, Any>? e: /Users/mac/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/map_view-0.0.14/android/src/main/kotlin/com/apptreesoftware/mapview/MapViewPlugin.kt: (174, 31):Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Map<String, Any>? e: /Users/mac/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/map_view-0.0.14/android/src/main/kotlin/com/apptreesoftware/mapview/MapViewPlugin.kt: (175, 28):Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Map<String, Any>? e: /Users/mac/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/map_view-0.0.14/android/src/main/kotlin/com/apptreesoftware/mapview/MapViewPlugin.kt: (177, 21):Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Map<String, Any>? e: /Users/mac/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/map_view-0.0.14/android/src/main/kotlin/com/apptreesoftware/mapview/MapViewPlugin.kt: (178, 66):Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Map<String, Any>?
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':map_view:compileDebugKotlin'.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 1m 31s