alann-maulana / flutter_beacon

An hybrid iBeacon scanner and transmitter SDK for Flutter Android and iOS.
Apache License 2.0
116 stars 142 forks source link

Cannot initialize flutterBeacon #46

Open rohnsht opened 4 years ago

rohnsht commented 4 years ago

I am not able to initialise flutterBeacon after updating to latest version 0.3.0. Here is my log: `[VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: type 'int' is not a subtype of type 'bool'

0 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321:13)

#1 FlutterBeacon.initializeScanning (package:flutter_beacon/flutter_beacon.dart:65:33)` I have only tested this in IOS so, I am not sure with android. I get this error with `lutterBeacon.initializeScanning` which was working fine with previous versions.
renoinn commented 4 years ago

see this issue https://github.com/alann-maulana/flutter_beacon/issues/41

alann-maulana commented 4 years ago

Sometimes I do a silly updates 😅

You can change your dependency:

flutter_beacon:
  git:
    url: git@github.com:alann-maulana/flutter_beacon.git
    ref: develop

I do a lot of fix, updates and maybe breaking changes there (branch develop) I'll merge it to master when it is stable enough and publish it to the pub server

Marcoslima016 commented 4 years ago

I have this error:

Git error. Command: git clone --mirror git@github.com:alann-maulana/flutter_beacon.git /Users/marcos/flutter/.pub-cache/git/cache/flutter_beacon-10eb7980ca62ae8c59eea4cf5d8ac5f5df114c6f Cloning into bare repository '/Users/marcos/flutter/.pub-cache/git/cache/flutter_beacon-10eb7980ca62ae8c59eea4cf5d8ac5f5df114c6f'...

Host key verification failed. fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

pub get failed (server unavailable) -- attempting retry 9 in 64 seconds...

alann-maulana commented 4 years ago

Can you change the url to using https to https://github.com/alann-maulana/flutter_beacon and try to flutter pub get again?

othenos commented 4 years ago

I still get the error after getting your development code from git.

`2020-04-14 14:48:41.093388-0700 Runner[1053:265466] [VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: type 'int' is not a subtype of type 'bool' in type cast

0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:41)

#1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12) #2 FlutterBeacon.initializeScanning (package:flutter_beacon/flutter_beacon.dart:65:33) #3 _MyAppState.initScanBeacon (package:shooter_flutter/main.dart:75:25)`
AamirSk commented 4 years ago

Sometimes I do a silly updates 😅

You can change your dependency:

flutter_beacon:
  git:
    url: git@github.com:alann-maulana/flutter_beacon.git
    ref: develop

I do a lot of fix, updates and maybe breaking changes there (branch develop) I'll merge it to master when it is stable enough and publish it to the pub server

I tried this but still getting an error on iOS. For temporary I have replaced your code as below which works fine. But I need to handover my code to client shortly so on his machine pub get will create an issue again.... Can u plz look into this? ,

// $$$ TEMP HACK $$$ //

Future<bool> get initializeScanning async {

  if(Platform.isAndroid)
    return await _methodChannel.invokeMethod('initialize');

  else {
    int result = await _methodChannel.invokeMethod('initialize');
    if(result > 0) return true;
    return false;
  }
}

////#### ERROR Message #####/////

`[VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: type 'int' is not a subtype of type 'bool' in type cast

0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:41)

#1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12) #2 FlutterBeacon.initializeScanning (package:flutter_beacon/flutter_beacon.dart:65:33) #3 CTBluetoothSharedInstance._startListening (package:xxx/BLE_options/ble_shared_instance.dart:318:25) #4 CTBluetoothSharedInstance.initiateTransmitter (package:xxx/BLE_options/ble_shared_instance.dart:239:7) #5 _CTHomeScreenState.initState (package:xxx/screens/home_screen.dart:48:33) #6 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4644:58)`
dariocavada commented 4 years ago

I think the version 1.0.10 solves this problem. In you yaml file: beacons_plugin: ^1.0.10