0maru / twitter_login

MIT License
54 stars 54 forks source link

Encountering Exception "type 'int' is not a subtype of type 'String' Causing a Failed Auth" #73

Closed bclarksoftware closed 2 years ago

bclarksoftware commented 2 years ago

I recently started using FlutterFire UI (which depends on 'twitter_login') for my authentication flow for Twitter. My code uses the proper keys and endpoints to the point where I can see that the user has been authenticated and the data for the user returned via the APIs (response of the 1.1 verify_credentials). However, an exception is being caught causing the authentication to fail. The following is the trace:

exception = {_TypeError} type 'int' is not a subtype of type 'String'
#0 new User (user.dart:56)
#1 User.getUserData (user.dart:81)
#2 <async break>null
#3 TwitterLogin.login (twitter_login.dart:149)
#4 <async break>null
#5 TwitterProviderImpl.signIn (twitter_provider.dart:41)
#6 <async break>null
#7 OAuthFlow.signInWithProvider (oauth_flow.dart:37)
#8 <async break>null

Here is my flutter doctor -v for more information on my environment:

[√] Flutter (Channel stable, 2.8.1, on Microsoft Windows [Version 10.0.22000.376], locale en-US)
    • Flutter version 2.8.1 at C:\Users\bclar\Documents\GitRepos\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 77d935af4d (12 days ago), 2021-12-16 08:37:33 -0800
    • Engine revision 890a5fca2e
    • Dart version 2.15.1

[√] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    • Android SDK at C:\Users\bclar\AppData\Local\Android\sdk
    • Platform android-32, build-tools 32.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

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

[√] Android Studio (version 2020.3)
    • 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.10+0-b96-7249189)

[√] IntelliJ IDEA Community Edition (version 2021.3)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.3
    • 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

[√] Connected device (4 available)
    • Pixel 3a (mobile)       • 984AY12VAL    • android-arm64  • Android 12 (API 31)
    • sdk gphone x86 (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
    • Chrome (web)            • chrome        • web-javascript • Google Chrome 96.0.4664.110
    • Edge (web)              • edge          • web-javascript • Microsoft Edge 96.0.1054.43

• No issues found!

I'm not really too sure if this is my problem or if it's something that can be fixed on your side. Please give me any pointers to help me get past this issue. Thank you!

bclarksoftware commented 2 years ago

Update: I have fixed my issue by going back to 4.0.1. I had some flutter caching issues between the pre-release and stable.