Coder Social home page Coder Social logo

hms-core / hms-flutter-plugin Goto Github PK

View Code? Open in Web Editor NEW
274.0 17.0 134.0 29.61 MB

This repo contains all of Flutter HMS plugins.

Home Page: https://developer.huawei.com/consumer/en/doc/overview/HMS-Core-Plugin?ha_source=hms1

License: Apache License 2.0

Java 51.20% Dart 44.80% Objective-C 0.05% Ruby 0.09% Swift 0.51% GLSL 0.02% AIDL 0.02% HTML 3.32%
hms flutter flutter-plugin location huawei

hms-flutter-plugin's Introduction

HMS Flutter Plugins

license

This repo contains the source code for HMS Flutter first-party plugins, which are developed by the HMS Core team.

These plugins enable access to using kit-specific APIs. For more information about plugins, and how to use them, see Official Documentations.

Plugins

These are the available plugins in this repository.

Plugin Version Documentation Demo Project
Account version Getting Started
API Reference
example
Ads version Getting Started
API Reference
example
Ads Prime version Getting Started
API Reference
example
Analytics version Getting Started
API Reference
example
AR Engine version Getting Started
API Reference
example
HMS Availability version Getting Started
API Reference
example
Awareness version Getting Started
API Reference
example
Contact Shield version Getting Started
API Reference
example
Drive version Getting Started
API Reference
example
Dynamic Tag Manager version Getting Started
API Reference
example
FIDO version Getting Started
API Reference
example
Game Service version Getting Started
API Reference
example
Health version Getting Started
API Reference
example
In-App Purchases version Getting Started
API Reference
example
Location version Getting Started
API Reference
example
Map version Getting Started
API Reference
example
ML version Getting Started
API Reference
example
ML Body version Getting Started
API Reference
example
ML Image version Getting Started
API Reference
example
ML Language version Getting Started
API Reference
example
ML Text version Getting Started
API Reference
example
3D Modeling version Getting Started
API Reference
example
Nearby Service version Getting Started
API Reference
example
Push version Getting Started
API Reference
example
Push-FCM version Getting Started
API Reference
example
Safety Detect version Getting Started
API Reference
example
Scan version Getting Started
API Reference
example
Site version Getting Started
API Reference
example
Wallet version Getting Started
API Reference
example

Question or issues

If you want to evaluate more about HMS Core, r/HMSCore on Reddit is for you to keep up with latest news about HMS Core, and to exchange insights with other developers.

If you have questions about how to use HMS samples, try the following options:

  • Stack Overflow is the best place for any programming questions. Be sure to tag your question with huawei-mobile-services.
  • Huawei Developer Forum HMS Core Module is great for general questions, or seeking recommendations and opinions.

If you run into a bug in our samples, please submit an issue to the Repository. Even better you can submit a Pull Request with a fix.

hms-flutter-plugin's People

Contributors

aktug avatar cagdasmer avatar fuatbakkal avatar mike-mei avatar ozkulbeng avatar serdar-can avatar tiantian0303 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hms-flutter-plugin's Issues

release包ocr识别失败,debug包正常

手机型号:华为mate8
现象:f5调试或者flutter build apk --debug打的包可以正常识别ocr。但release打包总识别失败,求解
版本信息:
huawei_ml: 2.0.1+300
classpath 'com.huawei.agconnect:agcp:1.3.1.300'

Unable to display map in cloud debugging.

Description
Have added to display Map as in the documentation. I'm not sure it's only related to cloud debugging.
Trying to display map on screen, cloud debugging using Mate 30 and Mate 30 Pro, P40

Expected behavior
Map Shown

Current behavior
Shows a grey screen and error as in the logs below.

Logs
android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
at android.app.ContextImpl.startActivity(ContextImpl.java:1031)
at android.app.ContextImpl.startActivity(ContextImpl.java:1000)
at android.content.ContextWrapper.startActivity(ContextWrapper.java:383)
at android.content.ContextWrapper.startActivity(ContextWrapper.java:383)
at android.content.ContextWrapper.startActivity(ContextWrapper.java:383)
at com.huawei.hms.maps.mbu.c(Unknown Source:59)
at com.huawei.hms.maps.mbu.b(Unknown Source:8)
at com.huawei.hms.maps.mbu.a(Unknown Source:15)
at com.huawei.hms.maps.MapView$maa.createDelegate(Unknown Source:57)
at com.huawei.hms.feature.dynamic.DeferredLifecycleHelper.a(Unknown Source:44)
at com.huawei.hms.feature.dynamic.DeferredLifecycleHelper.onCreate(Unknown Source:5)
at com.huawei.hms.maps.MapView.onCreate(Unknown Source:29)
at com.huawei.hms.flutter.map.map.MapController.init(MapController.java:139)
at com.huawei.hms.flutter.map.map.MapBuilder.build(MapBuilder.java:67)
at com.huawei.hms.flutter.map.map.MapFactory.create(MapFactory.java:87)
at io.flutter.plugin.platform.SingleViewPresentation.onCreate(SingleViewPresentation.java:186)
at android.app.Dialog.dispatchOnCreate(Dialog.java:579)
at android.app.Dialog.show(Dialog.java:397)
at android.app.Presentation.show(Presentation.java:250)
at io.flutter.plugin.platform.VirtualDisplayController.(VirtualDisplayController.java:95)
at io.flutter.plugin.platform.VirtualDisplayController.create(VirtualDisplayController.java:48)
at io.flutter.plugin.platform.PlatformViewsController$1.createVirtualDisplayForPlatformView(PlatformViewsController.java:207)
at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:104)
at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59)
at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:692)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:363)
at android.os.Looper.loop(Looper.java:173)
at android.app.ActivityThread.main(ActivityThread.java:8147)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)

Environment

  • Platform: Flutter
  • Kit: Map
  • Kit Version 5.0.3+302
  • OS Version: Android 10
  • Android Studio version 4.1.1
  • Platform version Flutter 1.22.4
  • Your Location/Region Malaysia

Thanks

[huawei_iap] Cross-ecosystem app published to Google Play Store

There are some recent changes at Google (https://support.google.com/googleplay/android-developer/answer/9934569). Although the wording says that it will only become effective next year, I have the actual experience right now that the Play Console upload process already refuses to accept any app that has HMS code in it.

We can build two different apps (with different package names) for Play Store and App Gallery, yes. Still, even with the other flavor, some remaining code will be present in the app that makes the Play Store refuse it (and you might be tempted to do the same later, in retaliation, who knows). As far as I can tell, while I can handle with flavors what my own app pulls in as a dependency, I can't do the same with Flutter plugins I reference. So, if I use huawei_iap, for instance, its Gradle setup has:

dependencies {
    implementation 'com.huawei.hms:iap:4.0.4.300'
    implementation 'com.google.code.gson:gson:2.8.5'
}

The actual code might have been removed by tree shaking, probably so, I don't know, but still, there are enough references in the app bundle metadata to make the Play Console refuse the package (actually, without saying a single error message, just a red exclamation point).

(Just to make sure, there's no doubt that the HMS code is triggering this, as soon as I comment them out completely, with everything else unchanged, the app gets accepted during upload.)

Is this something new? Is this something you can have a suggestion about?

The 5.0.3 account update is broken

Description
MissingPluginException(No implementation found for method signIn on channel huawei_account)

Expected behavior
To work

Current behavior
It doesn't work

Logs
I/flutter (24234): MissingPluginException(No implementation found for method signIn on channel huawei_account) I/flutter (24234): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:157:7) I/flutter (24234): <asynchronous suspension> I/flutter (24234): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:332:12) I/flutter (24234): #2 HmsAccount.signIn (package:huawei_account/hms_account.dart:58:24)

Environment

  • Platform: Flutter
  • Kit: Account
  • Kit Version 5.0.3
  • OS Version Android 10
  • IntelliJ version 2020.3

Huawei Map Crashed on Huawei Nova 3i when myLocationEnabled is true.

Hi, I can load the Huawei Map on my devices successfully, but when I set the myLocationEnabled equal to true, the app crashed immediately on Huawei Nova 3i (Android 9) device.

However, the Huawei Map with myLocationEnabled equal to true can works without any issues in both of my Huawei P30 (Android 10) and Huawei Nova 7i (Android 10) devices.

Here is the log when the crash happened.

E/HMSSDK_AGCUtils(30502): Get appId with AGConnectServicesConfig failed
E/HMSSDK_AGCUtils(30502): Get cpid with AGConnectServicesConfig failed
I/HMSSDK_AGCUtils(30502): In getMetaDataCpId, Failed to read meta data for the CpId.
I/HMSSDK_HMSBIInitializer(30502): Builder->biInitFlag :false
I/HMSSDK_HMSBIInitializer(30502): Builder->biSetting :false
I/HMSSDK_CountryCodeBean(30502): getCountryCode get country code from SIM_COUNTRY
W/HMSSDK_CountryCodeBean(30502): countryCode from system language is not reliable.
E/HMSSDK_HMSBIInitializer(30502): Failed to get device issue country
I/HmsMapKit_HuaweiMapImpl_116(30502): setMyLocationEnabled: true
W/RenderEngine_IMap(30502): 地图未初始化完成。
I/HMSSDK_LocationClientImpl(30502): |4abe6a15-bd2d-4c2c-9e9f-9375d95b536d|checkLocationSettings
I/HMSSDK_HiAnalyticsUtil(30502): not ChinaROM
I/HMSSDK_HiAnalyticsUtil(30502): hw_app_analytics_state value is 0
D/HmsMapKit_HuaweiMapImpl_240(30502): getUiSettings:
D/HmsMapKit_UISettings_24(30502): UISettings:
I/HmsMapKit_UISettingImp_169(30502): setMyLocationButtonEnabled: true
I/HMSSDK_HuaweiApiManager(30502): sendRequest
I/HMSSDK_BaseHmsClient(30502): ====== HMSSDK version: 50000300 ======
I/HMSSDK_BaseHmsClient(30502): Enter connect, Connection Status: 1
I/HMSSDK_BaseHmsClient(30502): connect minVersion:30000000
I/HiTouch_HiTouchSensor(30502): HiTouch restricted: Sub windows restricted.
D/HiTouch_PressGestureDetector(30502): onAttached, package=com.herdhr.herdhrpersonal, windowType=2037, mHiTouchRestricted=true
I/HMSSDK_Util(30502): available exist: true
E/HMSSDK_Util(30502): In isAvailableLibExist, Failed to read meta data for the availableLoaded.
I/HMSSDK_Util(30502): available exist: true
I/MapRender(30502): ERROR MapView.cpp:318: MapView::[SwitchMapType] enter!
I/HMSSDK_HMSPackageManager(30502): current versionCode:50002301, minimum version requirements: 30000000
I/HMSSDK_HMSPackageManager(30502): MinApkVersion is disabled.
I/HMSSDK_BaseHmsClient(30502): check available result: 0
I/HMSSDK_BaseHmsClient(30502): enter bindCoreService
I/MapRender(30502): ERROR MapView.cpp:318: MapView::[SwitchMapType] enter!
D/mali_winsys(30502): EGLint new_window_surface(egl_winsys_display *, void , EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
D/OpenGLRenderer(30502): HWUI Binary is enabled
D/mali_winsys(30502): EGLint new_window_surface(egl_winsys_display , void , EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
I/MapRender(30502): ERROR TextureCache.cpp:100: Fail to create texture with url img/native.png
I/HMSSDK_BinderAdapter(30502): Enter onServiceConnected.
I/HMSSDK_BaseHmsClient(30502): Enter onServiceConnected.
I/HMSSDK_LocationClientBuilder(30502): onConnected, send suspended requests
I/HMSSDK_LocationClientBuilder(30502): onConnected, requests cache list is empty
I/HMSSDK_HmsClient(30502): post msg api_name:location.checkLocationSettings, app_id:102751379|, pkg_name:com.herdhr.herdhrpersonal, sdk_version:50000300, session_id:
, transaction_id:102751379ttings20200907161238560504173, kitSdkVersion:0, apiLevel:1
D/HmsMapKit_MapViewImpl_94(30502): onMapReady
I/HMSSDK_BaseAdapter(30502): in baseRequest + uri is :location.checkLocationSettings, transactionId is : 102751379ttings20200907161238560504173
I/HMSSDK_PendingResultImpl(30502): init uri:location.checkLocationSettings
I/HMSSDK_PendingResultImpl(30502): setResultCallback
D/HmsMapKit_HuaweiMap_110(30502): HuaweiMap:
D/HmsMapKit_HuaweiMapImpl_216(30502): setTrafficEnabled: false
D/HmsMapKit_HuaweiMapImpl_98(30502): setBuildingsEnabled: true
I/HmsMapKit_HuaweiMap_1339(30502): onInfoWindowClick setListener start:
D/HmsMapKit_HuaweiMapImpl_520(30502): setOnInfoWindowClickListener
I/HmsMapKit_HuaweiMap_198(30502): setCameraMoveListener:
D/HmsMapKit_HuaweiMapImpl_443(30502): setCameraMoveListener
I/HmsMapKit_HuaweiMap_157(30502): setOnCameraMoveStartedListener:
D/HmsMapKit_HuaweiMapImpl_434(30502): setCameraMoveStartedListener
I/HmsMapKit_HuaweiMap_178(30502): setOnCameraIdleListener:
D/HmsMapKit_HuaweiMapImpl_461(30502): setCameraIdleListener: success
I/HmsMapKit_HuaweiMap_897(30502): onMarkerClick setListener start:
D/HmsMapKit_HuaweiMapImpl_565(30502): onMarkerClick trans start
I/HmsMapKit_HuaweiMap_947(30502): onMarkerDrag setListener start:
D/HmsMapKit_HuaweiMapImpl_574(30502): iOnMarkerDragListener: success
I/HmsMapKit_HuaweiMap_1064(30502): setOnPolygonClickListener:
D/HmsMapKit_HuaweiMapImpl_493(30502): setPolygonClickListener: success
I/HmsMapKit_HuaweiMap_1029(30502): setOnCircleClickListener:
D/HmsMapKit_HuaweiMapImpl_502(30502): setPolylineClickListener: success
I/HmsMapKit_HuaweiMap_994(30502): onCircleClick setListener start:
D/HmsMapKit_HuaweiMapImpl_484(30502): onCircleClick trans start
I/HmsMapKit_HuaweiMap_1088(30502): setOnMapClickListener:
D/HmsMapKit_HuaweiMap_1116(30502): setOnMapLongClickListener
D/HmsMapKit_HuaweiMapImpl_583(30502): setOnMapLongClickListener
D/HmsMapKit_HuaweiMapImpl_269(30502): addMarker start:
D/HmsMapKit_HuaweiMapImpl_269(30502): setAnchor by old Interface
D/HmsMapKit_MarkerImpl_1797(30502): setRotation:
D/HmsMapKit_MarkerImpl_1798(30502): setDraggable:
D/HmsMapKit_MarkerImpl_56(30502): getId:
D/HmsMapKit_MarkerImpl_56(30502): getId:
E/HMSSDK_AGCUtils(30502): Get appId with AGConnectServicesConfig failed
E/HMSSDK_AGCUtils(30502): Get cpid with AGConnectServicesConfig failed
I/HMSSDK_AGCUtils(30502): In getMetaDataCpId, Failed to read meta data for the CpId.
I/HMSSDK_HMSBIInitializer(30502): Builder->biInitFlag :false
I/HMSSDK_HMSBIInitializer(30502): Builder->biSetting :false
I/HMSSDK_CountryCodeBean(30502): getCountryCode get country code from SIM_COUNTRY
W/HMSSDK_CountryCodeBean(30502): countryCode from system language is not reliable.
E/HMSSDK_HMSBIInitializer(30502): Failed to get device issue country
E/libEGL (30502): call to OpenGL ES API with no current context (logged once per thread)
I/MapRender(30502): ERROR TextureCache.cpp:100: Fail to create texture with url img/native.png
I/HMSSDK_LocationClientImpl(30502): |f7a97fbc-d27d-4604-a9c2-757640d255c2|checkLocationSettings
D/HmsMapKit_HuaweiMapImpl_240(30502): getUiSettings:
I/HMSSDK_PendingResultImpl(30502): setResult:0
D/HmsMapKit_UISettings_24(30502): UISettings:
I/HMSSDK_HuaweiApiManager(30502): sendRequest
I/HmsMapKit_UISettingImp_169(30502): setMyLocationButtonEnabled: true
I/HMSSDK_HmsClient(30502): post msg api_name:location.checkLocationSettings, app_id:102751379|, pkg_name:com.herdhr.herdhrpersonal, sdk_version:50000300, session_id:
, transaction_id:102751379ttings20200907161238637151015, kitSdkVersion:0, apiLevel:1
I/HMSSDK_BaseAdapter(30502): in baseRequest + uri is :location.checkLocationSettings, transactionId is : 102751379ttings20200907161238637151015
I/HMSSDK_PendingResultImpl(30502): init uri:location.checkLocationSettings
I/HMSSDK_PendingResultImpl(30502): setResultCallback
I/MapRender(30502): WARNING Atlas.cpp:135: Glyph not found for 0x20
I/HmsMapKit_HuaweiMap_163(30502): onCameraMoveStarted: 3
I/HmsMapKit_HuaweiMap_203(30502): onCameraMove:
I/HmsMapKit_HuaweiMap_183(30502): onCameraIdle:
I/HMSSDK_BaseAdapter(30502): baseCallBack.onComplete
E/ (30502): [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
I/HMSSDK_HmsClient(30502): receive msg status_code:0, error_code0, api_name:location.checkLocationSettings, app_id:102751379|, pkg_name:com.herdhr.herdhrpersonal, session_id:
, transaction_id:102751379ttings20200907161238560504173, resolution:null
I/HMSSDK_CheckLocationSettingsTaskApiCall(30502): |4abe6a15-bd2d-4c2c-9e9f-9375d95b536d|doExecute
I/HmsMapKit_HuaweiMapImpl_0(30502): check location settings onFailure
D/AndroidRuntime(30502): Shutting down VM
E/AndroidRuntime(30502): FATAL EXCEPTION: main
E/AndroidRuntime(30502): Process: com.herdhr.herdhrpersonal, PID: 30502
E/AndroidRuntime(30502): java.lang.ClassCastException: io.flutter.plugin.platform.SingleViewPresentation$PresentationContext cannot be cast to android.app.Activity
E/AndroidRuntime(30502): at com.huawei.hms.maps.provider.huawei.c$13.b(:463)
E/AndroidRuntime(30502): at o.ea$5.run(Unknown Source:0)
E/AndroidRuntime(30502): at android.os.Handler.handleCallback(Handler.java:907)
E/AndroidRuntime(30502): at android.os.Handler.dispatchMessage(Handler.java:105)
E/AndroidRuntime(30502): at android.os.Looper.loop(Looper.java:216)
E/AndroidRuntime(30502): at android.app.ActivityThread.main(ActivityThread.java:7625)
E/AndroidRuntime(30502): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(30502): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
E/AndroidRuntime(30502): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
I/HmsMapKit_CrashHandler_136(30502): uncaughtException
D/HmsMapKit_CrashHandler_86(30502): logLength is 646
E/HmsMapKit_CrashHandler_86(30502): uncaughtException stacktrace is java.lang.ClassCastException: io.flutter.plugin.platform.SingleViewPresentation$PresentationContext cannot be cast to android.app.Activity
E/HmsMapKit_CrashHandler_86(30502): at com.huawei.hms.maps.provider.huawei.c$13.b(:463)
E/HmsMapKit_CrashHandler_86(30502): at o.ea$5.run(Unknown Source:0)
E/HmsMapKit_CrashHandler_86(30502): at android.os.Handler.handleCallback(Handler.java:907)
E/HmsMapKit_CrashHandler_86(30502): at android.os.Handler.dispatchMessage(Handler.java:105)
E/HmsMapKit_CrashHandler_86(30502): at android.os.Looper.loop(Looper.java:216)
E/HmsMapKit_CrashHandler_86(30502): at android.app.ActivityThread.main(ActivityThread.java:7625)
E/HmsMapKit_CrashHandler_86(30502): at java.lang.reflect.Method.invoke(Native Method)
E/HmsMapKit_CrashHandler_86(30502): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
E/HmsMapKit_CrashHandler_86(30502): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
E/HmsMapKit_CrashHandler_86(30502): deviceModel is INE-LX2 emuiVersion is EmotionUI_9.1.0 packageName is com.herdhr.herdhrpersonal rom version is INE-LX2 9.1.0.248(C636E1R1P1)
I/HMSSDK_PendingResultImpl(30502): setResult:0
D/HmsMapKit_MapReportProvider_153(30502): recordErrorLog errorReportInfo is :BaseReportInfo{className='com.huawei.hms.maps.report.CrashHandler', apiName='uncaughtException', errorCode='999999', startTime=1599466358764}ErrorReportInfo{errorMsg='java.lang.ClassCastException: io.flutter.plugin.platform.SingleViewPresentation$PresentationContext cannot be cast to android.app.Activity
D/HmsMapKit_MapReportProvider_153(30502): at com.huawei.hms.maps.provider.huawei.c$13.b(:463)
D/HmsMapKit_MapReportProvider_153(30502): at o.ea$5.run(Unknown Source:0)
D/HmsMapKit_MapReportProvider_153(30502): at android.os.Handler.handleCallback(Handler.java:907)
D/HmsMapKit_MapReportProvider_153(30502): at android.os.Handler.dispatchMessage(Handler.java:105)
D/HmsMapKit_MapReportProvider_153(30502): at android.os.Looper.loop(Looper.java:216)
D/HmsMapKit_MapReportProvider_153(30502): at android.app.ActivityThread.main(ActivityThread.java:7625)
D/HmsMapKit_MapReportProvider_153(30502): at java.lang.reflect.Method.invoke(Native Method)
D/HmsMapKit_MapReportProvider_153(30502): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
D/HmsMapKit_MapReportProvider_153(30502): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
D/HmsMapKit_MapReportProvider_153(30502): '}
W/HmsMapKit_MapTracker_159(30502): is not Allow Report
I/HmsMapKit_MapReportManager_1060(30502): record error log success. apiName: uncaughtException ,errorMessage: java.lang.ClassCastException: io.flutter.plugin.platform.SingleViewPresentation$PresentationContext cannot be cast to android.app.Activity
I/HmsMapKit_MapReportManager_1060(30502): at com.huawei.hms.maps.provider.huawei.c$13.b(:463)
I/HmsMapKit_MapReportManager_1060(30502): at o.ea$5.run(Unknown Source:0)
I/HmsMapKit_MapReportManager_1060(30502): at android.os.Handler.handleCallback(Handler.java:907)
I/HmsMapKit_MapReportManager_1060(30502): at android.os.Handler.dispatchMessage(Handler.java:105)
I/HmsMapKit_MapReportManager_1060(30502): at android.os.Looper.loop(Looper.java:216)
I/HmsMapKit_MapReportManager_1060(30502): at android.app.ActivityThread.main(ActivityThread.java:7625)
I/HmsMapKit_MapReportManager_1060(30502): at java.lang.reflect.Method.invoke(Native Method)
I/HmsMapKit_MapReportManager_1060(30502): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
I/HmsMapKit_MapReportManager_1060(30502): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
I/HmsMapKit_MapReportManager_1060(30502): ,errorCode: 999999
I/HiAnalytics/event(30502): [2020-09-07 16:12:38.772 I/hianalytics/HiAnalytics/event 30502:1 :50] HiAnalyticsInstance.onReport() is execute.TAG: hms_map,TYPE: 1
I/HiAnalytics/event(30502): [2020-09-07 16:12:38.773 I/hianalytics/HiAnalytics/event 30502:1 null:45] onReport: Before calling runtaskhandler()
I/HmsMapKit_MapTracker_50(30502): onReport end
I/HmsMapKit_MapReportManager_50(30502): report log success.
I/HmsMapKit_CrashHandler_136(30502): manual action --
I/HiAnalytics/event(30502): [2020-09-07 16:12:38.784 I/hianalytics/HiAnalytics/event 30502:1591 ThreadPoolExecutor.java:1187] run report.TAG : hms_map,TYPE: maint
W/ActionData(30502): [2020-09-07 16:12:38.791 W/hianalytics/ActionData 30502:1591 null:0] No data from cache sp!
I/SharedPreferenceUtil(30502): [2020-09-07 16:12:38.795 I/hianalytics/SharedPreferenceUtil 30502:1591 null:6] clear data file : eventTag : hms_map-maint
I/.herdhrpersona(30502): Background concurrent copying GC freed 51318(3MB) AllocSpace objects, 62(17MB) LOS objects, 50% free, 9MB/19MB, paused 931us total 116.283ms
W/System (30502): A resource failed to call release.
I/Process (30502): Sending signal. PID: 30502 SIG: 9
Lost connection to device.
Exited (sigterm)

cannot compile under ios

Fetching podspec for huawei_push from .symlinks/plugins/huawei_push/ios
[!] The huawei_push pod failed to validate due to 1 error:
- ERROR | attributes: Missing required attribute authors.
- WARN | license: Missing license type.
- WARN | description: The description is equal to the summary.
- WARN | [iOS] keys: Missing primary key for source attribute. The acceptable ones are: git, hg, http, svn.

[huawei_push] Push.getTokenStream triggered across apps

Description
When calling Push.getToken() from AppsA, both AppsA and AppsB will be triggered Push.getTokenStream with same token. Risk of getting wrong token for other flutter apps that using Push.getTokenStream.

Expected behavior
Push.getTokenStream only triggered for app itself that calling Push.getToken().

Current behavior
Push.getTokenStream triggered across apps with same token.

Environment

  • Platform: Flutter
  • Kit: Push
  • Kit Version 5.0.2+301
  • OS Version Android 9

Other
You may reproduce it by creating 2 projects/apps and trigger Push.getToken() and print the token value of Push.getTokenStream in both projects. Make sure the other app in background is running / not killed.

huawei_scan app crashed on code scan

Using the huawei_scan flutter plugin causes the entire app to crash after scanning is complete or on back button pressed.
here is the log

E/HaLogProvider(31415): forbiddenHiLog openHa = false
E/HaLogProvider(31415): forbiddenHiLog.getVenderCountry=meafnaf
E/HaLogProvider(31415): forbiddenHiLog openHa = false
D/ScanSize(31415): top:499scanSizeHeight783height:1920
I/ScankitDecode(31415): sdk version 1.2.2.300APK
I/ScankitDecode(31415): ScanCode successful
I/CaptureHandler(31415): scan successful
I/c (31415): result onResult
I/c (31415): result callback end: pauseStatusfalse
I/OnResultCallbackDelegat(31415): result callback sdk continueScanfalse
I/OnResultCallbackDelegat(31415): result callback sdk continueScanfalse
D/HMSLogger(31415): singleEventMap -> {result=0, apiName=CustomizedViewActivity.customizedView, package=kawi.healthpal.huawei, costTime=96659, service=FlutterScan, appid=102998471, model=HWJKM-H, cpAppVersion=1.0.0, networkType=4G, version=1.2.2.300, callTime=1601912706174}
D/CameraManager(31415): CameraManager::requestPreviewFrame PREVIEW_ONE_SHOT
D/HMSLogger(31415): singleEventMap -> {result=0, apiName=remoteView.onPause, package=kawi.healthpal.huawei, costTime=10, service=FlutterScan, appid=102998471, model=HWJKM-H, cpAppVersion=1.0.0, networkType=4G, version=1.2.2.300, callTime=1601912706246}
D/ZrHung.AppEyeUiProbe(31415): stop checker.
E/HaLogProvider(31415): forbiddenHiLog openHa = false
E/HaLogProvider(31415): forbiddenHiLog.getVenderCountry=meafnaf
E/HaLogProvider(31415): forbiddenHiLog openHa = false
D/ScanSize(31415): top:499scanSizeHeight783height:1920
I/ScankitDecode(31415): sdk version 1.2.2.300APK
W/ealthpal.huawe(31415): Accessing hidden field Lsun/misc/Unsafe;->theUnsafe:Lsun/misc/Unsafe; (light greylist, reflection)
I/MethodHandler(31415): No request code found
D/AndroidRuntime(31415): Shutting down VM
W/ealthpal.huawe(31415): Accessing hidden method Lcom/msic/qarth/PatchStore;->createDisableExceptionQarthFile(Ljava/lang/Throwable;)Z (blacklist, JNI)
E/ealthpal.huawe(31415): [qarth_debug:] get PatchStore::createDisableExceptionQarthFile method fail.
E/AndroidRuntime(31415): FATAL EXCEPTION: main
E/AndroidRuntime(31415): Process: kawi.healthpal.huawei, PID: 31415
E/AndroidRuntime(31415): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=14, result=-1, data=Intent { (has extras) }} to activity {kawi.healthpal.huawei/kawi.healthpal.huawei.MainActivity}: java.lang.NullPointerException
E/AndroidRuntime(31415): at android.app.ActivityThread.deliverResults(ActivityThread.java:5078)
E/AndroidRuntime(31415): at android.app.ActivityThread.handleSendResult(ActivityThread.java:5120)
E/AndroidRuntime(31415): at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49)
E/AndroidRuntime(31415): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
E/AndroidRuntime(31415): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
E/AndroidRuntime(31415): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199)
E/AndroidRuntime(31415): at android.os.Handler.dispatchMessage(Handler.java:112)
E/AndroidRuntime(31415): at android.os.Looper.loop(Looper.java:216)
E/AndroidRuntime(31415): at android.app.ActivityThread.main(ActivityThread.java:7625)
E/AndroidRuntime(31415): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(31415): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
E/AndroidRuntime(31415): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
E/AndroidRuntime(31415): Caused by: java.lang.NullPointerException
E/AndroidRuntime(31415): at java.util.Objects.requireNonNull(Objects.java:203)
E/AndroidRuntime(31415): at com.huawei.hms.flutter.iap.MethodCallHandlerImpl.onActivityResult(MethodCallHandlerImpl.java:234)
E/AndroidRuntime(31415): at io.flutter.embedding.engine.FlutterEnginePluginRegistry$FlutterEngineActivityPluginBinding.onActivityResult(FlutterEnginePluginRegistry.java:691)
E/AndroidRuntime(31415): at io.flutter.embedding.engine.FlutterEnginePluginRegistry.onActivityResult(FlutterEnginePluginRegistry.java:378)
E/AndroidRuntime(31415): at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onActivityResult(FlutterActivityAndFragmentDelegate.java:619)
E/AndroidRuntime(31415): at io.flutter.embedding.android.FlutterActivity.onActivityResult(FlutterActivity.java:584)
E/AndroidRuntime(31415): at android.app.Activity.dispatchActivityResult(Activity.java:7797)
E/AndroidRuntime(31415): at android.app.ActivityThread.deliverResults(ActivityThread.java:5071)
E/AndroidRuntime(31415): ... 11 more
I/Process (31415): Sending signal. PID: 31415 SIG: 9

mycode:

FlatButton(
                      onPressed: () async {
                        List<ScanResponse> results = [];

                        CustomizedViewRequest request = new CustomizedViewRequest(
                            scanType: HmsScanTypes.QRCode,
                            continuouslyScan: false,
                            isFlashAvailable: true,
                            flashOnLightChange: false,
                            customizedLifeCycleListener: (CustomizedViewEvent event){

                            },
                            customizedCameraListener: (ScanResponse response){
                              //Printing the result of each scan to debug console.
                              debugPrint(response.showResult);
                              //Collecting ScanRespone objects to a list.
                              setState(() {
                                results.add(response);
                              });
                            }
                        );
                        try {
                          results.add(await HmsCustomizedView.startCustomizedView(request));
                        } on Exception catch (e) {
                          // TODO
                          print("here is the problem $e");
                        }
                      },
                      child: new Text('Scan QR'),
                    `),`

[huawei_ads] Feature: ad as widget

The Google solution you replicated actually has two approaches: firebase_admob provides an overlay where the ads appear, covering up the app screen, fixed to a position somewhere. However, there is an unofficial admob_flutter package that uses a native view to put the ad inside the widget tree. It goes without saying that, even if you were right in wanting to replicate the original Google behavior completely in the first place, this second approach is way more dev-friendly, providing us with a better way to incorporate ads, not covering up other parts of our UI and making sure the app layout can adapt to the ads present or not.

Do you have any plan, idea or solution to go this way with HMS as well? Even maybe to the point of endorsing said plugin to include HMS as well, or creating a parallel one doing the same?

Huawei map does not work first time it builds

Hello,

I have an issue with the huawei_map plugin. It doest not work the first time it builds. When I fire it second and more times, it builds and shows successfully. There is an exception I have in my logs for the first time it builds a map:

E/flutter ( 1095): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: PlatformException(error, java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
E/flutter ( 1095): at android.view.ViewGroup.addViewInner(ViewGroup.java:5326)
E/flutter ( 1095): at android.view.ViewGroup.addView(ViewGroup.java:5155)
E/flutter ( 1095): at android.view.ViewGroup.addView(ViewGroup.java:5127)
E/flutter ( 1095): at com.huawei.map.utils.i0.p(Unknown Source:22)
E/flutter ( 1095): at com.huawei.map.utils.i0.a(Unknown Source:126)
E/flutter ( 1095): at com.huawei.map.utils.i0.s(Unknown Source:12)
E/flutter ( 1095): at com.huawei.map.utils.i0.a(Unknown Source:74)
E/flutter ( 1095): at com.huawei.map.mapapi.MapView.onCreate(Unknown Source:6)
E/flutter ( 1095): at com.huawei.hms.maps.provider.huawei.MapViewImpl.onCreate(Unknown Source:16)
E/flutter ( 1095): at com.huawei.hms.maps.internal.mak$maa.onTransact(Unknown Source:177)
E/flutter ( 1095): at android.os.Binder.transact(Binder.java:921)
E/flutter ( 1095): at com.huawei.hms.maps.internal.IMapViewDelegate$Stub$Proxy.onCreate(IMapViewDelegate.java:248)
E/flutter ( 1095): at com.huawei.hms.maps.MapView$MapViewLifecycleDelegate.onCreate(MapView.java:314)
E/flutter ( 1095): at com.huawei.hms.feature.dynamic.DeferredLifecycleHelper$3.a(Unknown Source:11)
E/flutter ( 1095): at com.huawei.hms.feature.dynamic.DeferredLifecycleHelper.a(Unknown Source:4)
E/flutter ( 1095): at com.huawei.hms.feature.dynamic.DeferredLifecycleHelper.onCreate(Unknown Source:5)
E/flutter ( 1095): at com.huawei.hms.maps.MapView.onCreate(MapView.java:113)
E/flutter ( 1095): at com.huawei.hms.flutter.map.map.MapController.onCreate(MapController.java:450)
E/flutter ( 1095): at androidx.lifecycle.FullLifecycleObserverAdapter.onStateChanged(FullLifecycleObserverAdapter.java:36)
E/flutter ( 1095): at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:361)
E/flutter ( 1095): at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.java:188)
E/flutter ( 1095): at com.huawei.hms.flutter.map.map.MapController.init(MapController.java:154)
E/flutter ( 1095): at com.huawei.hms.flutter.map.map.MapBuilder.build(MapBuilder.java:72)
E/flutter ( 1095): at com.huawei.hms.flutter.map.map.MapFactory.create(MapFactory.java:87)
E/flutter ( 1095): at io.flutter.plugin.platform.SingleViewPresentation.onCreate(SingleViewPresentation.java:186)
E/flutter ( 1095): at android.app.Dialog.dispatchOnCreate(Dialog.java:635)
E/flutter ( 1095): at android.app.Dialog.show(Dialog.java:420)
E/flutter ( 1095): at android.app.Presentation.show(Presentation.java:250)
E/flutter ( 1095): at io.flutter.plugin.platform.VirtualDisplayController.(VirtualDisplayController.java:95)
E/flutter ( 1095): at io.flutter.plugin.platform.VirtualDisplayController.create(VirtualDisplayController.java:48)
E/flutter ( 1095): at io.flutter.plugin.platform.PlatformViewsController$1.createVirtualDisplayForPlatformView(PlatformViewsController.java:214)
E/flutter ( 1095): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:104)
E/flutter ( 1095): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59)
E/flutter ( 1095): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/flutter ( 1095): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/flutter ( 1095): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:692)
E/flutter ( 1095): at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter ( 1095): at android.os.MessageQueue.next(MessageQueue.java:363)
E/flutter ( 1095): at android.os.Looper.loop(Looper.java:176)
E/flutter ( 1095): at android.app.ActivityThread.main(ActivityThread.java:8349)
E/flutter ( 1095): at java.lang.reflect.Method.invoke(Native Method)
E/flutter ( 1095): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
E/flutter ( 1095): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)
E/flutter ( 1095): , null, null)
E/flutter ( 1095): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:582:7)
E/flutter ( 1095): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:159:18)
E/flutter ( 1095):
E/flutter ( 1095): #2 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:332:12)
E/flutter ( 1095): #3 TextureAndroidViewController._sendCreateMessage (package:flutter/src/services/platform_views.dart:1039:54)
E/flutter ( 1095): #4 AndroidViewController.create (package:flutter/src/services/platform_views.dart:749:11)
E/flutter ( 1095): #5 TextureAndroidViewController.create (package:flutter/src/services/platfo
I/SecurityComp115301: er( 1095): ssf update socket factory trust manager
I/SecurityComp115301: et( 1095): sasf update socket factory trust manager
I/SecurityComp115301: miz( 1095): a c de begin 4
I/SecurityComp115301: miz( 1095): a c de begin 5
I/SecurityComp115301: mjm( 1095): update bks
I/SecurityComp115301: mjl( 1095): createSocket
I/SecurityComp115301: mjl( 1095): set default protocols
I/SecurityComp115301: mjl( 1095): set default cipher suites
I/SecurityComp115301: mjl( 1095): ssf update socket factory trust manager
I/SecurityComp115301: mjk( 1095): sasf update socket factory trust manager
I/NetworkKit_DnsUtil( 1095): RxCachedThreadScheduler-1|null|com.huawei.hms.framework.network.restclient.hwhttp.dns.mae|a|39|dns resolve source is:4
I/NetworkKit_DNResolverManager( 1095): RxCachedThreadScheduler-1|null|com.huawei.hms.framework.network.restclient.hwhttp.dns.dnresolver.mac|a|34|enter Dns lazy update flow, domain: map-dre.platform.hicloud.com, trigger type: dns_lazy_update
I/SecurityComp115301: mjl( 1095): createSocket
I/SecurityComp115301: mjl( 1095): set default protocols
I/SecurityComp115301: mjl( 1095): set default cipher suites
I/SecurityComp115301: mjn( 1095): checkServerTrusted begin ,server ca chain size is : 2
I/SecurityComp115301: mjn( 1095): check server i : 0
I/SecurityComp115301: mjn( 1095): client root ca size is : 31
I/SecurityComp115301: mjn( 1095): checkServerTrusted begin ,server ca chain size is : 2
I/SecurityComp115301: mjn( 1095): check server i : 0
I/SecurityComp115301: mjn( 1095): client root ca size is : 31
I/HmsMapKit_TileClient_69( 1095): query map data version success. httpCode : 200
I/NetworkKit_HianalyticsHelper( 1095): RxCachedThreadScheduler-2 -->NetworkKit_report_ha_0|null|com.huawei.hms.framework.common.hianalytics.HianalyticsHelper|isEnableReportNoSeed|9|user experience involved needs to be opened
I/NetworkKit_DefaultRCEventListener( 1095): RxCachedThreadScheduler-2 -->NetworkKit_report_ha_0|null|com.huawei.hms.framework.network.restclient.hianalytics.mac|a|22|HianalyticsHelper report disable
I/HmsMapKit_TileCache_73( 1095): get data version success. tileVersion : 20200904
D/HmsMapKit_TileCache_22( 1095): tileVersionCallable unSubscribe
D/HmsMapKit_BaseRequestClient_36( 1095): response code : 400
I/NetworkKit_HianalyticsHelper( 1095): RxCachedThreadScheduler-1 -->NetworkKit_report_ha_0|null|com.huawei.hms.framework.common.hianalytics.HianalyticsHelper|isEnableReportNoSeed|9|user experience involved needs to be opened
E/HmsMapKit_SysParamCache_23( 1095): errorMessage is Error occurs when communicate with server.
I/NetworkKit_DefaultRCEventListener( 1095): RxCachedThreadScheduler-1 -->NetworkKit_report_ha_0|null|com.huawei.hms.framework.network.restclient.hianalytics.mac|a|22|HianalyticsHelper report disable
W/a ( 1095): Cannot find The class:javax.net.ssl.SSLKeyException
W/a ( 1095): Cannot find The class:com.huawei.secure.android.common.util.SafeString

When I go back to previous screen, and navigate to the map, it builds with no issues. It works every time but not first.
I am using Huawei P40 lite device.

`Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.0, on Mac OS X 10.15.7 19H2, locale pl-PL)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
[✓] Android Studio (version 4.0)

[✓] Connected device (2 available)

• No issues found!
`

It used to work in the past. Maybe flutter version is faulty? Dunno. Google map works with no issues though.

EDIT: on the production app where it used to work and it had no updates since then, it started to behave the same, hmm weird. Maybe it's an issue of the platform map itself, not the plugin nor flutter?

upload to play store fails if using huawei_ads

I am using one code basis for play store as well app gallery.

If I use huawei_ads as dependency in pubspec.yaml, I am not able to upload the release app bundle to play store.

play store error message:

Your App Bundle targets the following unrecognized languages: zz. The list of supported language codes can be found in the IANA registry. Invalid languages caused by third-party libraries can be excluded using the resConfigs Gradle property.

using

[√] Flutter (Channel beta, 1.25.0-8.1.pre, on Microsoft Windows [Version 10.0.19042.630], locale de-DE)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)

huawei_ads plugin version is 13.4.32

MissingPluginException(No implementation found for method listen on channel com.huawei.flutter.push/token)

Hi, I'm having problems integrating this plugin (4.0.4+300) into my existing flutter application. I always get the following error when initializing the plugin in this code:

