flutterfire icon indicating copy to clipboard operation
flutterfire copied to clipboard

[firebase_auth]: [firebase_auth/app-not-authorized] This app is not authorized to use Firebase Authentication. Please verify that the correct package name, SHA-1, and SHA-256 are configured in the Firebase Console. [ Invalid app info in play_integrity_token ]

Open valentinozegna opened this issue 1 year ago • 22 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues.

Which plugins are affected?

Auth

Which platforms are affected?

Android

Description

I have correctly setup my Android/iOS/Web apps in Firebase Console, and I have Firebase Phone Auth correctly working on iOS (production and simulator), web, and Android (ONLY with the app downloaded from Google Play Store).

However, the authentication does NOT work on Android when running the app in Debug, Profile or Release mode, either on a real device or the emulator. I keep getting the same error message:

[firebase_auth/app-not-authorized] This app is not authorized to use Firebase Authentication. Please verify that the correct package name, SHA-1, and SHA-256 are configured in the Firebase Console. [ Invalid app info in play_integrity_token ]

In Firebase Console, I got all the SHA-1 and SHA-256 keys correctly added to the Android app:

Screenshot 2024-05-13 at 11 26 20

In Google Cloud Console - Credentials, I got all the auto-generated keys from Firebase, with their respective SHA-1 keys that I also put in the Firebase Console:

Screenshot 2024-05-13 at 11 32 22

This has been the setup of my API KEYs for a long time now, I haven't changed anything. Please let me know if you need details regarding how each API Key is setup and/or restricted.

Reproducing the issue

  1. Create an Android Emulator or use a real device
  2. Run the app in Debug mode
  3. Enter the phone number and try to verify it with Firebase Auth

Expected Behavior The 6-digit OTP code should be sent

Actual Behavior I get error: [firebase_auth/app-not-authorized] This app is not authorized to use Firebase Authentication. Please verify that the correct package name, SHA-1, and SHA-256 are configured in the Firebase Console. [ Invalid app info in play_integrity_token ]

Firebase Core version

2.31.0

Flutter Version

3.19.6

