Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locations: No module for https://apis.google.com/ #457

Open
midnight477 opened this issue Oct 17, 2022 · 0 comments
Open

Locations: No module for https://apis.google.com/ #457

midnight477 opened this issue Oct 17, 2022 · 0 comments

Comments

@midnight477
Copy link

midnight477 commented Oct 17, 2022

Hi !

I have a problem using the Google API, Youtube in my app.
I try with a very simple application :

import 'package:flutter/material.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'package:googleapis/youtube/v3.dart';
import 'package:extension_google_sign_in_as_googleapis_auth/extension_google_sign_in_as_googleapis_auth.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    print("MyApp");
    return MaterialApp(
      home: Scaffold(
        body: Test(),
      ),
    );
  }
}

class Test extends StatefulWidget {
  Test({Key? key}) : super(key: key);

  @override
  State<Test> createState() => _TestState();
}

class _TestState extends State<Test> {
  final googleSignIn = GoogleSignIn(scopes: [YouTubeApi.youtubeScope]);
  late GoogleSignInAccount? _currentUser;
  int _videos = 0;

  Future<void> getVideos() async {
    final authClient = await googleSignIn.authenticatedClient();
    final youTubeApi = YouTubeApi(authClient!);

    final videoList = await youTubeApi.videos.list(['Snippet']);

    setState(() {
      _videos = videoList.items!.length;
    });
  }

  @override
  void initState() {
    googleSignIn.onCurrentUserChanged.listen((account) {
      setState(() {
        _currentUser = account;
      });
      if (_currentUser != null) {
        getVideos();
      }
    });

    googleSignIn.signIn();
    print("SignIn");
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Text(_videos.toString());
  }
}

But i have this error in debug console just after signIn my Google account

Locations: No module for http://localhost:5000/dart_sdk.js
Locations: No module for https://apis.google.com/_/scs/abc-static/_/js/k=gapi.lb.fr.UfbWkrF5MxA.O/m=auth2/rt=j/sv=1/d=1/ed=1/rs=AHpOoo9MS4PP3lesxwmHM6CR2z9_6bMvbA/cb=gapi.loaded_0?le=scs

My Flutter Doctor :

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.3.4, on Microsoft Windows [version 10.0.22000.1098], locale fr-FR)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.9.2)
[√] Android Studio (version 4.1)
[√] VS Code (version 1.72.2)
[√] Connected device (3 available)
[√] HTTP Host Availability

• No issues found!

I see a lot of problem with Flutter 2.0, but not with Flutter 3.0, so i don't know whaat is the problem.

Do you have any idea ?

Best regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant