Skip to content
This repository was archived by the owner on Jun 25, 2019. It is now read-only.
This repository was 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

Description

@ZackPashkin

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!`

Activity

  1. MariaMelnik commented on Nov 6, 2018

    @MariaMelnik

    Same error

  2. frmunozr10 commented on Nov 8, 2018

    @frmunozr10

    same error

  3. deepchandyadav commented on Nov 9, 2018

    @deepchandyadav

    Same error

  4. jithin-dev commented on Nov 10, 2018

    @jithin-dev

    Same error

  5. Tran-Hoang-Lam commented on Nov 15, 2018

    @Tran-Hoang-Lam

    Does this plugin still under development?

  6. matthewtsmith commented on Nov 15, 2018

    @matthewtsmith
    Member

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

  7. Tran-Hoang-Lam commented on Nov 15, 2018

    @Tran-Hoang-Lam

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

  8. salmanDevj commented on Nov 23, 2018

    @salmanDevj

    getting same error!! any solutions to this?

  9. ilham-bintang commented on Nov 25, 2018

    @ilham-bintang

    Same error

  10. jiadmiftx commented on Nov 29, 2018

    @jiadmiftx

    same error

  11. deligence commented on Feb 14, 2019

    @deligence

    same error

  12. aidooyaw1992 commented on Feb 15, 2019

    @aidooyaw1992

    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;
                }
    
  13. aidooyaw1992 commented on Feb 15, 2019

    @aidooyaw1992

    copy and replace.
    it worked for me

  14. wuilmerj24 commented on Mar 9, 2019

    @wuilmerj24

    @aidooyaw1992 Hi
    Where did you copy that code?

  15. aidooyaw1992 commented on Mar 9, 2019

    @aidooyaw1992
  16. RodacK commented on Jun 21, 2019

    @RodacK

    this can help me:
    #129 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions