Skip to content

Error when trying to install a apk via apk link #2

Description

@Vofchuk

Hello, thank you for your amazing package. I'm having problems when trying to install a apk with a provided link.

The app is already set as the device owner and I'm getting this error:

E/MethodChannel#device_policy_controller( 8781): java.lang.ClassCastException
E/MethodChannel#device_policy_controller( 8781): 	at io.flutter.plugin.common.MethodCall.argument(MethodCall.java:76)
E/MethodChannel#device_policy_controller( 8781): 	at com.itisnajim.device_policy_controller.DevicePolicyControllerPlugin.onMethodCall(DevicePolicyControllerPlugin.kt:140)
E/MethodChannel#device_policy_controller( 8781): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258)
E/MethodChannel#device_policy_controller( 8781): 	at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#device_policy_controller( 8781): 	at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/MethodChannel#device_policy_controller( 8781): 	at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/MethodChannel#device_policy_controller( 8781): 	at android.os.Handler.handleCallback(Handler.java:938)
E/MethodChannel#device_policy_controller( 8781): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/MethodChannel#device_policy_controller( 8781): 	at android.os.Looper.loop(Looper.java:223)
E/MethodChannel#device_policy_controller( 8781): 	at android.app.ActivityThread.main(ActivityThread.java:7723)
E/MethodChannel#device_policy_controller( 8781): 	at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#device_policy_controller( 8781): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:612)
E/MethodChannel#device_policy_controller( 8781): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:997)

this is the code I'm running:

final dpc = DevicePolicyController.instance;
 try {
    var res = await dpc.installApplication(
        "https://my.zello.com/data/android/latest/zello.apk?_gl=1*1iny5l8*_ga*MTY1NjkyNjMyLjE2OTUwNTM0NDg.*_ga_BNXNBXHVY5*MTY5ODQxMjQ1My4xOS4wLjE2OTg0MTI0NTQuNTkuMC4w");
    print(res);
  } on Exception catch (e) {
    print(e);
  }```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions