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

clientId.secret cannot be null.. Error thrown null. #379

Open
solaristhesun opened this issue Feb 14, 2022 · 6 comments
Open

clientId.secret cannot be null.. Error thrown null. #379

solaristhesun opened this issue Feb 14, 2022 · 6 comments

Comments

@solaristhesun
Copy link

If I create a client id in dart code like this:
final ClientId clientId = ClientId.serviceAccount(AppConstants.GOOGLE_API_CLIENT_ID);

It crashes here:

Non-fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Invalid argument(s): clientId.secret cannot be null.. Error thrown null.
       at .refreshCredentials(.java:101)
       at AutoRefreshingClient.send(AutoRefreshingClient.java:114)
       at ApiRequester._request.simpleRequest(_request.java:220)
       at ApiRequester._request(ApiRequester.java:263)
       at ApiRequester.request(ApiRequester.java:69)
       at AboutResource.get(AboutResource.java:141)
       at GoogleDrive.upload(GoogleDrive.java:46)

Because clientId.secret is null, if I use serviceAccount. It works when I use ClientId(AppConstants.GOOGLE_API_CLIENT_ID, ''). Am I doing something wrong here? What is the point of ClientId.serviceAccount, if it cannot be used?

@kevmoo
Copy link
Collaborator

kevmoo commented Feb 23, 2022

@solaristhesun – help me understand why I see java in the file paths here. Is this a Dart project or a Java project?

Either way, this seems like it's a bug. Can fix.

@solaristhesun
Copy link
Author

@kevmoo Thanks for the response. It's a dart (flutter) project. The stacktrace is generated by crashlytics. Apparently it assumes that the files are all java.

@Salakar
Copy link

Salakar commented Feb 24, 2022

@solaristhesun any chance you could share with me your Crashlytics exception catching code that you have setup in Dart that is reporting this so I can investigate the .java file paths? And also which versions of the FlutterFire packages you're using (flutter pub deps -- --style=compact)

Thanks

@solaristhesun
Copy link
Author

@Salakar
Flutter packages:

- firebase_crashlytics 2.5.1 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace]
- firebase_crashlytics_platform_interface 3.1.13 [collection firebase_core flutter meta plugin_platform_interface]

It is integrated like this:

void main() async {
  await runZonedGuarded<Future<void>>(
    () async {

      await Firebase.initializeApp();
      // Pass all uncaught errors from the framework to Crashlytics.
      FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError;
      await FirebaseCrashlytics.instance
          .setCrashlyticsCollectionEnabled(kReleaseMode || AppConstants.CRASHLYTICS_TESTING_ENABLED);

      runApp(
        ...
      );
    },
    (error, stack) => FirebaseCrashlytics.instance.recordError(error, stack),
  );
}

@russellwheatley
Copy link

russellwheatley commented Mar 1, 2022

@kevmoo Thanks for the response. It's a dart (flutter) project. The stacktrace is generated by crashlytics. Apparently it assumes that the files are all java.

In relation to .dart files appearing as .java files. This issue has been raised on the FlutterFire repo. I was able to reach out to Firebase Support who were able to reproduce. No ETA on fix, I was asked to keep an eye out on the release notes for updates.

@jingyu6lu
Copy link

een raised on the FlutterFire repo. I was able to reach out to Firebase Support who were able to reproduce. No ETA on fix, I was asked to keep

Hello, I am facing the same issues. Did you solve the problem? Thank you.

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

No branches or pull requests

5 participants