polkawallet-io / sdk

polkawallet SDK for integrating substrate-based blockchain as a plugin.
Apache License 2.0
18 stars 24 forks source link

Connection to node doesn't work in 0.4.9 #32

Closed L3odr0id closed 1 year ago

L3odr0id commented 1 year ago

Describe the bug In example connection to node fails on android, because webViewController is never initialized in _web in SubstrateService. Interesting fact that it works fine on iOS.

To Reproduce Steps to reproduce the behavior:

  1. Launch ./example
  2. Tap 'connect' button

Expected behavior I expect to get an initialized webview after calling plugin.sdk.init()

Smartphone:

Additional context Error:

[ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: Null check operator used on a null value
  #0      WebViewRunner.evalJavascript package:polkawallet_sdk/service/webViewRunner.dart:199
  #1      WebViewRunner.connectNode package:polkawallet_sdk/service/webViewRunner.dart:221
  #2      PolkawalletApi.connectNode package:polkawallet_sdk/api/api.dart:93
  #3      _MyHomePageState._connectNode package:polkawallet_sdk_example/main.dart:115
  #4      _MyHomePageState.build.<anonymous closure> package:polkawallet_sdk_example/main.dart:159
  #5      _InkResponseState._handleTap package:flutter/…/material/ink_well.dart:1005
L3odr0id commented 1 year ago

Works fine in 0.5.1