Clancey / simple_auth

The Simplest way to Authenticate in Flutter
MIT License
352 stars 108 forks source link

Compile error with new build 2.0.6 #133

Closed Kiraneki closed 4 years ago

Kiraneki commented 4 years ago

I'm seeing the following error when compiling the application on the emulator. This started when the flutter updated the new build of the plugin _simple_authflutter 2.0.6.

See below:

Compiler message:
../../Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/simple_auth_flutter-2.0.6/lib/simple_auth_flutter.dart:40:31: Error: The getter 'useSSO' isn't defined for the class 'WebAuthenticator'.
 - 'WebAuthenticator' is from 'package:simple_auth/src/api/webAuthenticator.dart' ('../../Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/simple_auth-2.0.5/lib/src/api/webAuthenticator.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'useSSO'.
      "useSSO": authenticator.useSSO.toString()
                              ^^^^^^
Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
build failed.

I noticed too in readme that has s update about FooAuthenticator.useSSO, but I’m not sure if it’s about that.

Regards.

uwemeier-sclable commented 4 years ago

The failing iOS-build is also indicated in the README by Build status

Kiraneki commented 4 years ago

But this problem occurs for the Android build too? I tested with emulator from Android Studio.

uwemeier-sclable commented 4 years ago

I'm working on the problem. I think, the reason why it fails is, that simple_auth_flutter/pubspec.yaml still defines simple_auth: ^2.0.4 as a dependency.

uwemeier-sclable commented 4 years ago

I opened a PR.

Until then, this works: In your pubspec.yaml file replace your simple_auth_flutter-dependency with

  simple_auth_flutter:
    #TODO set back to ^2.0.7 and remove "git:..." when https://github.com/Clancey/simple_auth/pull/135 got merged
    git:
      url: git@github.com:uwemeier-sclable/simple_auth.git
      path: simple_auth_flutter
      ref: master

and add a dependency override for simple_auth

#TODO remove simple_auth from dependency_overrides when https://github.com/Clancey/simple_auth/pull/135 got merged
dependency_overrides:
  simple_auth:
    git:
      url: git@github.com:uwemeier-sclable/simple_auth.git
      path: simple_auth
      ref: master
Clancey commented 4 years ago

New version has been pushed!