heremaps / here-sdk-examples

Android, iOS and Flutter example apps for the HERE SDK 4.x (Lite Edition, Explore Edition, Navigate Edition)
https://developer.here.com/products/here-sdk
Apache License 2.0
171 stars 135 forks source link

HERE Flutter SDK Issue - Method not found #72

Closed nathan380 closed 3 years ago

nathan380 commented 3 years ago

Hello, I develop on the flutter framework, when I install the here sdk and make the necessary settings, I run the example program the following error is displayed on the debugging console, would you have a solution to this problem, thank you!

plugins/here_sdk/lib/src/builtin_typesconversion.dart:82:23: Error: Method not found: 'Utf8.toUtf8'. final cValue = Utf8.toUtf8(value); ^^^^^^ plugins/here_sdk/lib/src/builtin_typesconversion.dart:84:3: Error: Method not found: 'free'. free(cValue); ^^^^ plugins/here_sdk/lib/src/builtin_typesconversion.dart:88:53: Error: Method not found: 'Utf8.fromUtf8'. String String_fromFfi(Pointer handle) => Utf8.fromUtf8(_String_get_value(handle)); ^^^^^^^^ plugins/here_sdk/lib/src/builtin_typesconversion.dart:120:30: Error: Method not found: 'Utf8.toUtf8'. final cLanguageCode = Utf8.toUtf8(locale.languageCode); ^^^^^^ plugins/here_sdk/lib/src/builtin_typesconversion.dart:122:39: Error: Method not found: 'Utf8.toUtf8'. locale.countryCode != null ? Utf8.toUtf8(locale.countryCode) : Pointer.fromAddress(0); ^^^^^^ plugins/here_sdk/lib/src/builtin_typesconversion.dart:124:38: Error: Method not found: 'Utf8.toUtf8'. locale.scriptCode != null ? Utf8.toUtf8(locale.scriptCode) : Pointer.fromAddress(0); ^^^^^^ plugins/here_sdk/lib/src/builtin_typesconversion.dart:125:29: Error: Method not found: 'Utf8.toUtf8'. final cLanguageTag = Utf8.toUtf8(locale.toLanguageTag()); ^^^^^^ plugins/here_sdk/lib/src/builtin_typesconversion.dart:129:3: Error: Method not found: 'free'. free(cLanguageCode); ^^^^ plugins/here_sdk/lib/src/builtin_typesconversion.dart:130:34: Error: Method not found: 'free'. if (cCountryCode.address != 0) free(cCountryCode); ^^^^ plugins/here_sdk/lib/src/builtin_typesconversion.dart:131:33: Error: Method not found: 'free'. if (cScriptCode.address != 0) free(cScriptCode); ^^^^ lugins/here_sdk/lib/src/builtin_typesconversion.dart:132:3: Error: Method not found: 'free'. free(cLanguageTag); ^^^^ plugins/here_sdk/lib/src/builtin_typesconversion.dart:141:30: Error: Method not found: 'Utf8.fromUtf8'. return Locale.parse(Utf8.fromUtf8(languageTagCstring)); ^^^^^^^^ plugins/here_sdk/lib/src/builtin_typesconversion.dart:149:59: Error: Method not found: 'Utf8.fromUtf8'. languageCode: languageCodeCstring.address != 0 ? Utf8.fromUtf8(languageCodeCstring) : null, ^^^^^^^^ plugins/here_sdk/lib/src/builtin_typesconversion.dart:150:57: Error: Method not found: 'Utf8.fromUtf8'. countryCode: countryCodeCstring.address != 0 ? Utf8.fromUtf8(countryCodeCstring) : null, ^^^^^^^^ plugins/here_sdk/lib/src/builtin_types__conversion.dart:151:55: Error: Method not found: 'Utf8.fromUtf8'. scriptCode: scriptCodeCstring.address != 0 ? Utf8.fromUtf8(scriptCodeCstring) : null ^^^^^^^^

FAILURE: Build failed with an exception.

BUILD FAILED in 30s Exception: Gradle task assembleDebug failed with exit code 1 Exited (sigterm)

HERE-SDK-Support-Team commented 3 years ago

@nathan380 This was already answered here: https://github.com/heremaps/here-sdk-examples/issues/67

Basically, this was caused by an incompatible ffi version. We use FFI 0.1.3, and we will update to ffi 1.0 for one of the next releases. Until then other plugins that do not use 0.1.3 will not work together with the HERE SDK. This is a general problem with FFI.

With HERE SDK 4.6.5 this error was made more explicit.

nicks258 commented 3 years ago

waiting for update.

HERE-SDK-Support-Team commented 3 years ago

Hi @nicks258, we already released 4.6.5, 4.7.0 and 4.7.1, all of which contain the aforementioned improvement. If it does not work as expected, please reply here. Note that FFI 1.0 is not yet rolled out, as some customers still use FFI 0.1.3.