As per this link, Authentication v20.0.0 now supports Huawei / non-GMS devices. This isn't available in the Flutter package yet.
Steps to reproduce the behavior:
Should work
https://firebase.google.com/support/release-notes/android#auth_v20-0-0
Run flutter doctor and paste the output below:
Click To Expand
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, 1.23.0-18.1.pre, on macOS 11.0 20A5343i x86_64, locale de-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[!] Xcode - develop for iOS and macOS (Xcode 11.6)
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install:
sudo gem install cocoapods
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.50.1)
[✓] Connected device (3 available)
! Doctor found issues in 1 category.
Run flutter pub deps -- --style=compact and paste the output below:
Click To Expand
The only relevant dependency should be
firebase_auth 0.18.2
However, if necessary, I can provide the rest as well.
Hmm, I'm not sure we can upgrade the SDKs yet due to other packages needing a rework.
That's unfortunate, is there any timeline?
Right now, my fallback implementation is kind of wonky and only works for email signup using 3 different dependencies, so it's bound to break at some point lol.
I'd rather avoid forking repos (including this one again) for this if I can.
No timelines, since we're not sure if the plan will work. It essentially means removing the BoM versioning from some modules and hoping they work standalone. Not ideal news, but it is a known problem right now.
@CiriousJoker if you don't use any of the following you should be 'ok':
and can just override the version you're using yourself: https://firebase.flutter.dev/docs/overview#overriding-native-sdk-versions
Try adding that with the latest BoM version, and see what happens, if it build then you should be ok.
I followed the guide and applied following sdk version in my build.gradle:
rootProject.ext {
set('FlutterFire', [
FirebaseSDKVersion: '26.0.0'
])
}
I also have following dependencies listed in build.gradle:
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation 'com.google.firebase:firebase-analytics:18.0.0'
implementation 'com.google.firebase:firebase-crashlytics:17.2.2'
}
It seems that many things related to Firebase work in my app on Huawei Y7p (Android 10, EMUI 10.1.0) device without GMS.
On launch the Dynamic Links threw an expection:
PlatformException (PlatformException(ApiException, 17: API: DynamicLinks.API is not available on this device. Connection failed with: ConnectionResult{statusCode=SERVICE_INVALID, resolution=null, message=null}, null, null))
When saving file to Firebase Storage following exception was thrown. The file was saved though, and url was available afterwards.
D/FirebaseReceiptsImageRepository(25181): Starting saving image to Firebase storage
E/NetworkRequest(25181): Unable to find gmscore in package manager
E/NetworkRequest(25181): android.content.pm.PackageManager$NameNotFoundException: com.google.android.gms
E/NetworkRequest(25181): at android.app.ApplicationPackageManager.getPackageInfoAsUser(ApplicationPackageManager.java:201)
E/NetworkRequest(25181): at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:170)
E/NetworkRequest(25181): at com.google.firebase.storage.network.NetworkRequest.getGmsCoreVersion(NetworkRequest.java:326)
E/NetworkRequest(25181): at com.google.firebase.storage.network.NetworkRequest.constructMessage(NetworkRequest.java:349)
E/NetworkRequest(25181): at com.google.firebase.storage.network.NetworkRequest.performRequestStart(NetworkRequest.java:249)
E/NetworkRequest(25181): at com.google.firebase.storage.network.NetworkRequest.performRequest(NetworkRequest.java:270)
E/NetworkRequest(25181): at com.google.firebase.storage.network.NetworkRequest.performRequest(NetworkRequest.java:286)
E/NetworkRequest(25181): at com.google.firebase.storage.internal.ExponentialBackoffSender.sendWithExponentialBackoff(ExponentialBackoffSender.java:70)
E/NetworkRequest(25181): at com.google.firebase.storage.internal.ExponentialBackoffSender.sendWithExponentialBackoff(ExponentialBackoffSender.java:62)
E/NetworkRequest(25181): at com.google.firebase.storage.UploadTask.sendWithRetry(UploadTask.java:467)
E/NetworkRequest(25181): at com.google.firebase.storage.UploadTask.beginResumableUpload(UploadTask.java:268)
E/NetworkRequest(25181): at com.google.firebase.storage.UploadTask.run(UploadTask.java:216)
E/NetworkRequest(25181): at com.google.firebase.storage.StorageTask.lambda$getRunnable$7(StorageTask.java:1072)
E/NetworkRequest(25181): at com.google.firebase.storage.StorageTask$$Lambda$12.run(Unknown Source:2)
E/NetworkRequest(25181): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/NetworkRequest(25181): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/NetworkRequest(25181): at java.lang.Thread.run(Thread.java:929)
When trying to show ad with AdMob this exception is thrown:
E/DynamiteModule(21678): Failed to load IDynamiteLoader from GmsCore: Application package com.google.android.gms not found
I/Ads (21678): Use RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("26FCE73D3DBB703374CC37E658264997") to get test ads on this device.
W/Ads (21678): #007 Could not call remote method. @28
W/Ads (21678): java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String com.google.android.gms.internal.ads.zzdse.getVersion()' on a null object reference
W/Ads (21678): at com.google.android.gms.internal.ads.zzard.getVersion(com.google.android.gms:play-services-ads-lite@@19.5.0:32)
W/Ads (21678): at com.google.android.gms.internal.ads.zzdds.zzasx(com.google.android.gms:play-services-ads@@19.5.0:10)
W/Ads (21678): at com.google.android.gms.internal.ads.zzddv.call(Unknown Source:2)
W/Ads (21678): at com.google.android.gms.internal.ads.zzdzq.zzazk(com.google.android.gms:play-services-ads@@19.5.0:5)
W/Ads (21678): at com.google.android.gms.internal.ads.zzdyy.run(com.google.android.gms:play-services-ads@@19.5.0:8)
W/Ads (21678): at com.google.android.gms.internal.ads.zzdzo.run(com.google.android.gms:play-services-ads@@19.5.0:11)
W/Ads (21678): at com.google.android.gms.internal.ads.zzazk.execute(com.google.android.gms:play-services-ads@@19.5.0:4)
W/Ads (21678): at com.google.android.gms.internal.ads.zzazn.execute(com.google.android.gms:play-services-ads@@19.5.0:4)
W/Ads (21678): at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
W/Ads (21678): at com.google.android.gms.internal.ads.zzdxr.zze(com.google.android.gms:play-services-ads@@19.5.0:5)
W/Ads (21678): at com.google.android.gms.internal.ads.zzdds.zzasm(com.google.android.gms:play-services-ads@@19.5.0:6)
W/Ads (21678): at com.google.android.gms.internal.ads.zzdfl.zzt(com.google.android.gms:play-services-ads@@19.5.0:7)
W/Ads (21678): at com.google.android.gms.internal.ads.zzbqz.zzakq(com.google.android.gms:play-services-ads@@19.5.0:13)
W/Ads (21678): at com.google.android.gms.internal.ads.zzbqz.zzakr(com.google.android.gms:play-services-ads@@19.5.0:14)
W/Ads (21678): at com.google.android.gms.internal.ads.zzboz.zzaki(com.google.android.gms:play-services-ads@@19.5.0:39)
W/Ads (21678): at com.google.android.gms.internal.ads.zzboz.zzakj(com.google.android.gms:play-services-ads@@19.5.0:59)
W/Ads (21678): at com.google.android.gms.internal.ads.zzcxm.zzg(com.google.android.gms:play-services-ads@@19.5.0:40)
W/Ads (21678): at com.google.android.gms.internal.ads.zzcxm.zza(com.google.android.gms:play-services-ads@@19.5.0:16)
W/Ads (21678): at com.google.android.gms.internal.ads.zzzc.zza(com.google.android.gms:play-services-ads-lite@@19.5.0:120)
W/Ads (21678): at com.google.android.gms.ads.BaseAdView.loadAd(com.google.android.gms:play-services-ads-lite@@19.5.0:15)
W/Ads (21678): at com.google.android.gms.ads.AdView.loadAd(com.google.android.gms:play-services-ads-lite@@19.5.0:20)
W/Ads (21678): at io.flutter.plugins.firebaseadmob.MobileAd$Banner.load(MobileAd.java:221)
W/Ads (21678): at io.flutter.plugins.firebaseadmob.FirebaseAdMobPlugin.callLoadBannerAd(FirebaseAdMobPlugin.java:308)
W/Ads (21678): at io.flutter.plugins.firebaseadmob.FirebaseAdMobPlugin.onMethodCall(FirebaseAdMobPlugin.java:474)
W/Ads (21678): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
W/Ads (21678): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
W/Ads (21678): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:692)
W/Ads (21678): at android.os.MessageQueue.nativePollOnce(Native Method)
W/Ads (21678): at android.os.MessageQueue.next(MessageQueue.java:363)
W/Ads (21678): at android.os.Looper.loop(Looper.java:176)
W/Ads (21678): at android.app.ActivityThread.main(ActivityThread.java:8349)
W/Ads (21678): at java.lang.reflect.Method.invoke(Native Method)
W/Ads (21678): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
W/Ads (21678): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)
V/AudioManager(21678): getMode...
E/DynamiteModule(21678): Failed to load IDynamiteLoader from GmsCore: Application package com.google.android.gms not found
When trying to sign in with Google (google_sign_in and firebase_auth) following exception was thrown. However, sign in with e-mail works properly.
E/GoogleSignInHandler(26396): [Exception PlatformException] [PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 12500: , null, null)] | [null] | package:flutter/src/services/message_codecs.dart 582:7 StandardMethodCodec.decodeEnvelope
package:flutter/…/services/message_codecs.dart
E/GoogleSignInHandler(26396): package:flutter/src/services/platform_channel.dart 159:18 MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart
E/GoogleSignInHandler(26396): package:flutter/src/services/platform_channel.dart 332:12 MethodChannel.invokeMethod
package:flutter/…/services/platform_channel.dart
E/GoogleSignInHandler(26396): package:flutter/src/services/platform_channel.dart 359:49 MethodChannel.invokeMapMethod
package:flutter/…/services/platform_channel.dart
E/GoogleSignInHandler(26396): package:google_sign_in_platform_interface/src/method_channel_google_sign_in.dart 45:10 MethodChannelGoogleSignIn.signIn
package:google_sign_in_platform_interface/src/method_channel_google_sign_in.dart
E/GoogleSignInHandler(26396): package:google_sign_in/google_sign_in.dart 233:42 GoogleSignIn._callMethod
package:google_sign_in/google_sign_in.dart
E/GoogleSignInHandler(26396): package:google_sign_in/google_sign_in.dart 297:16 GoogleSignIn._addMethodCall.<fn>
package:google_sign_in/google_sign_in.dart
I/flutter (26396): com.google.android.gms.common.api.ApiException: 12500:
[38;5;244mI/flutter (26396): #0 StandardMethodCodec.decodeEnvelope[39;49m
package:flutter/…/services/message_codecs.dart
[38;5;244mI/flutter (26396): #1 MethodChannel._invokeMethod[39;49m
package:flutter/…/services/platform_channel.dart
I/flutter (26396): <asynchronous suspension>
[38;5;244mI/flutter (26396): #2 MethodChannel.invokeMethod[39;49m
package:flutter/…/services/platform_channel.dart
[38;5;244mI/flutter (26396): #3 MethodChannel.invokeMapMethod[39;49m
package:flutter/…/services/platform_channel.dart
[38;5;248mI/flutter (26396): #4 MethodChannelGoogleSignIn.signIn[39;49m
package:google_sign_in_platform_interface/src/method_channel_google_sign_in.dart
[38;5;248mI/flutter (26396): #5 GoogleSignIn._callMethod[39;49m
package:google_sign_in/google_sign_in.dart
This was tested on current stable on Huawei device without GMS. App is heavily based on Firestore and it works more or less correctly. The main issues for now are:
Btw, I'm also using revenuecat and it also doesn't work if anyone is interested:
PlatformException (PlatformException(error, There is no singleton instance. Make sure you configure Purchases before trying to get the default instance., null, kotlin.UninitializedPropertyAccessException: There is no singleton instance. Make sure you configure Purchases before trying to get the default instance.
at com.revenuecat.purchases.Purchases$Companion.getSharedInstance(Purchases.kt:1260)
at com.revenuecat.purchases.common.CommonKt.identify(common.kt:217)
at com.revenuecat.purchases_flutter.PurchasesFlutterPlugin.identify(PurchasesFlutterPlugin.java:262)
at com.revenuecat.purchases_flutter.PurchasesFlutterPlugin.onMethodCall(PurchasesFlutterPlugin.java:119)
at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:692)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:363)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:8349)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)
))
@orestesgaolin I forgot to mention, this page lists which Firebase products require Google Play services: https://firebase.google.com/docs/android/android-play-services
On React Native Firebase we have an API to check for Play Services availability; https://gist.github.com/Salakar/593a6e2082f3ab19cf80ebf877fb5572 - if you could find a plugin in Flutter that has these apis (or make your own based on the RNFB source) you could do either (or both) of;
a) limit the Firebase services your app uses and your app functionality if no GMS is available
b) make an APK variant for non Play Store devices, e.g. using --dart-define to control the build types.
Most helpful comment
I followed the guide and applied following sdk version in my build.gradle:
I also have following dependencies listed in build.gradle:
It seems that many things related to Firebase work in my app on Huawei Y7p (Android 10, EMUI 10.1.0) device without GMS.
Quick summary
Plugins used
Issues
On launch the Dynamic Links threw an expection:
PlatformException (PlatformException(ApiException, 17: API: DynamicLinks.API is not available on this device. Connection failed with: ConnectionResult{statusCode=SERVICE_INVALID, resolution=null, message=null}, null, null))When saving file to Firebase Storage following exception was thrown. The file was saved though, and url was available afterwards.
When trying to show ad with AdMob this exception is thrown:
When trying to sign in with Google (google_sign_in and firebase_auth) following exception was thrown. However, sign in with e-mail works properly.
Other
This was tested on current stable on Huawei device without GMS. App is heavily based on Firestore and it works more or less correctly. The main issues for now are:
Btw, I'm also using revenuecat and it also doesn't work if anyone is interested: