euc-releases / wsone-sdk-flutter

2 stars 1 forks source link

MissingPluginException for method userName #7

Open dotupNET opened 2 years ago

dotupNET commented 2 years ago

I'm calling startSDK() and receive initSuccess When I try to get the userName an Exception is thrown.

Unhandled Exception: MissingPluginException(No implementation found for method userName on channel workspaceone_sdk_flutter)

Log from application start

2022-04-13 09:52:46.709 27135-27135/de.dotup.wsone_test W/ActivityThread: Application de.dotup.wsone_test is waiting for the debugger on port 8100...
2022-04-13 09:52:46.710 27135-27135/de.dotup.wsone_test I/System.out: Sending WAIT chunk
2022-04-13 09:52:47.854 27135-27135/de.dotup.wsone_test I/System.out: Debugger has connected
2022-04-13 09:52:47.854 27135-27135/de.dotup.wsone_test I/System.out: waiting for debugger to settle...
2022-04-13 09:52:48.094 27135-27135/de.dotup.wsone_test I/System.out: waiting for debugger to settle...
2022-04-13 09:52:48.334 27135-27135/de.dotup.wsone_test I/System.out: waiting for debugger to settle...
2022-04-13 09:52:48.576 27135-27135/de.dotup.wsone_test I/System.out: waiting for debugger to settle...
2022-04-13 09:52:48.816 27135-27135/de.dotup.wsone_test I/System.out: waiting for debugger to settle...
2022-04-13 09:52:49.054 27135-27135/de.dotup.wsone_test I/System.out: waiting for debugger to settle...
2022-04-13 09:52:49.295 27135-27135/de.dotup.wsone_test I/System.out: waiting for debugger to settle...
2022-04-13 09:52:49.534 27135-27135/de.dotup.wsone_test I/System.out: waiting for debugger to settle...
2022-04-13 09:52:49.774 27135-27135/de.dotup.wsone_test I/System.out: waiting for debugger to settle...
2022-04-13 09:52:50.014 27135-27135/de.dotup.wsone_test I/System.out: debugger has settled (1425)
2022-04-13 09:52:50.064 27135-27135/de.dotup.wsone_test I/_device_tracke: The ClassLoaderContext is a special shared library.
2022-04-13 09:52:52.809 27135-27135/de.dotup.wsone_test I/Perf: Connecting to perf service.
2022-04-13 09:52:53.715 27135-27346/de.dotup.wsone_test I/ResourceExtractor: Found extracted resources res_timestamp-1-1649835523456
2022-04-13 09:52:53.715 27135-27346/de.dotup.wsone_test I/ResourceExtractor: Resource version mismatch res_timestamp-1-1649836364335
2022-04-13 09:52:56.392 27135-27346/de.dotup.wsone_test I/ResourceExtractor: Extracted baseline resource assets/flutter_assets/kernel_blob.bin
2022-04-13 09:52:56.417 27135-27346/de.dotup.wsone_test I/ResourceExtractor: Extracted baseline resource assets/flutter_assets/vm_snapshot_data
2022-04-13 09:52:56.558 27135-27346/de.dotup.wsone_test I/ResourceExtractor: Extracted baseline resource assets/flutter_assets/isolate_snapshot_data
2022-04-13 09:52:56.885 27135-27135/de.dotup.wsone_test I/AdrenoGLES: QUALCOMM build                   : f345350, I0760943699
    Build Date                       : 01/28/20
    OpenGL ES Shader Compiler Version: EV031.27.05.03
    Local Branch                     : 
    Remote Branch                    : 
    Remote Branch                    : 
    Reconstruct Branch               : 
2022-04-13 09:52:56.885 27135-27135/de.dotup.wsone_test I/AdrenoGLES: Build Config                     : S L 8.0.12 AArch64
2022-04-13 09:52:56.943 27135-27135/de.dotup.wsone_test I/AdrenoGLES: PFP: 0x005ff112, ME: 0x005ff066
2022-04-13 09:52:57.306 27135-27135/de.dotup.wsone_test D/PathProviderPlugin: Use TaskQueues.
2022-04-13 09:52:57.395 27135-27135/de.dotup.wsone_test W/_device_tracke: Accessing hidden method Landroid/view/WindowInsets;->getInsets(I)Landroid/graphics/Insets; (blacklist, linking, denied)
2022-04-13 09:52:57.399 27135-27135/de.dotup.wsone_test I/chatty: uid=10197(de.dotup.wsone_test) identical 1 line
2022-04-13 09:52:57.401 27135-27135/de.dotup.wsone_test W/_device_tracke: Accessing hidden method Landroid/view/WindowInsets;->getInsets(I)Landroid/graphics/Insets; (blacklist, linking, denied)
2022-04-13 09:52:57.426 27135-27135/de.dotup.wsone_test W/_device_tracke: Accessing hidden method Landroid/view/WindowInsets$Type;->ime()I (blacklist, linking, denied)
2022-04-13 09:52:57.654 27135-27135/de.dotup.wsone_test W/_device_tracke: Accessing hidden method Landroid/view/accessibility/AccessibilityNodeInfo;->getSourceNodeId()J (greylist, reflection, allowed)
2022-04-13 09:52:57.655 27135-27135/de.dotup.wsone_test W/_device_tracke: Accessing hidden method Landroid/view/accessibility/AccessibilityRecord;->getSourceNodeId()J (greylist, reflection, allowed)
2022-04-13 09:52:57.655 27135-27135/de.dotup.wsone_test W/_device_tracke: Accessing hidden field Landroid/view/accessibility/AccessibilityNodeInfo;->mChildNodeIds:Landroid/util/LongArray; (greylist, reflection, allowed)
2022-04-13 09:52:57.656 27135-27135/de.dotup.wsone_test W/_device_tracke: Accessing hidden method Landroid/util/LongArray;->get(I)J (greylist, reflection, allowed)
2022-04-13 09:52:58.016 27135-27405/de.dotup.wsone_test I/flutter: Observatory listening on http://127.0.0.1:41759/TvE7vAGQdQg=/
2022-04-13 09:52:58.152 27135-27135/de.dotup.wsone_test D/FlutterLocationService: Creating service.
2022-04-13 09:52:58.217 27135-27135/de.dotup.wsone_test D/FlutterLocationService: Binding to location service.
2022-04-13 09:52:59.581 27135-27135/de.dotup.wsone_test D/LocationPlugin: Service connected: ComponentInfo{de.dotup.wsone_test/com.lyokone.location.FlutterLocationService}
2022-04-13 09:52:59.751 27135-27382/de.dotup.wsone_test I/flutter: APP STATE: AppLifecycleState.paused
2022-04-13 09:53:03.792 27135-27135/de.dotup.wsone_test E/MethodChannel#workspaceone_sdk_flutter: Failed to handle method call
    kotlin.UninitializedPropertyAccessException: lateinit property bridge has not been initialized
        at com.vmware.workspaceone_sdk_flutter.WorkspaceoneSdkFlutterPlugin.onMethodCall(WorkspaceoneSdkFlutterPlugin.kt:48)
        at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
        at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:296)
        at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$DartMessenger(DartMessenger.java:320)
        at io.flutter.embedding.engine.dart.-$$Lambda$DartMessenger$TsixYUB5E6FpKhMtCSQVHKE89gQ.run(Unknown Source:12)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7559)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
