Skip to content
This repository has been archived by the owner on Jun 25, 2019. It is now read-only.

MapViewPlugin.kt: (168, 34): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Map<String, Any>? #136

Open
ZackPashkin opened this issue Nov 6, 2018 · 16 comments

Comments

@ZackPashkin
Copy link

Hi! Can you please help me, how to solve this problem. Thank you!

`tienen@tienen-B85M-D2V:/media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/schoolofai_app-zack-merged$ flutter run
Using hardware rendering with device Android SDK built for x86. If
you get graphics artifacts, consider enabling software rendering
with "--enable-software-rendering".
Launching lib/main.dart on Android SDK built for x86 in debug
mode...
Initializing gradle... 0.8s
Resolving dependencies... 2.1s
Gradle task 'assembleDebug'...
e:
/media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/
tools/flutter/.pub-cache/hosted/pub.dartlang.org/map_view-0.0.14/and
roid/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:
/media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/
tools/flutter/.pub-cache/hosted/pub.dartlang.org/map_view-0.0.14/and
roid/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:
/media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/
tools/flutter/.pub-cache/hosted/pub.dartlang.org/map_view-0.0.14/and
roid/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:
/media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/
tools/flutter/.pub-cache/hosted/pub.dartlang.org/map_view-0.0.14/and
roid/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:
/media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/
tools/flutter/.pub-cache/hosted/pub.dartlang.org/map_view-0.0.14/and
roid/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:
/media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/
tools/flutter/.pub-cache/hosted/pub.dartlang.org/map_view-0.0.14/and
roid/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:
/media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/
tools/flutter/.pub-cache/hosted/pub.dartlang.org/map_view-0.0.14/and
roid/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:
/media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/
tools/flutter/.pub-cache/hosted/pub.dartlang.org/map_view-0.0.14/and
roid/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'.

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

BUILD FAILED in 8s

Gradle task 'assembleDebug'... Done 9.1s
Gradle task assembleDebug failed with exit code 1
tienen@tienen-B85M-D2V:/media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/schoolofai_app-zack-merged$ flutter doctor -v[✓] Flutter (Channel dev, v0.10.1, on Linux, locale en_US.UTF-8)
• Flutter version 0.10.1 at /media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/tools/flutter
• Framework revision 6a3ff018b1 (3 weeks ago), 2018-10-18 18:38:26 -0400
• Engine revision 3860a43379
• Dart version 2.1.0-dev.7.1.flutter-b99bcfd309

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
• Android SDK at /media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/Android/Sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = /media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/Android/Sdk
• Java binary at: /media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
• All Android licenses accepted.

[✓] Android Studio (version 3.2)
• Android Studio at /media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/android-studio
• Flutter plugin version 30.0.1
• Dart plugin version 181.5656
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[✓] VS Code (version 1.28.2)
• VS Code at /usr/share/code
• Flutter extension version 2.20.0

[✓] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.1.0 (API 27) (emulator)

• No issues found!`

@MariaMelnik
Copy link

Same error

@frmunozr10
Copy link

same error

@deepchandyadav
Copy link

Same error

1 similar comment
@jithin-dev
Copy link

Same error

@Tran-Hoang-Lam
Copy link

Does this plugin still under development?

@matthewtsmith
Copy link
Member

@Tran-Hoang-Lam No, please see the README

@Tran-Hoang-Lam
Copy link

@matthewtsmith Thanks, I just confuse because issue keep opening but no one answer or do anything.

@salmanDevj
Copy link

getting same error!! any solutions to this?

@ilham-bintang
Copy link

Same error

@jiadmiftx
Copy link

same error

@deligence
Copy link

same error

@aidooyaw1992
Copy link

aidooyaw1992 commented Feb 15, 2019

Hi! Can you please help me, how to solve this problem. Thank you!

`tienen@tienen-B85M-D2V:/media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/schoolofai_app-zack-merged$ flutter run
Using hardware rendering with device Android SDK built for x86. If
you get graphics artifacts, consider enabling software rendering
with "--enable-software-rendering".
Launching lib/main.dart on Android SDK built for x86 in debug
mode...
Initializing gradle... 0.8s
Resolving dependencies... 2.1s
Gradle task 'assembleDebug'...
e:
/media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/
tools/flutter/.pub-cache/hosted/pub.dartlang.org/map_view-0.0.14/and
roid/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:
/media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/
tools/flutter/.pub-cache/hosted/pub.dartlang.org/map_view-0.0.14/and
roid/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:
/media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/
tools/flutter/.pub-cache/hosted/pub.dartlang.org/map_view-0.0.14/and
roid/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:
/media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/
tools/flutter/.pub-cache/hosted/pub.dartlang.org/map_view-0.0.14/and
roid/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:
/media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/
tools/flutter/.pub-cache/hosted/pub.dartlang.org/map_view-0.0.14/and
roid/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:
/media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/
tools/flutter/.pub-cache/hosted/pub.dartlang.org/map_view-0.0.14/and
roid/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:
/media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/
tools/flutter/.pub-cache/hosted/pub.dartlang.org/map_view-0.0.14/and
roid/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:
/media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/
tools/flutter/.pub-cache/hosted/pub.dartlang.org/map_view-0.0.14/and
roid/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'.

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

BUILD FAILED in 8s

Gradle task 'assembleDebug'... Done 9.1s
Gradle task assembleDebug failed with exit code 1
tienen@tienen-B85M-D2V:/media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/schoolofai_app-zack-merged$ flutter doctor -v[✓] Flutter (Channel dev, v0.10.1, on Linux, locale en_US.UTF-8)
• Flutter version 0.10.1 at /media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/tools/flutter
• Framework revision 6a3ff018b1 (3 weeks ago), 2018-10-18 18:38:26 -0400
• Engine revision 3860a43379
• Dart version 2.1.0-dev.7.1.flutter-b99bcfd309

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
• Android SDK at /media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/Android/Sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = /media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/Android/Sdk
• Java binary at: /media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
• All Android licenses accepted.

[✓] Android Studio (version 3.2)
• Android Studio at /media/tienen/c139a775-f6cd-4467-898d-bc3fd2ecccc0/zack/development/android-studio
• Flutter plugin version 30.0.1
• Dart plugin version 181.5656
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[✓] VS Code (version 1.28.2)
• VS Code at /usr/share/code
• Flutter extension version 2.20.0

[✓] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.1.0 (API 27) (emulator)

• No issues found!`

           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;
            }

@aidooyaw1992
Copy link

copy and replace.
it worked for me

@wuilmerj24
Copy link

@aidooyaw1992 Hi
Where did you copy that code?

@aidooyaw1992
Copy link

aidooyaw1992 commented Mar 9, 2019 via email

@RodacK
Copy link

RodacK commented Jun 21, 2019

this can help me:
#129 (comment)

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

No branches or pull requests