TokenEventChannel.receiveBroadcastStream()
        .listen(_onTokenEvent, onError: _onTokenError);

The following MissingPluginException was thrown while activating platform stream on channel
com.huawei.flutter.push/token:
MissingPluginException(No implementation found for method listen on channel
com.huawei.flutter.push/token)

I/flutter ( 7674): When the exception was thrown, this was the stack:
I/flutter ( 7674): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:154:7)
I/flutter ( 7674):
I/flutter ( 7674): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12)
I/flutter ( 7674): #2 EventChannel.receiveBroadcastStream. (package:flutter/src/services/platform_channel.dart:519:29)
I/flutter ( 7674): #3 EventChannel.receiveBroadcastStream.

I have followed this tutorial:

https://medium.com/huawei-developers/sending-push-notifications-on-flutter-with-huawei-push-kit-plugin-534787862b4d

My application already includes the FCM push notification services, so I don't know if that could be a problem? I'd like to support both FCM and Push Kit on supported devices.

I'd appreciate any help resolving this issue.

Flutter doctor output is as follows:

[✓] Flutter (Channel stable, v1.17.5, on Mac OS X 10.15.6 19G2021, locale en-ZA)
• Flutter version 1.17.5 at /Users/user/Developer/flutter
• Framework revision 8af6b2f038 (9 weeks ago), 2020-06-30 12:53:55 -0700
• Engine revision ee76268252
• Dart version 2.8.4

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/user/Library/Android/sdk
• Platform android-30, build-tools 29.0.3
• ANDROID_HOME = /Users/samuel/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.6, Build version 11E708
• CocoaPods version 1.9.2

[✓] Android Studio (version 3.6)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 45.1.1
• Dart plugin version 192.8052
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] VS Code (version 1.48.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.13.2

[✓] Connected device (1 available)
• Android SDK built for x86 64 • emulator-5554 • android-x64 • Android 9 (API 28) (emulator)

• No issues found!
Process finished with exit code 0

My Gradle dependencies and plugins in app/build.gradle:

dependencies {
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    implementation 'com.google.firebase:firebase-core:17.4.4'
    implementation 'com.google.firebase:firebase-messaging:20.2.3'
    implementation 'com.google.firebase:firebase-analytics:17.4.4'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

}

apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply plugin: 'com.huawei.agconnect'

And in android/build.gradle:

dependencies {
    // Example existing classpath
    classpath 'com.android.tools.build:gradle:3.5.3'
    // Add the google services classpath
    classpath 'com.google.gms:google-services:4.3.2'
    classpath 'io.fabric.tools:gradle:1.26.1'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.huawei.agconnect:agcp:1.3.1.300'
}

MissingPluginException(No implementation found for method listen on channel I/flutter (10618): com.huawei.flutter.push/token)

The following MissingPluginException was thrown:
I/flutter (10618): MissingPluginException(No implementation found for method listen on channel
I/flutter (10618): com.huawei.flutter.push/token)
I/flutter (10618):
I/flutter (10618): When the exception was thrown, this was the stack:
I/flutter (10618): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:159:7)
I/flutter (10618):
I/flutter (10618): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:334:12)
I/flutter (10618): #2 EventChannel.receiveBroadcastStream. (package:flutter/src/services/platform_channel.dart:542:29)
I/flutter (10618): #3 EventChannel.receiveBroadcastStream. (package:flutter/src/services/platform_channel.dart:528:64)

Cannot parse correctly to remoteMessage

Description
When my app in background,i can receive ths push message ,but i can not parse the json.There is the error info and i can`t see which line is reporting an error.
image

And I can see the onNotificationOpenedApp is run,but I can`t get the correct RemoteMessage;

image

image

flutter (28490): [onNotificationOpenedApp]: {remoteMessage: {data: null, originalUrgency: 2, receiptMode: 0, messageId: null, ttl: 86400, token: null, notification: {titleLocalizationArgs: null, LightSettings: null, icon: null, isLocalOnly: true, title: null, body: null, ChannelId: null, Importance: null, isAutoCancel: true, isDefaultLight: true, BadgeNumber: null, vibrateConfig: null, visibility: null, titleLocalizationKey: null, Color: null, Ticker: null, bodyLocalizationArgs: null, ImageUrl: null, isDefaultSound: true, Sound: null, bodyLocalizationKey: null, When: null, intentUri: null, ClickAction: null, Tag: null, NotifyId: 0, Link: null, isDefaultVibrate: true}, dataOfMap: {}, messageType: null, urgency: 2, contents: 0, collapseKey: null, sentTime: 0, from: null, to: null, sendMode: 0}, uriPage: null, extras: {_push_notifyid: -1398203059, _push_msgid: -1610301640, _push_cmd_type: app}}

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.content.Context.sendBroadcast(android.content.Intent)' on a null object reference

When the App is killed and we send a DataMessage the app crashed and shows the following error in logcat

09-15 16:20:50.807 9020-9020/pushit.lertek E/AndroidRuntime: FATAL EXCEPTION: main
    Process: pushit.lertek, PID: 9020
    java.lang.NullPointerException: Attempt to invoke virtual method 'void android.content.Context.sendBroadcast(android.content.Intent)' on a null object reference
        at com.huawei.hms.flutter.push.utils.Utils.sendIntent(Utils.java:55)
        at com.huawei.hms.flutter.push.hms.FlutterHmsMessageService.onMessageReceived(FlutterHmsMessageService.java:45)
        at com.huawei.hms.push.HmsMessageService.a(HmsMessageService.java:149)
        at com.huawei.hms.push.HmsMessageService.a(HmsMessageService.java:34)
        at com.huawei.hms.push.HmsMessageService$a.handleMessage(HmsMessageService.java:126)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:135)
        at android.app.ActivityThread.main(ActivityThread.java:5254)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)

We tried in this mobile phone HUAWEI Y7P Android 9.0

Crash on Destroy Activity

The app crash only when clicking the back button till the exit of the app (on Destroy activity).
The crash only happened after I have used the HMS SDK:

java.lang.NullPointerException
com.huawei.hms.flutter.account.HmsAccountPlugin.onDetachedFromEngine

java.lang.RuntimeException: at android.app.ActivityThread.performDestroyActivity (ActivityThread.java:5456) at android.app.ActivityThread.handleDestroyActivity (ActivityThread.java:5493) at android.app.servertransaction.DestroyActivityItem.execute (DestroyActivityItem.java:44) at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:176) at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2267) at android.os.Handler.dispatchMessage (Handler.java:107) at android.os.Looper.loop (Looper.java:237) at android.app.ActivityThread.main (ActivityThread.java:8167) at java.lang.reflect.Method.invoke (Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:496) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1100) Caused by: java.lang.NullPointerException: at com.huawei.hms.flutter.account.HmsAccountPlugin.onDetachedFromEngine (HmsAccountPlugin.java:55) at io.flutter.embedding.engine.FlutterEnginePluginRegistry.remove (FlutterEnginePluginRegistry.java:252) at io.flutter.embedding.engine.FlutterEnginePluginRegistry.remove (FlutterEnginePluginRegistry.java:260) at io.flutter.embedding.engine.FlutterEnginePluginRegistry.removeAll (FlutterEnginePluginRegistry.java:268) at io.flutter.embedding.engine.FlutterEnginePluginRegistry.destroy (FlutterEnginePluginRegistry.java:112) at io.flutter.embedding.engine.FlutterEngine.destroy (FlutterEngine.java:360) at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onDetach (FlutterActivityAndFragmentDelegate.java:522) at io.flutter.embedding.android.FlutterActivity.onDestroy (FlutterActivity.java:578) at android.app.Activity.performDestroy (Activity.java:8225) at android.app.Instrumentation.callActivityOnDestroy (Instrumentation.java:1342) at android.app.ActivityThread.performDestroyActivity (ActivityThread.java:5441)

embedding v2 issue

I have an issue while trying to upgrade my project to the embiddingv2 required.
I followed these instructions: https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects updating my MainActivity.kt, and manifest, but when I try to run i get this:

../Application.kt: (16, 48): Type mismatch: inferred type is PluginRegistry? but FlutterEngine was expected

My Application.kt is:


import io.flutter.app.FlutterApplication
import io.flutter.plugin.common.PluginRegistry
import io.flutter.plugins.GeneratedPluginRegistrant
import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService

class Application : FlutterApplication(), PluginRegistry.PluginRegistrantCallback {
    override fun onCreate() {
        super.onCreate()

        FlutterFirebaseMessagingService.setPluginRegistrant(this);
    }

    override fun registerWith(registry: PluginRegistry?) {
        GeneratedPluginRegistrant.registerWith(registry);
    }
}```

Not sending notification title and body to dart

The method_channel does not return Push Message's title and body (in my use case, i want to popup the message when app is active)

The current implementation returns remoteMessage.getData()

  @Override
    public void onMessageReceived(RemoteMessage remoteMessage) {
        super.onMessageReceived(remoteMessage);
        if (remoteMessage.getData().length() > 0) {
            Utils.sendIntent(PushIntent.DATA_MESSAGE_INTENT_ACTION, PushIntent.DATA_MESSAGE, remoteMessage.getData());
            Log.d(TAG, "Message data received:" + remoteMessage.getData());
        }
   }

Require

  • Additional / Update the current method channel to return remoteMessage.getNotification() which contains the message 'title', 'body' etc

BUG

W/FlutterJNI(23743): Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: lyokone/locationstream.

build\huawei_location\intermediates\library_manifest\debug\AndroidManifest.xml as the library might be using APIs not available in 16
Suggestion: use a compatible library with a minSdk of at most 16,
or increase this project's minSdk version to at least 19,
or use tools:overrideLibrary="com.huawei.hms.flutter.location" to force usage (may lead to runtime failures)

Map SDK was stripped by minify

Description
Null reference exception occurs when loading a Huawei Map widget. This only occurs in the minified build.

Expected behavior
The Huawei Map widget should be loaded and display a map.

Current behavior
The widget is drawn with empty content. This only occurs in the minified build.

Non minified build, debug/profile/release build config do work without issue.

Screenshots
The location where the null reference exception occurs.
image

Logs

E/MethodChannel#flutter/platform_views(12008): Failed to handle method call
E/MethodChannel#flutter/platform_views(12008): java.lang.NullPointerException: Attempt to invoke virtual method 'void com.huawei.hms.maps.HuaweiMap.setOnInfoWindowClickListener(com.huawei.hms.maps.HuaweiMap$OnInfoWindowClickListener)' on a null object reference
E/MethodChannel#flutter/platform_views(12008): 	at com.huawei.hms.flutter.map.map.MapListenerHandler.setMapListener(MapListenerHandler.java:60)
E/MethodChannel#flutter/platform_views(12008): 	at com.huawei.hms.flutter.map.map.MapController.dispose(MapController.java:257)

Environment

  • Platform: Flutter
  • Kit: Map
  • Kit Version: 4.0.4+300
  • OS Version: Android 10
  • Android Studio version (if applicable) 4.1
  • Platform version: 1.22.3 (stable) / Dart: 2.10.3
  • Node Version (if applicable)
  • Your Location/Region: Hong Kong

Other
The current workaround is to configure R8 to exclude all HMS Java classes:
-keep class com.huawei.hms.** { *; }

Unable to get push token - no error code

Hi

I'm calling Push.getToken method from Flutter and I'm not receiving the token (also not seeing a platform level error).

The log I'm seeing is as follows:

I/HMSSDK_BaseAdapter(12684): in baseRequest + uri is :push.gettoken, transactionId is : some-long-id
I/HMSSDK_PendingResultImpl(12684): init uri:push.gettoken
I/HMSSDK_PendingResultImpl(12684): setResultCallback
I/HMSSDK_PendingResultImpl(12684): setResult:0
I/HMSSDK_BaseAdapter(12684): baseCallBack.onComplete
I/HMSSDK_HmsClient(12684): receive msg status_code:0, error_code0, api_name:push.gettoken, app_id:my-id|, pkg_name:my-package, session_id:*, transaction_id:some-long-id, resolution:null

I have followed the AG connect steps to ensure that push is enabled and I've added the SHA-256 signature. I've also done the gradle setup - in fact maps integration works with the current gradle setup.

At the moment I'm unable to obtain the push to the server so we can send targetted pushes. Please assist.

PDF417 reading - flutter-hms-scan

I am trying to read PDF417 using flutter-hms-scan but its not working from either camera or selecting image from device storage. Please find attached sample image for the reference.
20201026_163857

I have other samples too if needed please let me know.

[hms_account_kit] Crash on login attempt

I am trying to implement the Account Kit, and I followed all the integration steps as presented in the official documentation.
I already have the analytics kit configured and working.

When I try to start the login with the Huawei Kit I get this:

D/ActivityThread(10801): add activity client record, r= ActivityRecord{f78510 token=android.os.BinderProxy@63ade0c {com.greenflea/com.huawei.hms.hwid.internal.ui.activity.HwIdSignInHubActivity}} token= android.os.BinderProxy@63ade0c
D/OpenGLRenderer(10801): disableOutlineDraw is true
D/mali_winsys(10801): EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
D/HiTouch_PressGestureDetector(10801): onAttached, package=com.greenflea, windowType=1, mHiTouchRestricted=false
I/HwViewRootImpl(10801): removeInvalidNode all the node in jank list is out of time
W/ActivityThread(10801): handleWindowVisibility: no activity for token android.os.BinderProxy@6649172
V/ActivityThread(10801): callActivityOnCreate
I/HMSSDK_Util(10801): available exist: true
I/HMSSDK_HMSPackageManager(10801): current versionCode:50002301, minimum version requirements: 30000000
I/HMSSDK_HMSPackageManager(10801): MinApkVersion is disabled.
I/HMSSDK_ForegroundBusDelegate(10801): startApkHubActivity
D/ActivityThread(10801): add activity client record, r= ActivityRecord{8c2958 token=android.os.BinderProxy@6649172 {com.greenflea/com.huawei.hms.activity.BridgeActivity}} token= android.os.BinderProxy@6649172
D/HiTouch_PressGestureDetector(10801): onAttached, package=com.greenflea, windowType=1, mHiTouchRestricted=false
D/mali_winsys(10801): EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
D/OpenGLRenderer(10801): disableOutlineDraw is true
W/com.greenflea(10801): Accessing hidden method Ldalvik/system/CloseGuard;->warnIfOpen()V (greylist,core-platform-api, linking, allowed)
I/HMSSDK_ForegroundBusDelegate(10801): succeedReturn
I/HMSSDK_BridgeActivity(10801): Enter finish.
I/HMSSDK_[HUAWEIIDSDK]HwIdSignInClientHub(10801): report: api=hwid.signinintentversion=40004300
W/libEGL  (10801): EGLNativeWindowType 0x7632d482d0 disconnect failed
I/flutter (10801): PlatformException(101, 6003: , , null)
D/ActivityThread(10801): Remove activity client record, r= ActivityRecord{8c2958 token=android.os.BinderProxy@6649172 {com.greenflea/com.huawei.hms.activity.BridgeActivity}} token= android.os.BinderProxy@6649172
D/ActivityThread(10801): Remove activity client record, r= ActivityRecord{f78510 token=android.os.BinderProxy@63ade0c {com.greenflea/com.huawei.hms.hwid.internal.ui.activity.HwIdSignInHubActivity}} token= android.os.BinderProxy@63ade0c
W/libEGL  (10801): EGLNativeWindowType 0x7632d47290 disconnect failed
W/ConnectionTracker(10801): Exception thrown while unbinding
W/ConnectionTracker(10801): java.lang.IllegalArgumentException: Service not registered: com.google.android.gms.measurement.internal.zzjf@29870b4
W/ConnectionTracker(10801): 	at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1832)
W/ConnectionTracker(10801): 	at android.app.ContextImpl.unbindService(ContextImpl.java:1880)
W/ConnectionTracker(10801): 	at android.content.ContextWrapper.unbindService(ContextWrapper.java:741)
W/ConnectionTracker(10801): 	at com.google.android.gms.common.stats.ConnectionTracker.zza(com.google.android.gms:play-services-basement@@17.3.0:55)
W/ConnectionTracker(10801): 	at com.google.android.gms.common.stats.ConnectionTracker.unbindService(com.google.android.gms:play-services-basement@@17.3.0:50)
W/ConnectionTracker(10801): 	at com.google.android.gms.measurement.internal.zzin.zzah(com.google.android.gms:play-services-measurement-impl@@17.4.1:246)
W/ConnectionTracker(10801): 	at com.google.android.gms.measurement.internal.zzin.zzam(com.google.android.gms:play-services-measurement-impl@@17.4.1:263)
W/ConnectionTracker(10801): 	at com.google.android.gms.measurement.internal.zzin.zzc(com.google.android.gms:play-services-measurement-impl@@17.4.1:330)
W/ConnectionTracker(10801): 	at com.google.android.gms.measurement.internal.zziq.zza(com.google.android.gms:play-services-measurement-impl@@17.4.1:2)
W/ConnectionTracker(10801): 	at com.google.android.gms.measurement.internal.zzah.run(com.google.android.gms:play-services-measurement-impl@@17.4.1:7)
W/ConnectionTracker(10801): 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
W/ConnectionTracker(10801): 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
W/ConnectionTracker(10801): 	at com.google.android.gms.measurement.internal.zzfy.run(com.google.android.gms:play-services-measurement-impl@@17.4.1:21)

I have noticed the PlatformException(101, 6003: , , null) line, but I have the fingerprint correctly added to the developer console.

The code I'm using to login is the following:

    print('\n check 02 : login mode \n ');
    AuthParamHelper helper = new AuthParamHelper();
    // You can set many options by using cascades
    //helper..setEmail();
    helper
      ..setIdToken()
      ..setAuthorizationCode()
      ..setAccessToken()
      ..setProfile()
      ..setEmail()
      ..setId();
    try {
      // Make sure you handle the possible exceptions.

      final AuthHuaweiId authHuaweiId = await HmsAccount.signIn(helper);

      print(authHuaweiId.email);
    } on Exception catch (e) {
      print(e.toString());
    }
  }

EDIT:

After adding the SHA-256 to the console, now I get this error: I/flutter (22420): PlatformException(101, 10: , , null)

backgroundMessageCallback not working on huawei push plugin

Hi, I have implemented HMS push kit and everything is working fine except background message handler, Push.onMessageReceivedStream is working fine but when I send notification when app is on background I get error in backgroundMessageCallback, I get the following error

Unhandled Exception: MissingPluginException(No implementation found for method localNotification on channel com.huawei.flutter.push/method)

I am posting my code below, please let me know if any additional code required, thanks :)

version on pubsec : huawei_push: ^5.0.2+301

My Application class

import com.huawei.hms.flutter.push.PushPlugin
import io.flutter.app.FlutterApplication
import io.flutter.plugin.common.PluginRegistry
import io.flutter.plugins.GeneratedPluginRegistrant
import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService

class MainApplication : FlutterApplication(), PluginRegistry.PluginRegistrantCallback {

    override fun onCreate() {
        super.onCreate()
        PushPlugin.setPluginRegistrant(this)

    }

    override fun registerWith(registry: PluginRegistry?) {
        registry?.registrarFor("com.huawei.hms.flutter.push.PushPlugin");
    }
}

My HMS helper function ( which I call on main.dart)

 static void backgroundMessageCallback(RemoteMessage remoteMessage) async {
    String data = remoteMessage.data;
    Push.localNotification({
      HMSLocalNotificationAttr.TITLE: '[Headless] DataMessage Received',
      HMSLocalNotificationAttr.MESSAGE: 'Hello My Name'
    });
    print("onRemoteMessageReceived" + " Data: " + data);
  }

  static initNotification() async {
    TokenEventChannel.receiveBroadcastStream()
        .listen(_onTokenEvent, onError: _onTokenError);
    Push.onNotificationOpenedApp.listen(_onNotificationOpenedApp);
    var initialNotification = await Push.getInitialNotification();
    Push.onMessageReceivedStream
        .listen(_onMessageReceived, onError: _onMessageReceiveError);
    bool backgroundMessageHandler =
        await Push.registerBackgroundMessageHandler(backgroundMessageCallback); // returns true
    await Push.getToken("");
    await Push.turnOnPush();
  }
`

manifiest

 <
application
        android:name=".MainApplication"

        <!-- Set push kit auto enable to true (for obtaining the token on initialize)-->
        <meta-data
            android:name="push_kit_auto_init_enabled"
            android:value="true" />
        <!-- These receivers are for sending scheduled local notifications -->
        <receiver android:name="com.huawei.hms.flutter.push.receiver.local.HmsLocalNotificationBootEventReceiver">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
            </intent-filter>
        </receiver>
        <receiver android:name="com.huawei.hms.flutter.push.receiver.local.HmsLocalNotificationScheduledPublisher"
            android:enabled="true"
            android:exported="true">
        </receiver>

        <receiver android:name="com.huawei.hms.flutter.push.receiver.BackgroundMessageBroadcastReceiver"
            android:enabled="true" android:exported="true">
            <intent-filter>
                <action android:name="com.huawei.hms.flutter.push.receiver.BACKGROUND_REMOTE_MESSAGE" />
            </intent-filter>
        </receiver>

        <provider
            android:authorities="${applicationId}.HMSContentProvider"
            android:name="com.huawei.hms.flutter.analytics.AnalyticsContentProvider"/>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