2022-04-13 09:53:03.864 27135-27433/de.dotup.wsone_test D/AirWatchSDK: Enrolled anchor app is present, using same package: com.airwatch.androidagent for service binding
2022-04-13 09:53:03.919 27135-27433/de.dotup.wsone_test D/AirWatchSDK: AppPermissionUtility appKey match
2022-04-13 09:53:03.924 27135-27433/de.dotup.wsone_test V/AirWatchSDK: Found Anchor package : com.airwatch.androidagent
2022-04-13 09:53:03.924 27135-27433/de.dotup.wsone_test D/AirWatchSDK: Anchor package matches the bindingPackageName.
2022-04-13 09:53:03.970 27135-27135/de.dotup.wsone_test I/AirWatch_AirWatchSDK: Registering the DeathRecipient!!
2022-04-13 09:53:03.994 27135-27433/de.dotup.wsone_test D/AirWatch_OperationalDataUtil: Framework application class found. Framework is integrated
2022-04-13 09:53:03.995 27135-27433/de.dotup.wsone_test D/AirWatch_SDKManager: Framework integrated application. Disabling operational data reporting to Anchor app.
2022-04-13 09:53:04.005 27135-27433/de.dotup.wsone_test I/AirWatch_SDKLogRetriever: initializeLogger() called
2022-04-13 09:53:04.032 27135-27433/de.dotup.wsone_test I/AirWatch_SDKLogRetriever: initializeLogger() called: false
2022-04-13 09:53:04.037 27135-27433/de.dotup.wsone_test D/AirWatch_DefaultLogPipeline: initializeAggregator called
2022-04-13 09:53:04.038 27135-27433/de.dotup.wsone_test I/AirWatch_SDKRollingFileAggregator: Initializing aggregator
2022-04-13 09:53:04.106 27135-27435/de.dotup.wsone_test I/AirWatch_SDKRollingFileAggregator: Aggregator has been initialized
2022-04-13 09:53:04.164 27135-27433/de.dotup.wsone_test E/AirWatchSDK: Empty response from AirWatch MDM Service
2022-04-13 09:53:04.224 27135-27384/de.dotup.wsone_test W/Gralloc3: mapper 3.x is not supported
2022-04-13 09:53:04.314 27135-27135/de.dotup.wsone_test E/AirWatchSDK: Empty response from AirWatch MDM Service
2022-04-13 09:53:04.322 27135-27135/de.dotup.wsone_test E/DartMessenger: Uncaught exception in binary message listener
    com.airwatch.sdk.AirWatchSDKException: Empty response from AirWatch MDM Service
        at com.airwatch.sdk.SDKManager.throwAptAirWatchSDKException(SDKManager.java:607)
        at com.airwatch.sdk.SDKManager.getEnrollmentUsername(SDKManager.java:2811)
        at com.vmware.ws1androidsdkbridge.WorkspaceOneSdkBridge.getUserName(WorkspaceOneSdkBridge.kt:51)
        at com.vmware.workspaceone_sdk_flutter.WorkspaceoneSdkFlutterPlugin.onMethodCall(WorkspaceoneSdkFlutterPlugin.kt:48)
        at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
        at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:296)
        at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$DartMessenger(DartMessenger.java:320)
        at io.flutter.embedding.engine.dart.-$$Lambda$DartMessenger$TsixYUB5E6FpKhMtCSQVHKE89gQ.run(Unknown Source:12)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7559)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
2022-04-13 09:53:04.443 27135-27135/de.dotup.wsone_test D/BackgroundLocatorPlugin: Locator service is not running, nothing to stop
2022-04-13 09:53:05.221 27135-27382/de.dotup.wsone_test I/flutter: APP STATE: AppLifecycleState.inactive
2022-04-13 09:53:07.315 27135-27135/de.dotup.wsone_test D/BackgroundLocatorPlugin: start locator with Google client
2022-04-13 09:53:07.612 27135-27135/de.dotup.wsone_test D/PathProviderPlugin: Use TaskQueues.
2022-04-13 09:53:08.883 27135-27135/de.dotup.wsone_test E/MethodChannel#workspaceone_sdk_flutter: Failed to handle method call
    kotlin.UninitializedPropertyAccessException: lateinit property bridge has not been initialized
        at com.vmware.workspaceone_sdk_flutter.WorkspaceoneSdkFlutterPlugin.onMethodCall(WorkspaceoneSdkFlutterPlugin.kt:48)
        at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
        at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:296)
        at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$DartMessenger(DartMessenger.java:320)
        at io.flutter.embedding.engine.dart.-$$Lambda$DartMessenger$TsixYUB5E6FpKhMtCSQVHKE89gQ.run(Unknown Source:12)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7559)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
2022-04-13 09:53:10.152 27135-27135/de.dotup.wsone_test D/plugin: sendLocationEvent {callback=5286136781279641554, location={altitude=178.29998779296875, heading=0.0, latitude=49.880725, accuracy=20.459, speed_accuracy=0.0, time=1.649836389292E12, is_mocked=false, speed=0.0, longitude=9.143521}}
2022-04-13 09:53:10.179 27135-27494/de.dotup.wsone_test I/flutter: 1 location in dart: LocationDto{latitude: 49.880725, longitude: 9.143521, accuracy: 20.458999633789062, altitude: 178.29998779296875, speed: 0.0, speedAccuracy: 0.0, heading: 0.0, time: 1649836389292.0, isMocked: false, provider: }
2022-04-13 09:53:10.219 27135-27135/de.dotup.wsone_test E/AirWatchSDK: Empty response from AirWatch MDM Service
2022-04-13 09:53:10.224 27135-27135/de.dotup.wsone_test E/DartMessenger: Uncaught exception in binary message listener
    com.airwatch.sdk.AirWatchSDKException: Empty response from AirWatch MDM Service
        at com.airwatch.sdk.SDKManager.throwAptAirWatchSDKException(SDKManager.java:607)
        at com.airwatch.sdk.SDKManager.getEnrollmentUsername(SDKManager.java:2811)
        at com.vmware.ws1androidsdkbridge.WorkspaceOneSdkBridge.getUserName(WorkspaceOneSdkBridge.kt:51)
        at com.vmware.workspaceone_sdk_flutter.WorkspaceoneSdkFlutterPlugin.onMethodCall(WorkspaceoneSdkFlutterPlugin.kt:48)
        at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
        at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:296)
        at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$DartMessenger(DartMessenger.java:320)
        at io.flutter.embedding.engine.dart.-$$Lambda$DartMessenger$TsixYUB5E6FpKhMtCSQVHKE89gQ.run(Unknown Source:12)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7559)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
2022-04-13 09:53:10.231 27135-27382/de.dotup.wsone_test E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method userName on channel workspaceone_sdk_flutter)
    #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:175:7)
    <asynchronous suspension>
    #1      WorkspaceoneSdkFlutter.userName (package:workspaceone_sdk_flutter/workspaceone_sdk_flutter.dart:23:30)
    <asynchronous suspension>
    #2      SettingsBloc.onNewLocation (package:wsone_test/src/settings/bloc/settings_bloc.dart:102:17)
    <asynchronous suspension>

Flutter Doctor:

[✓] Flutter (Channel stable, 2.10.4, on Microsoft Windows [Version 10.0.19044.1620], locale de-DE)
    • Flutter version 2.10.4 at c:\SDK\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision c860cba910 (3 weeks ago), 2022-03-25 00:23:12 -0500
    • Engine revision 57d3bac3dd
    • Dart version 2.16.2
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    • Android SDK at C:\Users\peter.ullrich\AppData\Local\Android\Sdk
    • Platform android-32, build-tools 32.0.0
    • ANDROID_HOME = C:\Users\peter.ullrich\AppData\Local\Android\Sdk
    • ANDROID_SDK_ROOT = C:\Users\peter.ullrich\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[✓] Visual Studio - develop for Windows (Visual Studio Build Tools 2019 16.11.10)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
    • Visual Studio Build Tools 2019 version 16.11.32126.315
    • Windows 10 SDK version 10.0.19041.0

[✓] Android Studio (version 2021.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)

[✓] VS Code (version 1.66.1)
    • VS Code at C:\Users\peter.ullrich\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.38.1

[✓] Connected device (4 available)
    • Lenovo TB X505L (mobile) • HGAL2M76 • android-arm64  • Android 10 (API 29)
    • Windows (desktop)        • windows  • windows-x64    • Microsoft Windows [Version 10.0.19044.1620]
    • Chrome (web)             • chrome   • web-javascript • Google Chrome 100.0.4896.88
    • Edge (web)               • edge     • web-javascript • Microsoft Edge 99.0.1150.55

[✓] HTTP Host Availability
    • All required HTTP hosts are available
akalghatgi commented 2 years ago

Hi @dotupNET, Can you please check if Plugin is installed properly we can see this error where it is failing from logs above. E/MethodChannel#workspaceone_sdk_flutter: Failed to handle method call kotlin.UninitializedPropertyAccessException: lateinit property bridge has not been initialized Can you re look into Initial setup for using the Plugin, for your reference attaching the link GettingStartedDocument.

Thanks Amit

dotupNET commented 2 years ago

Hi @akalghatgi, I don't know what I should check.

Some methods are working, others not:

  const channel = EventChannel('workspaceone_sdk_event');

  channel.receiveBroadcastStream().listen((dynamic event) async {
    print('Received event: $event');                                    //  <- initSuccess
    print((await WorkspaceoneSdkFlutter.isEnrolled));                  // <- returns true
    print((await WorkspaceoneSdkFlutter.isCompliant));              // <- returns false
    print((await WorkspaceoneSdkFlutter.isCompromised));        // <- returns false
    print((await WorkspaceoneSdkFlutter.platformVersion));       //  <-MissingPluginException 
    print((await WorkspaceoneSdkFlutter.userName));       //  <-MissingPluginException 
  }, onError: (dynamic error) {
    print('Received error: ${error.message}');
  });

  Future<void> initSDK() async {
    try {
      await WorkspaceoneSdkFlutter.startSDK;
    } on PlatformException {
      log('SDK Init Failed with Exception');
    }
  }

  initSDK();