-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Unsupported operation: Unsupported platform: android #6
Comments
Not sure where this error "Unsupported operation: Unsupported platform: android" is thrown from. Can you maybe post the stack trace. Anyway, as this is an implementation of the firebase admin sdk, it is not intended to be used on client applications. So, although, I don't know the reason why it is not working on android (I don't remember explicitly disallowing it), it seems to be the correct behavior that it is not working. Secondly, this library is a pure dart implementation, so it does not need any native android library. Adding 'classpath 'com.google.firebase:firebase-admin:5.3.1' is therefore not needed. Could it be that the unsupported error is thrown from this library? |
Yes, it was my mistake. I was running the example code after creating Flutter App instead of plain dart file. |
Can you explain the issue? |
I'm using the following dependencies in pubspec.yamp
firebase_admin: ^0.1.2
I have also created the environment variable in Win10
GOOGLE_APPLICATION_CREDENTIALS=C:\Users\Faisel\Downloads\service-account.json
Added the following in build.gradle
classpath 'com.google.firebase:firebase-admin:5.3.1'
I'm using the following code and I'm getting Unsupported operation: Unsupported platform: android
If I remove the line, credential ??= await Credentials.login(); I'm getting the following error message.
I/flutter (14814): Credential implementation provided to initializeApp() via the "credential" property failed to fetch a valid Google OAuth2 access token with the following error: "NoSuchMethodError: The method 'getAccessToken' was called on null.
I have also tried this code,
In this case, I get the following error message
I/flutter (14814): FirebaseAppError(app/invalid-credential): Failed to parse certificate key file: FileSystemException: Cannot open file, path = '/project/app/service-account.json' (OS Error: No such file or directory, errno = 2)
service-account.json is located in same folder as google-services.json.
I'm trying with my emulator.
Please help me. What am I doing wrong?
The text was updated successfully, but these errors were encountered: