google / google/googleapis.dart

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

Open
#457 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
419
Forks
136
Avg merge
1h 21m
Merged PRs (30d)
5

Description

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 createState() => _TestState();
}

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

Future 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.