Relevant Log Output

Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
Running Gradle task 'assembleDebug'...
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
âś“  Built build/app/outputs/flutter-apk/app-debug.apk.
Installing build/app/outputs/flutter-apk/app-debug.apk...
D/FlutterGeolocator( 7663): Attaching Geolocator to activity
D/FlutterGeolocator( 7663): Creating service.
D/FlutterGeolocator( 7663): Binding to location service.
D/FlutterGeolocator( 7663): Geolocator foreground service connected
D/FlutterGeolocator( 7663): Initializing Geolocator services
D/FlutterGeolocator( 7663): Flutter engine connected. Connected engine count 1
Debug service listening on ws://127.0.0.1:58044/Xkea49q1nKo=/ws
Syncing files to device sdk gphone64 arm64...
D/FRCPlugin( 7663): Sending fetchTimeout: 60
D/FRCPlugin( 7663): Sending fetchTimeout: 60
W/System  ( 7663): Ignoring header If-None-Match because its value was null.
D/TrafficStats( 7663): tagSocket(156) with statsTag=0xffffffff, statsUid=-1
D/FRCPlugin( 7663): Sending fetchTimeout: 60
[Log] 2024-05-13 11:15:56.397894: INFO: RemoteConfigService - Remote Config activated.
[Log] 2024-05-13 11:15:56.442792: INFO: DateTimeService - localTimeZone: America/Los_Angeles
[Log] 2024-05-13 11:15:56.485918: INFO: Main: initState()
[Log] 2024-05-13 11:15:56.522816: INFO: AppRoutes - Current FirebaseAuth user: null
[Log] 2024-05-13 11:15:56.824941: INFO: App Name: AirPlaza
[Log] 2024-05-13 11:15:56.825108: INFO: Package Name: app.airplaza.airplaza
[Log] 2024-05-13 11:15:56.825282: INFO: Version: 1.8.8
[Log] 2024-05-13 11:15:56.825420: INFO: Build Number: 87
D/ProfileInstaller( 7663): Installing profile for app.airplaza.airplaza
[Log] 2024-05-13 11:16:10.802872: INFO: AppRoutes - Pushing route: /signin/phone
D/EGL_emulation( 7663): app_time_stats: avg=7021.95ms min=75.21ms max=13968.68ms count=2
I/ImeTracker( 7663): app.airplaza.airplaza:300da91b: onRequestShow at ORIGIN_CLIENT reason SHOW_SOFT_INPUT fromUser false
D/InputMethodManager( 7663): showSoftInput() view=io.flutter.embedding.android.FlutterView{cc0c8be VFE...... .F....ID 0,0-1344,2920 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
I/ImeTracker( 7663): app.airplaza.airplaza:ec1640f3: onRequestShow at ORIGIN_CLIENT reason SHOW_SOFT_INPUT fromUser false
D/InputMethodManager( 7663): showSoftInput() view=io.flutter.embedding.android.FlutterView{cc0c8be VFE...... .F....ID 0,0-1344,2920 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
I/AssistStructure( 7663): Flattened final assist data: 496 bytes, containing 1 windows, 3 views
D/InputConnectionAdaptor( 7663): The input method toggled cursor monitoring on
D/InsetsController( 7663): show(ime(), fromIme=true)
W/InteractionJankMonitor( 7663): Initializing without READ_DEVICE_CONFIG permission. enabled=false, interval=1, missedFrameThreshold=3, frameTimeThreshold=64, package=app.airplaza.airplaza
I/ImeTracker( 7663): app.airplaza.airplaza:ec1640f3: onShown
D/EGL_emulation( 7663): app_time_stats: avg=25.10ms min=3.60ms max=271.05ms count=35
D/EGL_emulation( 7663): app_time_stats: avg=500.55ms min=498.57ms max=502.49ms count=3
D/EGL_emulation( 7663): app_time_stats: avg=500.02ms min=498.80ms max=501.25ms count=2
D/EGL_emulation( 7663): app_time_stats: avg=500.81ms min=497.63ms max=503.64ms count=3
D/EGL_emulation( 7663): app_time_stats: avg=498.51ms min=495.88ms max=502.82ms count=3
D/EGL_emulation( 7663): app_time_stats: avg=503.02ms min=496.23ms max=509.82ms count=2
D/EGL_emulation( 7663): app_time_stats: avg=498.37ms min=495.67ms max=501.83ms count=3
D/EGL_emulation( 7663): app_time_stats: avg=500.00ms min=499.43ms max=500.57ms count=2
D/EGL_emulation( 7663): app_time_stats: avg=501.12ms min=497.85ms max=504.38ms count=2
D/EGL_emulation( 7663): app_time_stats: avg=498.03ms min=497.16ms max=499.08ms count=3
D/EGL_emulation( 7663): app_time_stats: avg=500.32ms min=496.04ms max=504.59ms count=2
D/EGL_emulation( 7663): app_time_stats: avg=500.60ms min=497.93ms max=503.27ms count=2
I/TRuntime.CctTransportBackend( 7663): Making request to: https://firebaselogging-pa.googleapis.com/v1/firelog/legacy/batchlog
D/TrafficStats( 7663): tagSocket(176) with statsTag=0xffffffff, statsUid=-1
D/EGL_emulation( 7663): app_time_stats: avg=502.02ms min=495.49ms max=508.37ms count=3
I/ImeTracker( 7663): app.airplaza.airplaza:d6c853de: onRequestShow at ORIGIN_CLIENT reason SHOW_SOFT_INPUT fromUser false
D/InputMethodManager( 7663): showSoftInput() view=io.flutter.embedding.android.FlutterView{cc0c8be VFE...... .F...... 0,0-1344,2920 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController( 7663): show(ime(), fromIme=true)
I/ImeTracker( 7663): app.airplaza.airplaza:d6c853de: onCancelled at PHASE_CLIENT_APPLY_ANIMATION
I/TRuntime.CctTransportBackend( 7663): Status Code: 200
D/EGL_emulation( 7663): app_time_stats: avg=87.69ms min=6.40ms max=501.49ms count=17
I/ImeTracker( 7663): app.airplaza.airplaza:ef2d0007: onRequestShow at ORIGIN_CLIENT reason SHOW_SOFT_INPUT fromUser false
D/InputMethodManager( 7663): showSoftInput() view=io.flutter.embedding.android.FlutterView{cc0c8be VFE...... .F...... 0,0-1344,2920 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController( 7663): show(ime(), fromIme=true)
I/ImeTracker( 7663): app.airplaza.airplaza:ef2d0007: onCancelled at PHASE_CLIENT_APPLY_ANIMATION
I/zza     ( 7663): ForceRecaptchaFlow from phoneAuthOptions = false, ForceRecaptchaFlow from firebaseSettings = false
W/System  ( 7663): Ignoring header X-Firebase-Locale because its value was null.
W/LocalRequestInterceptor( 7663): Error getting App Check token; using placeholder token instead. Error: com.google.firebase.FirebaseException: No AppCheckProvider installed.
D/TrafficStats( 7663): tagSocket(174) with statsTag=0xffffffff, statsUid=-1
D/EGL_emulation( 7663): app_time_stats: avg=65.02ms min=1.73ms max=466.87ms count=14
I/PlayCore( 7663): UID: [10198]  PID: [7663] IntegrityService : requestIntegrityToken(IntegrityTokenRequest{nonce=UmtAJFNKMFnwaQzSVzELkNDGsVO890PJ1Yj5QHLKQtw, cloudProjectNumber=551503664846, network=null})
I/PlayCore( 7663): UID: [10198]  PID: [7663] IntegrityService : Initiate binding to the service.
I/PlayCore( 7663): UID: [10198]  PID: [7663] IntegrityService : ServiceConnectionImpl.onServiceConnected(ComponentInfo{com.android.vending/com.google.android.finsky.integrityservice.IntegrityService})
I/PlayCore( 7663): UID: [10198]  PID: [7663] IntegrityService : linkToDeath
D/EGL_emulation( 7663): app_time_stats: avg=4.26ms min=2.82ms max=6.30ms count=60
D/EGL_emulation( 7663): app_time_stats: avg=3.86ms min=2.65ms max=5.98ms count=61
D/EGL_emulation( 7663): app_time_stats: avg=3.63ms min=2.48ms max=5.54ms count=61
D/EGL_emulation( 7663): app_time_stats: avg=3.70ms min=2.11ms max=6.57ms count=61
D/EGL_emulation( 7663): app_time_stats: avg=4.35ms min=2.60ms max=9.17ms count=61
D/EGL_emulation( 7663): app_time_stats: avg=4.14ms min=2.71ms max=5.64ms count=60
D/EGL_emulation( 7663): app_time_stats: avg=3.73ms min=2.56ms max=5.23ms count=60
D/EGL_emulation( 7663): app_time_stats: avg=3.83ms min=2.66ms max=4.90ms count=60
D/EGL_emulation( 7663): app_time_stats: avg=4.13ms min=2.54ms max=6.35ms count=61
D/EGL_emulation( 7663): app_time_stats: avg=4.15ms min=2.64ms max=5.77ms count=60
I/PlayCore( 7663): UID: [10198]  PID: [7663] OnRequestIntegrityTokenCallback : onRequestIntegrityToken
I/PlayCore( 7663): UID: [10198]  PID: [7663] IntegrityService : Unbind from service.
W/System  ( 7663): Ignoring header X-Firebase-Locale because its value was null.
W/LocalRequestInterceptor( 7663): Error getting App Check token; using placeholder token instead. Error: com.google.firebase.FirebaseException: No AppCheckProvider installed.
E/FirebaseAuth( 7663): [SmsRetrieverHelper] SMS verification code request failed: unknown status code: 17028 Invalid app info in play_integrity_token
D/FirebaseAuth( 7663): Invoking original failure callbacks after phone verification failure for +14157630481, error - This app is not authorized to use Firebase Authentication. Please verify that the correct package name, SHA-1, and SHA-256 are configured in the Firebase Console. [ Invalid app info in play_integrity_token ]
[Log] 2024-05-13 11:16:40.464162: SHOUT: AuthProvider - Phone verification failed: [firebase_auth/app-not-authorized] This app is not authorized to use Firebase Authentication. Please verify that the correct package name, SHA-1, and SHA-256 are configured in the Firebase Console. [ Invalid app info in play_integrity_token ]
D/EGL_emulation( 7663): app_time_stats: avg=4.42ms min=2.14ms max=27.78ms count=60
D/EGL_emulation( 7663): app_time_stats: avg=78.98ms min=15.36ms max=503.59ms count=14
D/EGL_emulation( 7663): app_time_stats: avg=499.34ms min=496.49ms max=501.60ms count=3
D/EGL_emulation( 7663): app_time_stats: avg=500.39ms min=496.69ms max=502.91ms count=3
D/EGL_emulation( 7663): app_time_stats: avg=370.26ms min=113.54ms max=499.00ms count=3
D/EGL_emulation( 7663): app_time_stats: avg=72.96ms min=11.17ms max=522.55ms count=19
I/ImeTracker( 7663): app.airplaza.airplaza:ebf75b3c: onRequestHide at ORIGIN_CLIENT reason HIDE_SOFT_INPUT fromUser false
D/InputConnectionAdaptor( 7663): The input method toggled cursor monitoring off
D/InsetsController( 7663): hide(ime(), fromIme=true)
W/WindowOnBackDispatcher( 7663): sendCancelIfRunning: isInProgress=falsecallback=ImeCallback=ImeOnBackInvokedCallback@230726869 Callback=android.window.IOnBackInvokedCallback$Stub$Proxy@8b44360
D/EGL_emulation( 7663): app_time_stats: avg=2291.44ms min=9.82ms max=35870.16ms count=22
I/ImeTracker( 7663): app.airplaza.airplaza:21bebe5c: onRequestHide at ORIGIN_CLIENT reason HIDE_SOFT_INPUT_ON_ANIMATION_STATE_CHANGED fromUser false
I/ImeTracker( 7663): app.airplaza.airplaza:ebf75b3c: onHidden
D/EGL_emulation( 7663): app_time_stats: avg=45.86ms min=9.59ms max=687.04ms count=28
W/WindowOnBackDispatcher( 7663): sendCancelIfRunning: isInProgress=falsecallback=io.flutter.embedding.android.FlutterActivity$1@a8f2d41

Flutter dependencies

Expand Flutter dependencies snippet
Dart SDK 3.3.4
Flutter SDK 3.19.6
airplaza 1.8.8+87

dependencies:
- add_2_calendar 3.0.1 [flutter]
- animations 2.0.11 [flutter]
- cached_network_image 3.3.1 [cached_network_image_platform_interface cached_network_image_web flutter flutter_cache_manager octo_image]
- cloud_firestore 4.17.3 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta]
- cloud_functions 4.7.4 [cloud_functions_platform_interface cloud_functions_web firebase_core firebase_core_platform_interface flutter]
- connectivity_plus 6.0.3 [flutter flutter_web_plugins connectivity_plus_platform_interface web meta nm collection]
- cupertino_icons 1.0.8
- date_format 2.0.7
- device_calendar 4.3.2 [flutter collection sprintf timezone]
- firebase_analytics 10.10.5 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter]
- firebase_auth 4.19.5 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta]
- firebase_core 2.31.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_crashlytics 3.5.5 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace]
- firebase_messaging 14.9.2 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta]
- firebase_performance 0.9.4+5 [firebase_core firebase_core_platform_interface firebase_performance_platform_interface firebase_performance_web flutter]
- firebase_remote_config 4.4.5 [firebase_core firebase_core_platform_interface firebase_remote_config_platform_interface firebase_remote_config_web flutter]
- firebase_storage 11.7.5 [firebase_core firebase_core_platform_interface firebase_storage_platform_interface firebase_storage_web flutter]
- flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine]
- flutter_app_badger 1.5.0 [flutter]
- flutter_contacts 1.1.7+1 [flutter]
- flutter_gen 5.4.0 [flutter_gen_core args]
- flutter_image_compress 2.2.0 [flutter flutter_image_compress_platform_interface flutter_image_compress_common flutter_image_compress_web flutter_image_compress_macos flutter_image_compress_ohos]
- flutter_linkify 6.0.0 [flutter linkify]
- flutter_localizations 0.0.0 [flutter intl characters clock collection material_color_utilities meta path vector_math]
- flutter_timezone 1.0.8 [flutter_web_plugins flutter js]
- flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math]
- geocoding 3.0.0 [flutter geocoding_platform_interface geocoding_android geocoding_ios]
- geolocator 11.0.0 [flutter geolocator_platform_interface geolocator_android geolocator_apple geolocator_web geolocator_windows]
- get 4.6.6 [flutter]
- go_router 14.1.0 [collection flutter flutter_web_plugins logging meta]
- google_api_headers 4.0.3 [flutter package_info_plus]
- google_maps_apis 1.0.1+1 [http meta json_annotation]
- google_sign_in 6.2.1 [flutter google_sign_in_android google_sign_in_ios google_sign_in_platform_interface google_sign_in_web]
- hive 2.2.3 [meta crypto]
- hive_flutter 1.1.0 [flutter hive path_provider path]
- http 1.2.1 [async http_parser meta web]
- image_picker 1.1.1 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_linux image_picker_macos image_picker_platform_interface image_picker_windows]
- intl 0.18.1 [clock meta path]
- js 0.6.7 [meta]
- json_annotation 4.9.0 [meta]
- logging 1.2.0
- map_launcher 3.3.0 [flutter]
- meta 1.11.0
- package_info_plus 8.0.0 [ffi flutter flutter_web_plugins http meta path package_info_plus_platform_interface web win32 clock]
- palette_generator 0.3.3+3 [collection flutter]
- path 1.9.0
- permission_handler 11.3.1 [flutter meta permission_handler_android permission_handler_apple permission_handler_html permission_handler_windows permission_handler_platform_interface]
- pinput 4.0.0 [flutter smart_auth universal_platform]
- provider 6.1.2 [collection flutter nested]
- rxdart 0.27.7
- share_plus 9.0.0 [cross_file meta mime flutter flutter_web_plugins share_plus_platform_interface file url_launcher_web url_launcher_windows url_launcher_linux url_launcher_platform_interface ffi web win32]
- shared_preferences 2.2.3 [flutter shared_preferences_android shared_preferences_foundation shared_preferences_linux shared_preferences_platform_interface shared_preferences_web shared_preferences_windows]
- sign_in_with_apple 6.1.0 [flutter meta sign_in_with_apple_platform_interface sign_in_with_apple_web]
- timezone 0.9.3 [path]
- tuple 2.0.2
- url_launcher 6.2.6 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows]
- url_strategy 0.2.0 [flutter_web_plugins]
- uuid 4.4.0 [crypto sprintf meta fixnum]

dev dependencies:
- build_runner 2.4.9 [analyzer args async build build_config build_daemon build_resolvers build_runner_core code_builder collection crypto dart_style frontend_server_client glob graphs http_multi_server io js logging meta mime package_config path pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel yaml]
- build_web_compilers 4.0.10 [analyzer archive bazel_worker build build_config build_modules collection glob js logging path pool scratch_space source_maps source_span stack_trace]
- flutter_lints 4.0.0 [lints]
- flutter_test 0.0.0 [flutter test_api matcher path fake_async clock stack_trace vector_math leak_tracker_flutter_testing async boolean_selector characters collection leak_tracker leak_tracker_testing material_color_utilities meta source_span stream_channel string_scanner term_glyph vm_service]
- hive_generator 2.0.1 [build source_gen hive analyzer source_helper]
- json_serializable 6.8.0 [analyzer async build build_config collection json_annotation meta path pub_semver pubspec_parse source_gen source_helper]
- test 1.24.9 [analyzer async boolean_selector collection coverage http_multi_server io js matcher node_preamble package_config path pool shelf shelf_packages_handler shelf_static shelf_web_socket source_span stack_trace stream_channel test_api test_core typed_data web_socket_channel webkit_inspection_protocol yaml]

transitive dependencies:
- _fe_analyzer_shared 67.0.0 [meta]
- _flutterfire_internals 1.3.33 [collection firebase_core firebase_core_platform_interface flutter meta]
- analyzer 6.4.1 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml]
- archive 3.5.1 [crypto path]
- args 2.5.0
- async 2.11.0 [collection meta]
- bazel_worker 1.1.1 [async protobuf]
- boolean_selector 2.1.1 [source_span string_scanner]
- build 2.4.1 [analyzer async convert crypto glob logging meta package_config path]
- build_config 1.1.1 [checked_yaml json_annotation path pubspec_parse yaml]
- build_daemon 4.0.1 [built_collection built_value crypto http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel]
- build_modules 5.0.8 [analyzer async bazel_worker build build_config collection crypto glob graphs json_annotation logging path scratch_space stream_transform]
- build_resolvers 2.4.2 [analyzer async build collection convert crypto graphs logging package_config path pool pub_semver stream_transform yaml]
- build_runner_core 7.3.0 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta package_config path pool timing watcher yaml]
- built_collection 5.1.1
- built_value 8.9.2 [built_collection collection fixnum meta]
- cached_network_image_platform_interface 4.0.0 [flutter flutter_cache_manager]
- cached_network_image_web 1.2.0 [cached_network_image_platform_interface flutter flutter_cache_manager]
- characters 1.3.0
- checked_yaml 2.0.3 [json_annotation source_span yaml]
- clock 1.1.1
- cloud_firestore_platform_interface 6.2.3 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- cloud_firestore_web 3.12.3 [_flutterfire_internals cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins]
- cloud_functions_platform_interface 5.5.26 [firebase_core flutter meta plugin_platform_interface]
- cloud_functions_web 4.9.4 [cloud_functions_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins]
- code_builder 4.10.0 [built_collection built_value collection matcher meta]
- collection 1.18.0
- color 3.0.0
- connectivity_plus_platform_interface 2.0.0 [flutter meta plugin_platform_interface]
- convert 3.1.1 [typed_data]
- coverage 1.8.0 [args logging package_config path source_maps stack_trace vm_service]
- cross_file 0.3.4+1 [meta web]
- crypto 3.0.3 [typed_data]
- dart_style 2.3.6 [analyzer args collection path pub_semver source_span]
- dartx 1.2.0 [characters collection crypto meta path time]
- dbus 0.7.10 [args ffi meta xml]
- fake_async 1.3.1 [clock collection]
- ffi 2.1.2
- file 7.0.0 [meta path]
- file_selector_linux 0.9.2+1 [cross_file file_selector_platform_interface flutter]
- file_selector_macos 0.9.4 [cross_file file_selector_platform_interface flutter]
- file_selector_platform_interface 2.6.2 [cross_file flutter http plugin_platform_interface]
- file_selector_windows 0.9.3+1 [cross_file file_selector_platform_interface flutter]
- firebase_analytics_platform_interface 3.10.6 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
- firebase_analytics_web 0.5.7+5 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins]
- firebase_auth_platform_interface 7.2.6 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- firebase_auth_web 5.11.5 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser meta web]
- firebase_core_platform_interface 5.0.0 [collection flutter flutter_test meta plugin_platform_interface]
- firebase_core_web 2.17.0 [firebase_core_platform_interface flutter flutter_web_plugins meta web]
- firebase_crashlytics_platform_interface 3.6.33 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- firebase_messaging_platform_interface 4.5.35 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
- firebase_messaging_web 3.8.5 [_flutterfire_internals firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins meta web]
- firebase_performance_platform_interface 0.1.4+33 [_flutterfire_internals firebase_core flutter plugin_platform_interface]
- firebase_performance_web 0.1.6+5 [_flutterfire_internals firebase_core firebase_core_web firebase_performance_platform_interface flutter flutter_web_plugins]
- firebase_remote_config_platform_interface 1.4.33 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
- firebase_remote_config_web 1.6.5 [firebase_core firebase_core_web firebase_remote_config_platform_interface flutter flutter_web_plugins]
- firebase_storage_platform_interface 5.1.20 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- firebase_storage_web 3.9.5 [_flutterfire_internals async firebase_core firebase_core_web firebase_storage_platform_interface flutter flutter_web_plugins http meta web]
- fixnum 1.1.0
- flutter_cache_manager 3.3.2 [clock collection file flutter http path path_provider rxdart sqflite uuid]
- flutter_gen_core 5.4.0 [path yaml mime xml dartx color collection json_annotation glob dart_style args pub_semver]
- flutter_image_compress_common 1.0.5 [flutter flutter_image_compress_platform_interface]
- flutter_image_compress_macos 1.0.2 [flutter flutter_image_compress_platform_interface]
- flutter_image_compress_ohos 0.0.2 [flutter flutter_image_compress_platform_interface]
- flutter_image_compress_platform_interface 1.0.5 [flutter plugin_platform_interface cross_file]
- flutter_image_compress_web 0.1.4+1 [flutter flutter_web_plugins flutter_image_compress_platform_interface js]
- flutter_plugin_android_lifecycle 2.0.19 [flutter]
- frontend_server_client 3.2.0 [async path]
- geocoding_android 3.3.1 [flutter geocoding_platform_interface]
- geocoding_ios 3.0.1 [flutter geocoding_platform_interface]
- geocoding_platform_interface 3.2.0 [flutter meta plugin_platform_interface]
- geolocator_android 4.5.5 [flutter geolocator_platform_interface meta uuid]
- geolocator_apple 2.3.7 [flutter geolocator_platform_interface]
- geolocator_platform_interface 4.2.2 [flutter plugin_platform_interface vector_math meta]
- geolocator_web 3.0.0 [flutter flutter_web_plugins geolocator_platform_interface]
- geolocator_windows 0.2.3 [flutter geolocator_platform_interface]
- glob 2.1.2 [async collection file path string_scanner]
- google_identity_services_web 0.3.1+1 [meta web]
- google_sign_in_android 6.1.23 [flutter google_sign_in_platform_interface]
- google_sign_in_ios 5.7.6 [flutter google_sign_in_platform_interface]
- google_sign_in_platform_interface 2.4.5 [flutter plugin_platform_interface]
- google_sign_in_web 0.12.4 [flutter flutter_web_plugins google_identity_services_web google_sign_in_platform_interface http web]
- graphs 2.3.1 [collection]
- http_multi_server 3.2.1 [async]
- http_parser 4.0.2 [collection source_span string_scanner typed_data]
- image_picker_android 0.8.12 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface]
- image_picker_for_web 3.0.4 [flutter flutter_web_plugins image_picker_platform_interface mime web]
- image_picker_ios 0.8.11+1 [flutter image_picker_platform_interface]
- image_picker_linux 0.2.1+1 [file_selector_linux file_selector_platform_interface flutter image_picker_platform_interface]
- image_picker_macos 0.2.1+1 [file_selector_macos file_selector_platform_interface flutter image_picker_platform_interface]
- image_picker_platform_interface 2.10.0 [cross_file flutter http plugin_platform_interface]
- image_picker_windows 0.2.1+1 [file_selector_platform_interface file_selector_windows flutter image_picker_platform_interface]
- io 1.0.4 [meta path string_scanner]
- leak_tracker 10.0.0 [clock collection meta path vm_service]
- leak_tracker_flutter_testing 2.0.1 [flutter leak_tracker leak_tracker_testing matcher meta]
- leak_tracker_testing 2.0.1 [leak_tracker matcher meta]
- linkify 5.0.0
- lints 4.0.0
- matcher 0.12.16+1 [async meta stack_trace term_glyph test_api]
- material_color_utilities 0.8.0 [collection]
- mime 1.0.5
- nested 1.0.0 [flutter]
- nm 0.5.0 [dbus]
- node_preamble 2.0.2
- octo_image 2.0.0 [flutter]
- package_config 2.1.0 [path]
- package_info_plus_platform_interface 3.0.0 [flutter meta plugin_platform_interface]
- path_provider 2.1.3 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows]
- path_provider_android 2.2.4 [flutter path_provider_platform_interface]
- path_provider_foundation 2.4.0 [flutter path_provider_platform_interface]
- path_provider_linux 2.2.1 [ffi flutter path path_provider_platform_interface xdg_directories]
- path_provider_platform_interface 2.1.2 [flutter platform plugin_platform_interface]
- path_provider_windows 2.2.1 [ffi flutter path path_provider_platform_interface win32]
- permission_handler_android 12.0.6 [flutter permission_handler_platform_interface]
- permission_handler_apple 9.4.4 [flutter permission_handler_platform_interface]
- permission_handler_html 0.1.1 [flutter flutter_web_plugins permission_handler_platform_interface]
- permission_handler_platform_interface 4.2.1 [flutter meta plugin_platform_interface]
- permission_handler_windows 0.2.1 [flutter permission_handler_platform_interface]
- petitparser 6.0.2 [meta]
- platform 3.1.4
- plugin_platform_interface 2.1.8 [meta]
- pool 1.5.1 [async stack_trace]
- protobuf 3.1.0 [collection fixnum meta]
- pub_semver 2.1.4 [collection meta]
- pubspec_parse 1.2.3 [checked_yaml collection json_annotation pub_semver yaml]
- scratch_space 1.0.2 [build crypto path pool]
- share_plus_platform_interface 4.0.0 [cross_file flutter meta mime plugin_platform_interface path_provider uuid]
- shared_preferences_android 2.2.2 [flutter shared_preferences_platform_interface]
- shared_preferences_foundation 2.4.0 [flutter shared_preferences_platform_interface]
- shared_preferences_linux 2.3.2 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface]
- shared_preferences_platform_interface 2.3.2 [flutter plugin_platform_interface]
- shared_preferences_web 2.3.0 [flutter flutter_web_plugins shared_preferences_platform_interface web]
- shared_preferences_windows 2.3.2 [file flutter path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface]
- shelf 1.4.1 [async collection http_parser path stack_trace stream_channel]
- shelf_packages_handler 3.0.2 [path shelf shelf_static]
- shelf_static 1.1.2 [convert http_parser mime path shelf]
- shelf_web_socket 1.0.4 [shelf stream_channel web_socket_channel]
- sign_in_with_apple_platform_interface 1.1.0 [flutter plugin_platform_interface meta]
- sign_in_with_apple_web 2.1.0 [flutter flutter_web_plugins sign_in_with_apple_platform_interface]
- sky_engine 0.0.99
- smart_auth 2.0.0 [flutter flutter_web_plugins]
- source_gen 1.5.0 [analyzer async build dart_style glob path source_span yaml]
- source_helper 1.3.4 [analyzer collection source_gen]
- source_map_stack_trace 2.1.1 [path source_maps stack_trace]
- source_maps 0.10.12 [source_span]
- source_span 1.10.0 [collection path term_glyph]
- sprintf 7.0.0
- sqflite 2.3.3+1 [flutter sqflite_common path]
- sqflite_common 2.5.4 [synchronized path meta]
- stack_trace 1.11.1 [path]
- stream_channel 2.1.2 [async]
- stream_transform 2.1.0
- string_scanner 1.2.0 [source_span]
- synchronized 3.1.0+1
- term_glyph 1.2.1
- test_api 0.6.1 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph]
- test_core 0.5.9 [analyzer args async boolean_selector collection coverage frontend_server_client glob io meta package_config path pool source_map_stack_trace source_maps source_span stack_trace stream_channel test_api vm_service yaml]
- time 2.1.4 [clock]
- timing 1.0.1 [json_annotation]
- typed_data 1.3.2 [collection]
- universal_platform 1.0.0+1
- url_launcher_android 6.3.1 [flutter url_launcher_platform_interface]
- url_launcher_ios 6.3.0 [flutter url_launcher_platform_interface]
- url_launcher_linux 3.1.1 [flutter url_launcher_platform_interface]
- url_launcher_macos 3.2.0 [flutter url_launcher_platform_interface]
- url_launcher_platform_interface 2.3.2 [flutter plugin_platform_interface]
- url_launcher_web 2.3.1 [flutter flutter_web_plugins url_launcher_platform_interface web]
- url_launcher_windows 3.1.1 [flutter url_launcher_platform_interface]
- vector_math 2.1.4
- vm_service 13.0.0
- watcher 1.1.0 [async path]
- web 0.5.1
- web_socket_channel 2.4.5 [async crypto stream_channel web]
- webkit_inspection_protocol 1.2.1 [logging]
- win32 5.5.0 [ffi]
- xdg_directories 1.0.4 [meta path]
- xml 6.5.0 [collection meta petitparser]
- yaml 3.1.2 [collection source_span string_scanner]