</manifest>

build grade

buildscript {
    ext.kotlin_version = '1.3.72'
    repositories {
        google()
        jcenter()
        maven { url 'https://developer.huawei.com/repo/' }

        flatDir { dirs 'libs' }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.3'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.3'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.2.0'
        classpath 'com.huawei.agconnect:agcp:1.4.1.300'

    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://developer.huawei.com/repo/' }
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

[huawei_ads] Testing Ads with Cloud Debugging

Well, I don't have any new Huawei smartphone so I want to use Cloud Debugging to test my ads implementation. The ad is showing but the listener is not called at all. Is this some kind of limitation of Cloud Debugging (I noticed "Initializing new device" message just before and after showing the ad)?

If yes, then what's a good way to test ads without buying a new device?

[huawei_iap] Support for verifying signature

In Java or Kotlin, we have the possibility to verify the incoming response with the public key because we have the incoming data itself in the inAppPurchaseDataList/inAppPurchaseData list, to be verified with the corresponding inAppSignature/inAppDataSignature entry. If verified, we can then go on to decode the data to use the contents.

But in Flutter, we don't receive the original JSON, we only receive the decoded version as a InAppPurchaseData type. The original JSON is already gone, so there is no way to verify it. It should be placed into a string in that type so that we can verify it.

IAP build error

According to this , I configured these files.

And when I start debugging:

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:processDebugResources'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
H:\Project\name_generator\build\app\intermediates\merged_manifests\debug\AndroidManifest.xml:10: AAPT: error: not well-formed (invalid token).

  • 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 35s
The build failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetifier to solve the incompatibility.
Building plugin flutter_plugin_android_lifecycle...
C:\Users\xiaol\AppData\Local\Pub\Cache\hosted\pub.flutter-io.cn\flutter_plugin_android_lifecycle-1.0.11\android\src\main\java\io\flutter\embedding\engine\plugins\lifecycle\FlutterLifecycleAdapter.java:8: 错误: 程序包androidx.lifecycle不存在
import androidx.lifecycle.Lifecycle;
^
C:\Users\xiaol\AppData\Local\Pub\Cache\hosted\pub.flutter-io.cn\flutter_plugin_android_lifecycle-1.0.11\android\src\main\java\io\flutter\embedding\engine\plugins\lifecycle\FlutterLifecycleAdapter.java:22: 错误: 找不到符号
public static Lifecycle getActivityLifecycle(
^
符号: 类 Lifecycle
位置: 类 FlutterLifecycleAdapter
2 个错误

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':compileReleaseJavaWithJavac'.

Compilation failed; see the compiler error output for 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 1s
Exception: The plugin flutter_plugin_android_lifecycle could not be built due to the issue above.
Exited (sigterm)

IAP version: 5.0.2+300
Flutter version: Channel master, 1.26.0-2.0.pre.86, on Microsoft Windows [Version 10.0.18363.1256], locale zh-CN
Android toolchain: develop for Android devices (Android SDK version 30.0.3)

If I remove all configuration items related to Huawei IAP, app can run debugging normally.

Please help me thanks!!!

Click on the "Legal" link that it's over the map, crashes the app

Description
Click on the "Legal" link that it's over the map, crashes the app

I had to remove CustomActionBar from HuaweiMapDemo Widget in order to view the "Legal" link

Expected behavior
What you expected to happen?
Not really sure what should happen.... show the "Legal" stuff in a dialog it seems

Current behavior
Crashes the app

Screenshots
vid

Logs

V/AudioManager( 3062): querySoundEffectsEnabled...
I/HmsMapKit_GrsCache_80( 3062): GRS copyright address : https://developer.huawei.com/
D/HmsMapKit_CopyrightUtils_40( 3062): getCopyrightUrl: https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/map-data-copyright-statement-0000001050166543
I/BlockMonitor( 3062): dispatchingThrewException In MainThread
D/AndroidRuntime( 3062): Shutting down VM
I/QarthLog( 3062): [PatchStore] createDisableExceptionQarthFile
I/QarthLog( 3062): [PatchStore] create disable file for com.app uid is 10155
E/AndroidRuntime( 3062): FATAL EXCEPTION: main
E/AndroidRuntime( 3062): Process: com.app, PID: 3062
E/AndroidRuntime( 3062): java.lang.ClassCastException: $Proxy1 cannot be cast to android.view.WindowManagerImpl
E/AndroidRuntime( 3062): 	at android.view.Window.setWindowManager(Window.java:780)
E/AndroidRuntime( 3062): 	at android.view.Window.setWindowManager(Window.java:762)
E/AndroidRuntime( 3062): 	at android.app.Dialog.<init>(Dialog.java:298)
E/AndroidRuntime( 3062): 	at android.app.Dialog.<init>(Dialog.java:247)
E/AndroidRuntime( 3062): 	at com.huawei.hms.maps.provider.util.maj.<init>(Unknown Source:0)
E/AndroidRuntime( 3062): 	at com.huawei.hms.maps.provider.util.mab.a(Unknown Source:10)
E/AndroidRuntime( 3062): 	at com.huawei.hms.maps.provider.util.mab.lambda$-kTcvCeS_2CWiXGIoiKf5UZv2Uo(Unknown Source:0)
E/AndroidRuntime( 3062): 	at com.huawei.hms.maps.provider.util.-$$Lambda$mab$-kTcvCeS_2CWiXGIoiKf5UZv2Uo.onClick(Unknown Source:0)
E/AndroidRuntime( 3062): 	at android.view.View.performClick(View.java:7217)
E/AndroidRuntime( 3062): 	at android.view.View.performClickInternal(View.java:7191)
E/AndroidRuntime( 3062): 	at android.view.View.access$3500(View.java:828)
E/AndroidRuntime( 3062): 	at android.view.View$PerformClick.run(View.java:27679)
E/AndroidRuntime( 3062): 	at android.os.Handler.handleCallback(Handler.java:900)
E/AndroidRuntime( 3062): 	at android.os.Handler.dispatchMessage(Handler.java:103)
E/AndroidRuntime( 3062): 	at android.os.Looper.loop(Looper.java:219)
E/AndroidRuntime( 3062): 	at android.app.ActivityThread.main(ActivityThread.java:8349)
E/AndroidRuntime( 3062): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 3062): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
E/AndroidRuntime( 3062): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)
I/HianalyticsSDK( 3062): [2020-12-07 13:57:55.014 I/hianalytics/HianalyticsSDK 3062:1 null:13] HiAnalyticsDataManager.getInitFlag(String tag) is execute.
W/HianalyticsSDK( 3062): [2020-12-07 13:57:55.015 W/hianalytics/HianalyticsSDK 3062:1 null:7] getInstanceByTag(): TAG: hms_hwid not found.
I/HianalyticsSDK( 3062): [2020-12-07 13:57:55.015 I/hianalytics/HianalyticsSDK 3062:1 null:13] HiAnalyticsDataManager.getInitFlag(String tag) is execute.
W/HianalyticsSDK( 3062): [2020-12-07 13:57:55.015 W/hianalytics/HianalyticsSDK 3062:1 null:7] getInstanceByTag(): TAG: hms_hwid not found.
I/HmsMapKit_CrashHandler_135( 3062): uncaughtException
E/HmsMapKit_CrashHandler_108( 3062): handleException: $Proxy1 cannot be cast to android.view.WindowManagerImpl
D/HmsMapKit_CrashHandler_80( 3062): logLength is 0
E/HmsMapKit_CrashHandler_136( 3062): uncaughtException stacktrace is
E/HmsMapKit_CrashHandler_137( 3062): deviceModel is JNY-LX1 emuiVersion is EmotionUI_10.1.0 packageName is com.app rom version is JNY-L21 10.1.0.243(C432E1R6P1)
E/HmsMapKit_ErrorTraceLogPusher_145( 3062): cache error trace log : ErrorTraceLogDTO{ scenario = UNCAUGHT_EXCEPTION', message=''}
D/HmsMapKit_ErrorTraceLogPusher_1092( 3062): analyticsInstance.onEvent(), eventId is map_errorlog_report, valueMap.size() is 12
I/HiAnalytics/event( 3062): [2020-12-07 13:57:55.018 I/hianalytics/HiAnalytics/event 3062:1 null:13] HiAnalyticsInstance.onEvent(int type, String eventId, Map<String, String> mapValue) is execute.TAG: hms_map,TYPE: 1
I/HmsMapKit_CrashHandler_135( 3062): manual action --
W/a       ( 3062): Cannot find The class:javax.crypto.Mac
I/Process ( 3062): Sending signal. PID: 3062 SIG: 9
Lost connection to device.
Exited (sigterm)

Environment

  • Platform: Flutter
  • Kit: Map
  • Kit Version current master source code
  • OS Version Android 10

No implementation found for method listen on channel

Hello ,
I have some problem and hope you can help me :

1-
EXCEPTION | ServicesBinding.defaultBinaryMessenger was accessed before the binding was initialized.
I/flutter (20409): If you're running an application and need to access the binary messenger before runApp() has been called (for example, during plugin initialization), then you need to explicitly call the WidgetsFlutterBinding.ensureInitialized() first.
I/flutter (20409): If you're running a test, you can call the TestWidgetsFlutterBinding.ensureInitialized() as the first line in your test's main() method to initialize the binding.

https://prnt.sc/vl6kxg

2- Unhandled Exception: NoSuchMethodError: The getter 'channel' was called on null.

https://prnt.sc/vl6l6e

3-MissingPluginException(No implementation found for method listen on channel com.huawei.hms.flutter.ads/banner/event/452747774)

https://prnt.sc/vl6li1

4-_testAdSlotId = "testw6vs28auh3"; from where i can register my app ads and get my ads banner id !
hope you can give me a link


My code :

-main

Future initHwAds() async {
try {
await HwAds.init();
} catch (e) {
print('EXCEPTION | $e');
}
}

void main() {

initHwAds();

runApp(MyApp());
}


-HomePage

//ads
BannerAd _bannerAd;
InterstitialAd _interstitialAd;
CustomeAdmob myCustomeadmob = CustomeAdmob();

@OverRide
void initState() {

 CustomeAdmob().testBannerAdSizeMethods();
_bannerAd =CustomeAdmob().createBannerAd()..loadAd()..show();   
// _interstitialAd =CustomeAdmob().createInterstitialAd()..loadAd()..show();


super.initState();

}

@OverRide
void dispose() {
super.dispose();
//ads

_interstitialAd?.destroy();
_bannerAd?.destroy();
_bannerAd = null;
_interstitialAd=null;

}


-CustomeAdmob [Class]

static final String _testAdSlotId = "testw6vs28auh3";
final AdParam _adParam = AdParam();
BannerAdSize bannerAdSize = BannerAdSize.s320x50;

BannerAd createBannerAd() {
return BannerAd(
adSlotId: _testAdSlotId,
size: bannerAdSize,
adParam: _adParam,
bannerRefreshTime: 5000,
listener: (AdEvent event, {int errorCode}) {
print("Banner Ad event : $event");
},
);
}

InterstitialAd createInterstitialAd(){
return InterstitialAd(
adSlotId: "teste9ih9j0rc3",
adParam: AdParam(),
);
}

void testBannerAdSizeMethods() async {
print('isFullWidthSize : ${bannerAdSize.isFullWidthSize}');
print('isDynamicSize : ${bannerAdSize.isDynamicSize}');
print('isAutoHeightSize : ${bannerAdSize.isAutoHeightSize}');

int widthPx = await bannerAdSize.getWidthPx;
print('widthPx : $widthPx');

int heightPx = await bannerAdSize.getHeightPx;
print('heightPx : $heightPx');

BannerAdSize currentDir =
await BannerAdSize.getCurrentDirectionBannerSize(150);
print(
    'getCurrentDirectionBannerSize - width ${currentDir.width} : height ${currentDir.height}');

BannerAdSize landscape = await BannerAdSize.getLandscapeBannerSize(150);
print(
    'getLandscapeBannerSize - width ${landscape.width} : height ${landscape.height}');

BannerAdSize portrait = await BannerAdSize.getPortraitBannerSize(150);
print(
    'getPortraitBannerSize - width ${portrait.width} : height ${portrait.height}');

}

so please if you know what is wrong with my code tell me

Crash after sign in with Huawei Id when returning to Flutter app

After logging with Huawei ID with this code await HmsAccount.signIn(authParamHelper);, when is the time to return to the app to get the callback, I get the following error:

FATAL EXCEPTION: main
E/AndroidRuntime(29899): Process: com.nank1ro.learntocode.huawei, PID: 29899
E/AndroidRuntime(29899): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=8888, result=-1, data=Intent { (has extras) }} to activity {com.nank1ro.learntocode.huawei/com.nank1ro.learntocode.huawei.MainActivity}: java.lang.NullPointerException
E/AndroidRuntime(29899): 	at android.app.ActivityThread.deliverResults(ActivityThread.java:4846)
E/AndroidRuntime(29899): 	at android.app.ActivityThread.handleSendResult(ActivityThread.java:4887)
E/AndroidRuntime(29899): 	at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
E/AndroidRuntime(29899): 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime(29899): 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime(29899): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2017)
E/AndroidRuntime(29899): 	at android.os.Handler.dispatchMessage(Handler.java:107)
E/AndroidRuntime(29899): 	at android.os.Looper.loop(Looper.java:214)
E/AndroidRuntime(29899): 	at android.app.ActivityThread.main(ActivityThread.java:7403)
E/AndroidRuntime(29899): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(29899): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/AndroidRuntime(29899): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
E/AndroidRuntime(29899): Caused by: java.lang.NullPointerException
E/AndroidRuntime(29899): 	at java.util.Objects.requireNonNull(Objects.java:203)
E/AndroidRuntime(29899): 	at com.huawei.hms.flutter.iap.MethodCallHandlerImpl.onActivityResult(MethodCallHandlerImpl.java:234)
E/AndroidRuntime(29899): 	at io.flutter.embedding.engine.FlutterEnginePluginRegistry$FlutterEngineActivityPluginBinding.onActivityResult(FlutterEnginePluginRegistry.java:691)
E/AndroidRuntime(29899): 	at io.flutter.embedding.engine.FlutterEnginePluginRegistry.onActivityResult(FlutterEnginePluginRegistry.java:378)
E/AndroidRuntime(29899): 	at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onActivityResult(FlutterActivityAndFragmentDelegate.java:619)
E/AndroidRuntime(29899): 	at io.flutter.embedding.android.FlutterActivity.onActivityResult(FlutterActivity.java:584)
E/AndroidRuntime(29899): 	at android.app.Activity.dispatchActivityResult(Activity.java:8119)
E/AndroidRuntime(29899): 	at android.app.ActivityThread.deliverResults(ActivityThread.java:4839)
E/AndroidRuntime(29899): 	... 11 more
I/Process (29899): Sending signal. PID: 29899 SIG: 9
Lost connection to device.

Test Device: Xiaomi Mi A2
Android Version: 10

Map Kit: Build fails when map kit is added

My app no longer build when I integrate the map kit

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:multiDexListDebug'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Error while merging dex archives:
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Type com.huawei.secure.android.common.ssl.R is defined multiple times: C:\Users\Roney.gradle\caches\transforms-2\files-2.1\942fea77eaf410d431e51b208b43a803\jetified-maps-base-4.0.1.300-runtime.jar:com/huawei/secure/android/common/ssl/R.class, C:\Users\Roney\AndroidStudioProjects\health_pal\build\app\intermediates\compile_and_runtime_not_namespaced_r_class_jar\debug\R.jar:com/huawei/secure/android/common/ssl/R.class

  • 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 9m 27s
Exception: Gradle task assembleDebug failed with exit code 1

[hms_map_kit] Issue trying to generate a release APK

I'm having this error trying to generate a release APK

D8: Program type already present: com.huawei.secure.android.common.ssl.R

I have some kits added to my project but the hms_map_kit seems to be the one that has this import.

Thanks in advance.

[huawei_iap] Huawei Sign-In Activity not opening automatically

Calling IapClient.isEnvReady() throws PlatformException if the user did not login with his/her HUAWEI ID on device before.

This should be handled by opening required login/sign-in Activity automatically. As far as i understand, with my little to none native code experience, there is some code to handle this in IsEnvReadyFailureListener.java but it's not working.

[huawei_ads] NullPointerException when exiting app

When leaving an app that uses the huawei_ads package, the following logcat entries appear:

E/AndroidRuntime(31463): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void io.flutter.plugin.common.MethodChannel.setMethodCallHandler(io.flutter.plugin.common.MethodChannel$MethodCallHandler)' on a null object reference
E/AndroidRuntime(31463): 	at com.huawei.hms.flutter.ads.HmsAdsPlugin.resetAdHandlers(HmsAdsPlugin.java:158)
E/AndroidRuntime(31463): 	at com.huawei.hms.flutter.ads.HmsAdsPlugin.onDetachedFromEngine(HmsAdsPlugin.java:413)
E/AndroidRuntime(31463): 	at io.flutter.embedding.engine.FlutterEnginePluginRegistry.remove(FlutterEnginePluginRegistry.java:252)
E/AndroidRuntime(31463): 	at io.flutter.embedding.engine.FlutterEnginePluginRegistry.remove(FlutterEnginePluginRegistry.java:260)
E/AndroidRuntime(31463): 	at io.flutter.embedding.engine.FlutterEnginePluginRegistry.removeAll(FlutterEnginePluginRegistry.java:268)
E/AndroidRuntime(31463): 	at io.flutter.embedding.engine.FlutterEnginePluginRegistry.destroy(FlutterEnginePluginRegistry.java:112)
E/AndroidRuntime(31463): 	at io.flutter.embedding.engine.FlutterEngine.destroy(FlutterEngine.java:360)
E/AndroidRuntime(31463): 	at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onDetach(FlutterActivityAndFragmentDelegate.java:522)
E/AndroidRuntime(31463): 	at io.flutter.embedding.android.FlutterActivity.onDestroy(FlutterActivity.java:578)
E/AndroidRuntime(31463): 	at android.app.Activity.performDestroy(Activity.java:8349)
E/AndroidRuntime(31463): 	at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1355)
E/AndroidRuntime(31463): 	at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:5668)

The error is relatively benign, there is no visible problem apart from these entries.

The solution looks rather simple: add null checks before calling these lines:

requestLocationUpdatesCb 时间间隔设置

final LocationRequest _locationRequest = LocationRequest()..interval = 500;
...
final int requestCode = await _locationService.requestLocationUpdatesCb(_locationRequest, _locationCallkback);

设置时间间隔 interval = 500 ms,但实际运行的位置更新信息时间戳(time)间隔都在40000ms左右,elapsedRealtimeNanos 的时间差在 10s 左右,是什么原因?

[flutter-hms-iap] 处理onActivityResult不合理

/AndroidRuntime(21409): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=64206, result=-1, data=Intent { (has extras) }} to activity {cn.quickcn.android.huawei/cn.quickcn.android.MainActivity}: java.lang.NullPointerException
E/AndroidRuntime(21409): 	at android.app.ActivityThread.deliverResults(ActivityThread.java:4845)
E/AndroidRuntime(21409): 	at android.app.ActivityThread.handleSendResult(ActivityThread.java:4886)
E/AndroidRuntime(21409): 	at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
E/AndroidRuntime(21409): 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime(21409): 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime(21409): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
E/AndroidRuntime(21409): 	at android.os.Handler.dispatchMessage(Handler.java:107)
E/AndroidRuntime(21409): 	at android.os.Looper.loop(Looper.java:214)
E/AndroidRuntime(21409): 	at android.app.ActivityThread.main(ActivityThread.java:7356)
E/AndroidRuntime(21409): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(21409): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
E/AndroidRuntime(21409): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
E/AndroidRuntime(21409): Caused by: java.lang.NullPointerException
E/AndroidRuntime(21409): 	at java.util.Objects.requireNonNull(Objects.java:203)
E/AndroidRuntime(21409): 	at com.huawei.hms.flutter.iap.MethodCallHandlerImpl.onActivityResult(MethodCallHandlerImpl.java:234)
E/AndroidRuntime(21409): 	at io.flutter.embedding.engine.FlutterEnginePluginRegistry$FlutterEngineActivityPluginBinding.onActivityResult(FlutterEnginePluginRegistry.java:691)
E/AndroidRuntime(21409): 	at io.flutter.embedding.engine.FlutterEnginePluginRegistry.onActivityResult(FlutterEnginePluginRegistry.java:378)
E/AndroidRuntime(21409): 	at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onActivityResult(FlutterActivityAndFragmentDelegate.java:619)
E/AndroidRuntime(21409): 	at io.flutter.embedding.android.FlutterActivity.onActivityResult(FlutterActivity.java:584)
E/AndroidRuntime(21409): 	at android.app.Activity.dispatchActivityResult(Activity.java:8131)
E/AndroidRuntime(21409): 	at android.app.ActivityThread.deliverResults(ActivityThread.java:4838)
E/AndroidRuntime(21409): 	... 11 more

如果存在其他三方回调onActivityResult, 必抛空指针异常。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.