Additional context and comments

No response

valentinozegna avatar May 13 '24 18:05 valentinozegna

Hello @Valent1, Thank you for reporting this issue. Could you please double-check that the SHA1 key you have entered is correct? Sometimes, incorrect SHA1 keys can lead to authentication issues. For more guidance, you might find these Stack Overflow links helpful:

  1. This app is not authorized to use Firebase Authentication
  2. Flutter Firebase Play Integrity Token Invalid App Info

These articles provide step-by-step solutions to similar problems and might help you resolve the issue. If the problem persists, please provide further details so we can assist you better.

TarekkMA avatar May 14 '24 09:05 TarekkMA

Both SHA1 and SHA256 keys are correct. I verified them.

valentinozegna avatar May 15 '24 07:05 valentinozegna

@Valent1 - SHA1 & SHA256 from play console into your Firebase console? Like this: https://stackoverflow.com/a/53513327/5681607

The error is saying something is misconfigured and specifically in the play integrity token.

russellwheatley avatar May 15 '24 08:05 russellwheatley

Yes, exactly like that. See screenshot below. Just to be clear, I have no issue with the Android app running in PRODUCTION mode, installed from the Google Play Store. The issue arises when I am running the app from Android Studio or VSCode, in Debug, Profile or Release mode. Those apps are not installed from the Play Store, so I don't see how the Google Play store app signing certificate plays any role here. You shouldn't use that certificate when the app runs locally in Debug, Profile or Release mode. Am I missing something here?

Screenshot 2024-05-15 at 13 26 15

valentinozegna avatar May 15 '24 20:05 valentinozegna

Any update on this? Any other debug steps that I should try?

valentinozegna avatar May 16 '24 22:05 valentinozegna

Hi, even with the latest firebase_auth release, this will not work on Android emulator and on physical Android devices running in Debug, Profile or Release mode.

Do you need more information on my end? This is currently blocking my development,

valentinozegna avatar May 22 '24 21:05 valentinozegna

Hello @Valent1,

I am currently experiencing the same issue. Although I have not yet identified the exact cause, I found that switching the emulator from Pixel 8 to Pixel 7 along with downgrading from Android 14 to Android 13, resolved the problem for me. This is just a temporary workaround, and I am still searching for the root cause and a more permanent solution.

Thanks

Vikaskumar75 avatar May 30 '24 10:05 Vikaskumar75

I have tried creating an emulator with Pixel 7 and Android 13 (Tiramisu), but the issue still persists. This is very frustrating, I have checked everything and I cannot find anything wrong in my setup.

valentinozegna avatar Jun 29 '24 10:06 valentinozegna

I have tried creating an emulator with Pixel 7 and Android 13 (Tiramisu), but the issue still persists. This is very frustrating, I have checked everything and I cannot find anything wrong in my setup.

Did you found the solution that is my 4th day tring to find any solution

M7mad94 avatar Jul 25 '24 11:07 M7mad94

hey @Valent1 have you find any solution to this issue I am currently facing for straight two days but didn't find any solution

iHamza7 avatar Jul 27 '24 20:07 iHamza7

It is not up to me to find a solution, this is clearly a bug in how firebase phone auth works with Android emulators. There is nothing I can do, I tried everything that people told me to try.

valentinozegna avatar Jul 29 '24 01:07 valentinozegna

PLEASE KEEP READING AFTER THE LOGS!

This is my full console output when I try to login with my phone number via Firebase Phone Auth on Android emulator:

Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
Running Gradle task 'assembleDebug'...
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
âś“ Built build/app/outputs/flutter-apk/app-debug.apk
Installing build/app/outputs/flutter-apk/app-debug.apk...
D/FlutterGeolocator(15128): Attaching Geolocator to activity
D/FlutterGeolocator(15128): Creating service.
D/FlutterGeolocator(15128): Binding to location service.
D/FlutterGeolocator(15128): Geolocator foreground service connected
D/FlutterGeolocator(15128): Initializing Geolocator services
D/FlutterGeolocator(15128): Flutter engine connected. Connected engine count 1
Debug service listening on ws://127.0.0.1:50266/Rp6dO0MXzFo=/ws
Syncing files to device sdk gphone64 arm64...
I/rplaza.airplaza(15128): Compiler allocated 4579KB to compile void android.view.ViewRootImpl.performTraversals()
D/FRCPlugin(15128): Sending fetchTimeout: 60
D/FRCPlugin(15128): Sending fetchTimeout: 60
D/FRCPlugin(15128): Sending fetchTimeout: 60
[Log] 2024-07-29 20:49:06.085956: INFO: RemoteConfigService - Remote Config activated.
[Log] 2024-07-29 20:49:06.123681: INFO: DateTimeService - localTimeZone: America/Los_Angeles
[Log] 2024-07-29 20:49:06.153841: INFO: Main: initState()
[Log] 2024-07-29 20:49:06.219718: INFO: AppRoutes - Current FirebaseAuth user: null
[Log] 2024-07-29 20:49:06.564746: INFO: App Name: AirPlaza
[Log] 2024-07-29 20:49:06.565085: INFO: Package Name: app.airplaza.airplaza
[Log] 2024-07-29 20:49:06.565136: INFO: Version: 1.8.11
[Log] 2024-07-29 20:49:06.565180: INFO: Build Number: 90
W/Parcel  (15128): Expecting binder but got null!
D/ProfileInstaller(15128): Installing profile for app.airplaza.airplaza
D/EGL_emulation(15128): app_time_stats: avg=11196.94ms min=8.07ms max=33528.77ms count=3
[Log] 2024-07-29 20:49:40.201594: INFO: AppRoutes - Pushing route: /signin/phone
D/InputMethodManager(15128): showSoftInput() view=io.flutter.embedding.android.FlutterView{5f8c16e VFE...... .F....ID 0,0-1080,2337 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InputMethodManager(15128): showSoftInput() view=io.flutter.embedding.android.FlutterView{5f8c16e VFE...... .F...... 0,0-1080,2337 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
I/AssistStructure(15128): Flattened final assist data: 460 bytes, containing 1 windows, 3 views
D/InsetsController(15128): show(ime(), fromIme=true)
D/InputMethodManager(15128): showSoftInput() view=io.flutter.embedding.android.FlutterView{5f8c16e VFE...... .F...... 0,0-1080,2337 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(15128): show(ime(), fromIme=true)
D/EGL_emulation(15128): app_time_stats: avg=36.03ms min=7.37ms max=400.54ms count=32
D/InputMethodManager(15128): showSoftInput() view=io.flutter.embedding.android.FlutterView{5f8c16e VFE...... .F...... 0,0-1080,2337 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(15128): show(ime(), fromIme=true)
D/InputMethodManager(15128): showSoftInput() view=io.flutter.embedding.android.FlutterView{5f8c16e VFE...... .F...... 0,0-1080,2337 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(15128): show(ime(), fromIme=true)
D/InputMethodManager(15128): showSoftInput() view=io.flutter.embedding.android.FlutterView{5f8c16e VFE...... .F...... 0,0-1080,2337 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(15128): show(ime(), fromIme=true)
D/InputMethodManager(15128): showSoftInput() view=io.flutter.embedding.android.FlutterView{5f8c16e VFE...... .F...... 0,0-1080,2337 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(15128): show(ime(), fromIme=true)
D/EGL_emulation(15128): app_time_stats: avg=204.19ms min=2.43ms max=451.60ms count=6
D/InputMethodManager(15128): showSoftInput() view=io.flutter.embedding.android.FlutterView{5f8c16e VFE...... .F...... 0,0-1080,2337 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(15128): show(ime(), fromIme=true)
D/InputMethodManager(15128): showSoftInput() view=io.flutter.embedding.android.FlutterView{5f8c16e VFE...... .F...... 0,0-1080,2337 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(15128): show(ime(), fromIme=true)
D/InputMethodManager(15128): showSoftInput() view=io.flutter.embedding.android.FlutterView{5f8c16e VFE...... .F...... 0,0-1080,2337 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(15128): show(ime(), fromIme=true)
D/InputMethodManager(15128): showSoftInput() view=io.flutter.embedding.android.FlutterView{5f8c16e VFE...... .F...... 0,0-1080,2337 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(15128): show(ime(), fromIme=true)
D/EGL_emulation(15128): app_time_stats: avg=221.46ms min=92.74ms max=496.29ms count=5
D/EGL_emulation(15128): app_time_stats: avg=501.91ms min=497.73ms max=506.09ms count=2
D/InputMethodManager(15128): showSoftInput() view=io.flutter.embedding.android.FlutterView{5f8c16e VFE...... .F...... 0,0-1080,2337 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(15128): show(ime(), fromIme=true)
D/InputMethodManager(15128): showSoftInput() view=io.flutter.embedding.android.FlutterView{5f8c16e VFE...... .F...... 0,0-1080,2337 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(15128): show(ime(), fromIme=true)
I/zza     (15128): ForceRecaptchaFlow from phoneAuthOptions = false, ForceRecaptchaFlow from firebaseSettings = false
W/System  (15128): Ignoring header X-Firebase-Locale because its value was null.
W/LocalRequestInterceptor(15128): Error getting App Check token; using placeholder token instead. Error: com.google.firebase.FirebaseException: No AppCheckProvider installed.
D/EGL_emulation(15128): app_time_stats: avg=1768.07ms min=11.08ms max=33724.85ms count=22
D/TrafficStats(15128): tagSocket(134) with statsTag=0xffffffff, statsUid=-1
D/EGL_emulation(15128): app_time_stats: avg=52.98ms min=1.21ms max=443.71ms count=17
I/PlayCore(15128): UID: [10162]  PID: [15128] IntegrityService : requestIntegrityToken(IntegrityTokenRequest{nonce=2zlRqOrJeai5Ix4I6f3Zlwx757H-xmopKGJCokb5e6Y, cloudProjectNumber=551503664846, network=null})
I/PlayCore(15128): UID: [10162]  PID: [15128] IntegrityService : Initiate binding to the service.
I/PlayCore(15128): UID: [10162]  PID: [15128] IntegrityService : ServiceConnectionImpl.onServiceConnected(ComponentInfo{com.android.vending/com.google.android.finsky.integrityservice.IntegrityService})
I/PlayCore(15128): UID: [10162]  PID: [15128] IntegrityService : linkToDeath
I/PlayCore(15128): UID: [10162]  PID: [15128] OnRequestIntegrityTokenCallback : onRequestIntegrityToken
I/PlayCore(15128): UID: [10162]  PID: [15128] IntegrityService : Unbind from service.
W/System  (15128): Ignoring header X-Firebase-Locale because its value was null.
W/LocalRequestInterceptor(15128): Error getting App Check token; using placeholder token instead. Error: com.google.firebase.FirebaseException: No AppCheckProvider installed.
E/FirebaseAuth(15128): [SmsRetrieverHelper] SMS verification code request failed: unknown status code: 17028 Invalid app info in play_integrity_token
D/FirebaseAuth(15128): Invoking original failure callbacks after phone verification failure for +1312xxxxxxx, error - This app is not authorized to use Firebase Authentication. Please verify that the correct package name, SHA-1, and SHA-256 are configured in the Firebase Console. [ Invalid app info in play_integrity_token ]
[Log] 2024-07-29 20:49:46.541205: SHOUT: AuthProvider - Phone verification failed: [firebase_auth/app-not-authorized] This app is not authorized to use Firebase Authentication. Please verify that the correct package name, SHA-1, and SHA-256 are configured in the Firebase Console. [ Invalid app info in play_integrity_token ]
D/EGL_emulation(15128): app_time_stats: avg=17.52ms min=12.81ms max=47.95ms count=57
D/EGL_emulation(15128): app_time_stats: avg=851.01ms min=15.05ms max=5020.85ms count=6
I/TRuntime.CctTransportBackend(15128): Making request to: https://firebaselogging-pa.googleapis.com/v1/firelog/legacy/batchlog
D/TrafficStats(15128): tagSocket(59) with statsTag=0xffffffff, statsUid=-1
I/PlayCore(15128): UID: [10162]  PID: [15128] IntegrityService : reportBinderDeath
I/PlayCore(15128): UID: [10162]  PID: [15128] IntegrityService : IntegrityService : Binder has died.
I/TRuntime.CctTransportBackend(15128): Status Code: 200

I notice a couple of problems here:

W/LocalRequestInterceptor(15128): Error getting App Check token; using placeholder token instead. Error: com.google.firebase.FirebaseException: No AppCheckProvider installed.

It seems like Firebase is not able to find an AppCheckProvider. I am not sure whether this is normal or not when running an Android emulator VS a real device running an app installed from the Play Store.

E/FirebaseAuth(15128): [SmsRetrieverHelper] SMS verification code request failed: unknown status code: 17028 Invalid app info in play_integrity_token

The SMS OTP code request failed, saying the app info is invalid in play_integrity_token. Again, this app is running in Debug mode on an Android emulator, but is this error message expected?

D/FirebaseAuth(15128): Invoking original failure callbacks after phone verification failure for +1312xxxxxxx, error - This app is not authorized to use Firebase Authentication. Please verify that the correct package name, SHA-1, and SHA-256 are configured in the Firebase Console. [ Invalid app info in play_integrity_token ]

I OBFUSCATED MY PHONE NUMBER FOR PRIVACY REEASONS WHEN COPY/PASTING THE OUTPUT. Clearly my phone number is not +1312xxxxxxx, in my logs I see the correct phone number. This is where the authentication is failing. Again, I checked EVERYTHING: the SHA1 and SHA256 are correct and they have all been added to my Firebase project settings in the Android app section. The google-services.json file is completely correct, freshly downloaded from Firebase, I checked it line by line. There is nothign else to do on my end.


Dear Firebase team, would you mind taking this issue seriously and debugging it on your end? Did you introduce some breaking changes that we need to be aware of? I know you are busy with all the new AI stuff, but can you please dedicate some time to fix this problem that is affecting many users? Just do a google search of these error messages and you will see plenty of people are running into this problem.

valentinozegna avatar Jul 30 '24 03:07 valentinozegna

This is my android/settings.gradle:

pluginManagement {
    def flutterSdkPath = {
        def properties = new Properties()
        file("local.properties").withInputStream { properties.load(it) }
        def flutterSdkPath = properties.getProperty("flutter.sdk")
        assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
        return flutterSdkPath
    }
    settings.ext.flutterSdkPath = flutterSdkPath()

    includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")

    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
}

plugins {
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
    // Android Gradle Plugin (AGP) Version
    id "com.android.application" version '8.3.1' apply false
    id "org.jetbrains.kotlin.android" version "1.9.21" apply false
    id "com.google.gms.google-services" version "4.4.2" apply false
}

include ":app"

This is my android/build.gradle:

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

tasks.register("clean", Delete) {
    delete rootProject.buildDir
}

This is my android/app/build.gradle:

plugins {
    id "com.android.application"
    id "kotlin-android"
    id "dev.flutter.flutter-gradle-plugin"
    id "com.google.gms.google-services"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

android {
    if (project.android.hasProperty("namespace")) {
        namespace 'app.airplaza.airplaza'
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }

    // Alternative, newer way of setting the JVM target via JVM Toolchain.
    // Not using it for now but keeping it here for reference.
    /*
    kotlin {
        jvmToolchain {
            languageVersion.set(JavaLanguageVersion.of(8))
        }
    }
    */

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    defaultConfig {
        // Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "app.airplaza.airplaza"
        // You can update the following values to match your application needs.
        // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.

        // I had to change this to 34 to make it work with
        // dependency androidx.browser:browser:1.7.0 in this file
        //compileSdk 34
        compileSdk flutter.compileSdkVersion

        // I had to change the ndkVersion because I was getting an error that
        // "One or more plugins require a higher Android NDK version."
        //ndkVersion flutter.ndkVersion
        ndkVersion "25.1.8937393"

        // Firebase Auth requires minSdkVersion of 23, this is why I had to manually change it.
        // I don't remember why I set it to 31 at some point, I am leaving it here
        // for reference just in case some plugins require it.
        //minSdkVersion flutter.minSdkVersion
        //minSdkVersion 31
        minSdkVersion 23

        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

    signingConfigs {
        release {
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
            storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
            storePassword keystoreProperties['storePassword']
        }
    }
    buildTypes {
        release {
            signingConfig signingConfigs.release
            // Signing with the debug keys for now, so `flutter run --release` works.
            //signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    //classpath 'com.android.tools.build:gradle:7.3.0'
    //classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

    // It seems like the following is not needed anymore:
    // https://stackoverflow.com/questions/49956051/warning-kotlin-plugin-version-is-not-the-same-as-library-version-but-it-is
    //implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

    // Import the Firebase BoM
    implementation platform('com.google.firebase:firebase-bom:33.1.2')

    // Add the dependencies for Firebase products you want to use
    // https://firebase.google.com/docs/android/setup#available-libraries
    // When using the BoM, no need to specify versions in Firebase dependencies
    implementation 'com.google.firebase:firebase-analytics-ktx'
    implementation 'com.google.firebase:firebase-analytics'
    implementation 'com.google.firebase:firebase-crashlytics'
    implementation 'com.google.firebase:firebase-auth'
    implementation 'com.google.firebase:firebase-database'
    implementation 'com.google.firebase:firebase-messaging'

    // required if your app is in the Google Play Store (tip: avoid using bundled play services libs)
    implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1+'
    // alternatively, use the following lib for getting the AAID
    // implementation 'com.google.android.gms:play-services-ads:17.2.0'
    // (Optional) Chrome Tab matching (enables 100% guaranteed matching based on cookies)
    implementation 'androidx.browser:browser:1.7.0'
    // Replace above with the line below if you do not support androidx
    // implementation 'com.android.support:customtabs:28.0.0'
}

valentinozegna avatar Jul 30 '24 04:07 valentinozegna

Hey @Valent1 Finally after 3 days spending i find the solution:

  1. The problem is when using emulator only tested number added in the firestore will work.
  2. if you are using physical device make sure the sim is there if not then it will not work.
  3. the codeSent(verificationId, forceResendingToken){ Navigator here with arguments….} this function is very important two points you need to verify
  4. the navigation must be push not pushReplacement or it will not work.
  5. it must pass the verificationId as a argument to the OTPScreen
  6. in my case GoRouter was not working then i converted that to Navigator.push and it works

iHamza7 avatar Jul 30 '24 13:07 iHamza7

Facing the same issue at real device randomly

RexNexstream avatar Aug 15 '24 07:08 RexNexstream

Yes, This issue come on the emulator but correctly work on the physical device.

[Error: [auth/app-not-authorized] This app is not authorized to use Firebase Authentication. Please verify that the correct package name, SHA-1, and SHA-256 are configured in the Firebase Console. [ Invalid app info in play_integrity_token ]]

muhammadasifdotai avatar Aug 19 '24 05:08 muhammadasifdotai

Yes, This issue come on the emulator but correctly work on the physical device.

[Error: [auth/app-not-authorized] This app is not authorized to use Firebase Authentication. Please verify that the correct package name, SHA-1, and SHA-256 are configured in the Firebase Console. [ Invalid app info in play_integrity_token ]]

For my case , happen in physical device too.

RexNexstream avatar Aug 19 '24 10:08 RexNexstream

It is my turn. I have same problem for 2 days. There is nothing change to my project, config or SHA-1, SHA-256, it just happen. I use android studio, the emulator show error : [Error: [auth/app-not-authorized] This app is not authorized to use Firebase Authentication. Please verify that the correct package name, SHA-1, and SHA-256 are configured in the Firebase Console. [ Invalid app info in play_integrity_token ]]

dangnmd avatar Sep 30 '24 02:09 dangnmd

Instead of an emulator, you have to use a physical device; then, Insha Allah, it will work.

muhammadasifdotai avatar Oct 04 '24 05:10 muhammadasifdotai

We can't always use a physical device, this is why emulators exist and should be supported.

valentinozegna avatar Oct 08 '24 05:10 valentinozegna

so I have eventually figured it out one just has to set the test phone numbers and verification code on the console but still use the same call backs for verify_phonenumber so when fire base sees it it just verify using the verification id, verification code , and test number, rather than send sms to user, so callbacks that involve sending sms will not be triggered , since sms only works on web and on physical devices not emulator and you could put this call back

    codeAutoRetrievalTimeout: (String verId) {
     // Store for timeout scenario, you can store the verification id, since codeSent , verificationfailed and verificationCompleted deals with sending sms and it's process
  }

eobolo avatar Oct 15 '24 15:10 eobolo

https://firebase.google.com/docs/auth/flutter/phone-auth#testing

eobolo avatar Oct 15 '24 15:10 eobolo

same issue

abdu-zeyad avatar Nov 01 '24 00:11 abdu-zeyad

same issue. tried everything but still persist...

korayerdem89 avatar Nov 20 '24 21:11 korayerdem89

Had the same issue. I didnt know, that on an Emulator, only test numbers will work. The documentation or error message should state that.

Lurchfresser avatar Nov 25 '24 19:11 Lurchfresser

This is the solution for React Native / Expo project. Adapt it for Flutter

  1. Add All Fingerprints (SHA-1 and SHA-256) to Firebase Open your project terminal and run: cd android ./gradlew signingReport

    • You will find 2 different SHA-1 keys and 2 different SHA-256 keys in the list Add these 4 fingerprints to Firebase (Firebase -> Project Settings -> General -> Add fingerprint) Additionally, add Google Play signing and release keys to your Firebase project (2 SHA-1 and 2 SHA-256) In total, there should be 4 SHA-1 and 4 SHA-256 fingerprints in your Firebase project

2.Update google-services.json Download the updated google-services.json from Firebase Console Place it in your project's android/app/ directory

3.Verify build.gradle Configuration Check android/app/build.gradle Ensure the applicationId matches exactly with your Firebase Console package name

  1. Configure App Check (if applicable) In your Firebase project: Register App Check Select your Android project Click the menu icon, then "Manage debug token" Copy the debug token Update your Firebase config: rnfbProvider.configure({ android: { provider: DEV ? "debug" : "playIntegrity", debugToken: "YOUR_DEBUG_TOKEN", // Paste your debug token here }, apple: { provider: DEV ? "debug" : "appAttestWithDeviceCheckFallback", debugToken: "YOUR_DEBUG_TOKEN", }, });

  2. Clean Project (React Native/Expo)

For Expo projects

npx expo prebuild --clean

Then clean Android

cd android ./gradlew clean

Note: 1- Emulator is not working. Try it on real device, also try on Google Play / internal test. 2- Try phone login on different devices, if ur device's ROM modified, this error may occur again.

korayerdem89 avatar Nov 27 '24 16:11 korayerdem89

https://firebase.google.com/docs/auth/flutter/phone-auth#testing

This worked for me

BrunoJay avatar Dec 02 '24 21:12 BrunoJay

same issue happening some time

ilyasarafathemvigo avatar Dec 04 '24 12:12 ilyasarafathemvigo

getting same issue on react native expo only on local builds

TanayK07 avatar Dec 04 '24 14:12 TanayK07

For those who have the same issue, you should add a 👍 emoji to the original issue to help prioritize this.

WillowWisp avatar Dec 05 '24 04:12 WillowWisp