firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.57k stars 3.94k forks source link

[firebase_app_check] App check token does not print on Android real devices #13067

Closed ablbol closed 1 month ago

ablbol commented 1 month ago

Is there an existing issue for this?

Which plugins are affected?

App Check

Which platforms are affected?

Android

Description

I have been having this problem for many months. I really appreciate any help. I am using real Android device. I followed instructions carefully and unfortunately most of the time the App Check token does not print to the screen. Here is my Flutter code that should print the token:

  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();

  await FirebaseAppCheck.instance.activate(
    androidProvider: AndroidProvider.debug,
    appleProvider: AppleProvider.debug,
  );

I keep restarting my app on 3 different real Androide devices in the hope that an App Check token is printed, but I might get lucky and get a token after 24 hours of trying. This is very frustrating. Could someone please help.

Reproducing the issue

use the following command to run the Flutter app and wait for the App Check Token to be printed, but it never does:

flutter run --target lib/main_development.dart --flavor development -d RZCWC0498LT

Firebase Core version

^3.1.1

Flutter Version

3.22.2

Relevant Log Output

flutter run --target lib/main_development.dart --flavor development -d RZCWC0498LT
Launching lib/main_development.dart on SM A546E in debug mode...
Warning: unable to detect project KGP version. Skipping version checking. 
This may be because you have applied KGP after the Flutter Gradle Plugin.
Running Gradle task 'assembleDevelopmentDebug'...                  17.8s
✓ Built build/app/outputs/flutter-apk/app-development-debug.apk
D/FlutterGeolocator(18907): Attaching Geolocator to activity
D/FlutterGeolocator(18907): Creating service.
D/FlutterGeolocator(18907): Binding to location service.
D/FlutterGeolocator(18907): Geolocator foreground service connected
D/FlutterGeolocator(18907): Initializing Geolocator services
D/FlutterGeolocator(18907): Flutter engine connected. Connected engine count 1
D/FlutterGeolocator(18907): Geolocator foreground service connected
D/FlutterGeolocator(18907): Initializing Geolocator services
D/FlutterGeolocator(18907): Flutter engine connected. Connected engine count 2
D/TrafficStats(18907): tagSocket(177) with statsTag=0xffffffff, statsUid=-1
I/FLTFireMsgService(18907): FlutterFirebaseMessagingBackgroundService started!
Syncing files to device SM A546E...                                142ms

Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

A Dart VM Service on SM A546E is available at: http://127.0.0.1:65156/BztFnCbNG3w=/
The Flutter DevTools debugger and profiler on SM A546E is available at:
http://127.0.0.1:9102?uri=http://127.0.0.1:65156/BztFnCbNG3w=/
D/FRCPlugin(18907): Sending fetchTimeout: 10
I/flutter (18907): oolfa: FirebaseRemoteConfigRepository.init() - fetched and activated
I/flutter (18907): oolfa: offlineProvider - created
D/ConnectivityManager(18907): StackLog: [android.net.ConnectivityManager.sendRequestForNetwork(ConnectivityManager.java:4401)] [android.net.ConnectivityManager.registerDefaultNetworkCallbackForUid(ConnectivityManager.java:4965)] [android.net.ConnectivityManager.registerDefaultNetworkCallback(ConnectivityManager.java:4932)] [android.net.ConnectivityManager.registerDefaultNetworkCallback(ConnectivityManager.java:4906)] [dev.fluttercommunity.plus.connectivity.ConnectivityBroadcastReceiver.onListen(ConnectivityBroadcastReceiver.java:77)] [io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onListen(EventChannel.java:218)] [io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onMessage(EventChannel.java:197)] [io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:292)] [io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)] [io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)]
I/flutter (18907): oolfa: localNotificationServiceProvider - created
I/flutter (18907): oolfa: deviceAppVersionProvider - created
I/flutter (18907): oolfa: appUpdateStatusProvider - created
I/flutter (18907): oolfa: storeAppVersionProvider - created
I/flutter (18907): oolfa: purchasesRepositoryProvider - created
I/flutter (18907): oolfa: LocationPermissionRepository - created
I/flutter (18907): oolfa: userProvider - created
I/flutter (18907): oolfa: firebaseAuthRepositoryProvider - created
I/flutter (18907): oolfa: DeviceInfoRepository - created
I/flutter (18907): oolfa: notificationSettingsProvider - created
I/flutter (18907): oolfa: firebaseMessagingRepositoryProvider - created
I/flutter (18907): oolfa: userProvider - user.emailVerified = null
I/flutter (18907): oolfa: userProvider - user == null - true
I/flutter (18907): oolfa: userProvider - user.emailVerified = null
I/flutter (18907): oolfa: userProvider - user == null - true
I/flutter (18907): oolfa: offlineProvider - connectivityResult: [ConnectivityResult.wifi]
I/flutter (18907): oolfa: offlineProvider - connectivityResult: [ConnectivityResult.wifi]
I/flutter (18907): oolfa: purchasesRepositoryProvider - disposed
I/flutter (18907): oolfa: updateLocationPermission - state: LocationPermissionModel(isLocationServiceEnabled: true, 
I/flutter (18907): locationPermission: LocationPermission.denied, 
I/flutter (18907): currentPosition: null, 
I/flutter (18907): currentAddress: null)
I/flutter (18907): 
I/flutter (18907): oolfa: myProfileProvider - created
I/flutter (18907): oolfa: firebaseFirestoreRepositoryProvider - created
I/flutter (18907): oolfa: uIdProvider - created
I/flutter (18907): oolfa: uIdProvider - uid: null
I/flutter (18907): oolfa: myProfileProvider - firestoreRepository == null - true
I/flutter (18907): oolfa: mySettingsProvider - created
I/flutter (18907): oolfa: mySettingsProvider - firestoreRepository == null - true
I/flutter (18907): oolfa: messagingPermissionNotDeterminedProvider - created
I/flutter (18907): oolfa: messagingPermissionNotDeterminedProvider - authorizationStatus: AuthorizationStatus.denied
I/flutter (18907): oolfa: messagingPermissionNotDeterminedProvider - isMessagingPermissionNotDeterminedInSharedPref: true
I/flutter (18907): oolfa: messagingPermissionAuthorizedProvider - created
D/TrafficStats(18907): tagSocket(186) with statsTag=0xffffffff, statsUid=-1
I/flutter (18907): oolfa: analyticsProvider - created
I/flutter (18907): oolfa: App - didChangeAppLifecycleState - AppLifecycleState.resumed
I/flutter (18907): oolfa: notificationSettingsProvider - disposed
I/flutter (18907): oolfa: notificationSettingsProvider - created
I/flutter (18907): oolfa: messagingPermissionNotDeterminedProvider - disposed
I/flutter (18907): oolfa: messagingPermissionAuthorizedProvider - disposed
I/flutter (18907): oolfa: messagingPermissionNotDeterminedProvider - created
I/flutter (18907): oolfa: messagingPermissionNotDeterminedProvider - authorizationStatus: AuthorizationStatus.denied
I/flutter (18907): oolfa: messagingPermissionNotDeterminedProvider - isMessagingPermissionNotDeterminedInSharedPref: true
I/flutter (18907): oolfa:goRouter-uri:/auth/onboarding
I/flutter (18907): oolfa:goRouter-matchedLocation:/auth/onboarding
I/flutter (18907): oolfa:goRouter-isEmailVerified:false
I/flutter (18907): oolfa:goRouter-userHasValue:false
I/flutter (18907): oolfa:goRouter-isUserLoading:false
I/flutter (18907): oolfa:goRouter-myProfileHasValue:false
I/flutter (18907): oolfa:goRouter-isMyProfileLoading:false
I/flutter (18907): oolfa:goRouter-accountType:null
I/flutter (18907): oolfa:goRouter-mySettingsHasValue:false
I/flutter (18907): oolfa:goRouter-isMySettingsLoading:false
I/flutter (18907): oolfa:goRouter-isMessagingPermissionNotDetermined:true
I/flutter (18907): oolfa: isAppUnderMaintenanceProvider - created
I/flutter (18907): oolfa: AuthController - created
I/flutter (18907): oolfa: AuthScreen - created
I/flutter (18907): oolfa: EditMySettingsController - created
I/flutter (18907): oolfa: OnboardingScreen - created
I/flutter (18907): oolfa: GoRouterRefreshStream - auth user was updated
I/flutter (18907): oolfa:goRouter-uri:/auth/onboarding
I/flutter (18907): oolfa:goRouter-matchedLocation:/auth/onboarding
I/flutter (18907): oolfa:goRouter-isEmailVerified:false
I/flutter (18907): oolfa:goRouter-userHasValue:false
I/flutter (18907): oolfa:goRouter-isUserLoading:false
I/flutter (18907): oolfa:goRouter-myProfileHasValue:false
I/flutter (18907): oolfa:goRouter-isMyProfileLoading:false
I/flutter (18907): oolfa:goRouter-accountType:null
I/flutter (18907): oolfa:goRouter-mySettingsHasValue:false
I/flutter (18907): oolfa:goRouter-isMySettingsLoading:false
I/flutter (18907): oolfa:goRouter-isMessagingPermissionNotDetermined:true
I/BLASTBufferQueue(18907): [SurfaceView[com.aimn.oolfa.dev/com.aimn.oolfa.MainActivity]@0#1](f:0,a:0,s:0) onFrameAvailable the first frame is available
W/WindowOnBackDispatcher(18907): OnBackInvokedCallback is not enabled for the application.
W/WindowOnBackDispatcher(18907): Set 'android:enableOnBackInvokedCallback="true"' in the application manifest.
D/SurfaceView@47f157d(18907): 75437437 setAlpha: alpha=1.0
I/SurfaceView(18907): 75437437 Changes: creating=false format=false size=false visible=false alpha=true hint=false visible=false left=false top=false z=false attached=true lifecycleStrategy=false
I/SurfaceView@47f157d(18907): 75437437 Cur surface: Surface(name=null)/@0x2c3787e
I/SurfaceView@47f157d(18907): updateSurface: mVisible = true mSurface.isValid() = true
I/SurfaceView@47f157d(18907): updateSurface: mSurfaceCreated = true surfaceChanged = false visibleChanged = false
I/SurfaceView(18907): 75437437 surfaceRedrawNeeded
I/SurfaceView(18907): 75437437 finishedDrawing
V/SurfaceView@47f157d(18907): Layout: x=0 y=0 w=1080 h=2298, frame=Rect(0, 0 - 1080, 2298)
I/flutter (18907): oolfa: messagingPermissionNotDeterminedProvider - disposed
D/ViewRootImpl@2d643a0[MainActivity](18907): Setup new sync=wmsSync-ViewRootImpl@2d643a0[MainActivity]#2
D/ViewRootImpl@2d643a0[MainActivity](18907): Creating new active sync group ViewRootImpl@2d643a0[MainActivity]#3
D/ViewRootImpl@2d643a0[MainActivity](18907): registerCallbacksForSync syncBuffer=false
D/SurfaceView(18907): 75437437 updateSurfacePosition RenderWorker, frameNr = 1, position = [0, 0, 1080, 2298] surfaceSize = 1080x2298
I/SurfaceView@47f157d(18907): uSP: rtp = Rect(0, 0 - 1080, 2298) rtsw = 1080 rtsh = 2298
I/SurfaceView@47f157d(18907): onSSPAndSRT: pl = 0 pt = 0 sx = 1.0 sy = 1.0
I/SurfaceView@47f157d(18907): aOrMT: ViewRootImpl@2d643a0[MainActivity] t = android.view.SurfaceControl$Transaction@e88af73 fN = 1 android.view.SurfaceView.-$$Nest$mapplyOrMergeTransaction:0 android.view.SurfaceView$SurfaceViewPositionUpdateListener.positionChanged:1660 android.graphics.RenderNode$CompositePositionUpdateListener.positionChanged:369 
I/ViewRootImpl@2d643a0[MainActivity](18907): mWNT: t=0xb400007d2a47db10 mBlastBufferQueue=0xb400007dca477f10 fn= 1 caller= android.view.SurfaceView.applyOrMergeTransaction:1592 android.view.SurfaceView.-$$Nest$mapplyOrMergeTransaction:0 android.view.SurfaceView$SurfaceViewPositionUpdateListener.positionChanged:1660 
D/ViewRootImpl@2d643a0[MainActivity](18907): Received frameDrawingCallback syncResult=0 frameNum=1.
I/ViewRootImpl@2d643a0[MainActivity](18907): mWNT: t=0xb400007d2a477970 mBlastBufferQueue=0xb400007dca477f10 fn= 1 caller= android.view.ViewRootImpl$8.onFrameDraw:13614 android.view.ThreadedRenderer$1.onFrameDraw:788 <bottom of call stack> 
D/ViewRootImpl@2d643a0[MainActivity](18907): Setting up sync and frameCommitCallback
I/BLASTBufferQueue(18907): [ViewRootImpl@2d643a0[MainActivity]#0](f:0,a:0,s:0) onFrameAvailable the first frame is available
D/ViewRootImpl@2d643a0[MainActivity](18907): Received frameCommittedCallback lastAttemptedDrawFrameNum=1 didProduceBuffer=true
D/OpenGLRenderer(18907): CFMS:: SetUp Pid : 18907    Tid : 18979
D/ViewRootImpl@2d643a0[MainActivity](18907): reportDrawFinished
I/ViewRootImpl@2d643a0[MainActivity](18907): registerCallbackForPendingTransactions
I/ViewRootImpl@2d643a0[MainActivity](18907): MSG_WINDOW_FOCUS_CHANGED 1 0
D/ViewRootImpl@2d643a0[MainActivity](18907): mThreadedRenderer.initializeIfNeeded()#2 mSurface={isValid=true 0xb400007d8a4db200}
D/InputMethodManagerUtils(18907): startInputInner - Id : 0
I/InputMethodManager(18907): startInputInner - IInputMethodManagerGlobalInvoker.startInputOrWindowGainedFocus
D/InputMethodManagerUtils(18907): startInputInner - Id : 0
D/InsetsController(18907): onStateChanged: host=com.aimn.oolfa.dev/com.aimn.oolfa.MainActivity from=android.view.ViewRootImpl$ViewRootHandler.handleMessageImpl:7085 state=InsetsState: {mDisplayFrame=Rect(0, 0 - 1080, 2340), mDisplayCutout=DisplayCutout{insets=Rect(0, 80 - 0, 0) waterfall=Insets{left=0, top=0, right=0, bottom=0} boundingRect={Bounds=[Rect(0, 0 - 0, 0), Rect(511, 0 - 569, 80), Rect(0, 0 - 0, 0), Rect(0, 0 - 0, 0)]} cutoutPathParserInfo={CutoutPathParserInfo{displayWidth=1080 displayHeight=2340 physicalDisplayWidth=1080 physicalDisplayHeight=2340 density={2.8125} cutoutSpec={M 0,0 M 0,7.822222222222222‬‬ a 10.31111111111111‬,10.31111111111111‬ 0 1,0 0,20.62222222222222‬ a 10.31111111111111‬,10.31111111111111‬ 0 1,0 0,-20.62222222222222‬ Z @dp} rotation={0} scale={1.0} physicalPixelDisplaySizeRatio={1.0}}}}, mRoundedCorners=RoundedCorners{[RoundedCorner{position=TopLeft, radius=0, center=Point(0, 0)}, RoundedCorner{position=TopRight, radius=0, center=Point(0, 0)}, RoundedCorner{position=BottomRight, radius=0, center=Point(0, 0)}, RoundedCorner{position=BottomLeft, radius=0, center=Point(0, 0)}]}  mRoundedCornerFrame=Rect(0, 0 - 1080, 2340), mPrivacyIndicatorBounds=PrivacyIndicatorBounds {static bounds=Rect(956, 0 - 1080, 80) rotation=0}, mDisplayShape=DisplayShape{ spec=-1084927657 displayWidth=1080 displayHeight=2340 physicalPixelDisplaySizeRatio=1.0 rotation=0 offsetX=0 offsetY=0 scale=1.0}, mSources= { InsetsSource: {cbd60001 mType=navigationBars mFrame=[0,2298][1080,2340] mVisible=true mFlags=[SUPPRESS_SCRIM]}, InsetsSource: {cbd60004 mType=systemGestures mFrame=[0,0][84,2340] mVisible=true mFlags=[]}, InsetsSource: {cbd60005 mType=mandatorySystemGestures mFrame=[0,2250][1080,2340] mVisible=true mFlags=[]}, InsetsSource: {cbd60006 mType=tappableElement mFrame=[0,0][0,0] mVisible=true mFlags=[]}, InsetsSource: {cbd60024 mType=systemGestures mFrame=[996,0][1080,2340] mVisible=true mFlags=[]}, InsetsSource: {3 mType=ime mFrame=[0,0][0,0] mVisible=false mFlags=[]}, InsetsSource: {27 mType=displayCutout mFrame=[0,0][1080,80] mVisible=true mFlags=[]}, InsetsSource: {7a750000 mType=statusBars mFrame=[0,0][1080,80] mVisible=true mFlags=[]}, InsetsSource: {7a750005 mType=mandatorySystemGestures mFrame=[0,0][1080,114] mVisible=true mFlags=[]}, InsetsSource: {7a750006 mType=tappableElement mFrame=[0,0][1080,80] mVisible=true mFlags=[]} }
D/InsetsSourceConsumer(18907): applyRequestedVisibilityToControl: visible=false, type=8
I/ViewRootImpl@2d643a0[MainActivity](18907): onDisplayChanged oldDisplayState=2 newDisplayState=2
I/ViewRootImpl@2d643a0[MainActivity](18907): onDisplayChanged oldDisplayState=2 newDisplayState=2
I/flutter (18907): unhandled element <filter/>; Picture key: Svg loader
I/flutter (18907): oolfa: updateLocationPermission - state: LocationPermissionModel(isLocationServiceEnabled: true, 
I/flutter (18907): locationPermission: LocationPermission.denied, 
I/flutter (18907): currentPosition: null, 
I/flutter (18907): currentAddress: null)
I/flutter (18907): 
I/flutter (18907): oolfa: messagingPermissionNotDeterminedProvider - created
I/flutter (18907): oolfa: messagingPermissionNotDeterminedProvider - authorizationStatus: AuthorizationStatus.denied
I/flutter (18907): oolfa: messagingPermissionNotDeterminedProvider - isMessagingPermissionNotDeterminedInSharedPref: true
I/ViewRootImpl@2d643a0[MainActivity](18907): onDisplayChanged oldDisplayState=2 newDisplayState=2
D/ProfileInstaller(18907): Installing profile for com.aimn.oolfa.dev
I/ViewRootImpl@2d643a0[MainActivity](18907): onDisplayChanged oldDisplayState=2 newDisplayState=2

Flutter dependencies

Expand Flutter dependencies snippet
```yaml flutter pub deps -- --style=compact Dart SDK 3.4.3 Flutter SDK 3.22.2 oolfa 1.5.3+58 dependencies: - android_id 0.4.0 [flutter] - audio_waveforms 1.0.5 [flutter] - audioplayers 6.0.0 [audioplayers_android audioplayers_darwin audioplayers_linux audioplayers_platform_interface audioplayers_web audioplayers_windows file flutter http meta path_provider synchronized uuid] - badges 3.1.2 [flutter] - cached_network_image 3.3.1 [cached_network_image_platform_interface cached_network_image_web flutter flutter_cache_manager octo_image] - carousel_slider 4.2.1 [flutter] - cloud_firestore 5.0.2 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta] - cloud_functions 5.0.2 [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] - crypto 3.0.3 [typed_data] - cupertino_icons 1.0.8 - device_info_plus 10.1.0 [device_info_plus_platform_interface ffi file flutter flutter_web_plugins meta web win32 win32_registry] - dotted_border 2.1.0 [flutter path_drawing] - firebase_analytics 11.1.0 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter] - firebase_app_check 0.3.0+2 [firebase_app_check_platform_interface firebase_app_check_web firebase_core firebase_core_platform_interface flutter] - firebase_auth 5.1.1 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta] - firebase_core 3.1.1 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_crashlytics 4.0.2 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace] - firebase_database 11.0.2 [firebase_core firebase_core_platform_interface firebase_database_platform_interface firebase_database_web flutter] - firebase_messaging 15.0.2 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta] - firebase_remote_config 5.0.2 [firebase_core firebase_core_platform_interface firebase_remote_config_platform_interface firebase_remote_config_web flutter] - firebase_storage 12.1.0 [firebase_core firebase_core_platform_interface firebase_storage_platform_interface firebase_storage_web flutter] - firebase_ui_firestore 1.6.4 [cloud_firestore firebase_ui_localizations firebase_ui_shared flutter] - flash 3.1.1 [flutter] - flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine] - flutter_dotenv 5.1.0 [flutter] - flutter_facebook_auth 7.0.1 [flutter flutter_facebook_auth_platform_interface flutter_facebook_auth_web facebook_auth_desktop] - flutter_hooks 0.20.5 [flutter] - flutter_image_compress 2.3.0 [flutter flutter_image_compress_platform_interface flutter_image_compress_common flutter_image_compress_web flutter_image_compress_macos flutter_image_compress_ohos] - flutter_launcher_icons 0.13.1 [args checked_yaml cli_util image json_annotation path yaml] - flutter_local_notifications 17.2.1 [clock flutter flutter_local_notifications_linux flutter_local_notifications_platform_interface timezone] - flutter_localizations 0.0.0 [flutter intl characters clock collection material_color_utilities meta path vector_math] - flutter_slidable 3.1.0 [flutter] - flutter_svg 2.0.10+1 [flutter http vector_graphics vector_graphics_codec vector_graphics_compiler] - geocoding 3.0.0 [flutter geocoding_platform_interface geocoding_android geocoding_ios] - geolocator 12.0.0 [flutter geolocator_platform_interface geolocator_android geolocator_apple geolocator_web geolocator_windows] - go_router 14.2.0 [collection flutter flutter_web_plugins logging meta] - google_sign_in 6.2.1 [flutter google_sign_in_android google_sign_in_ios google_sign_in_platform_interface google_sign_in_web] - hooks_riverpod 2.5.1 [collection flutter flutter_hooks flutter_riverpod riverpod state_notifier] - http 1.2.1 [async http_parser meta web] - image_cropper 7.1.0 [flutter image_cropper_platform_interface image_cropper_for_web] - image_picker 1.1.2 [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.19.0 [clock meta path] - mask_text_input_formatter 2.9.0 [flutter] - material_design_icons_flutter 7.0.7296 [flutter] - open_mail_app 0.4.5 [platform url_launcher flutter] - package_info_plus 8.0.0 [ffi flutter flutter_web_plugins http meta path package_info_plus_platform_interface web win32 clock] - path 1.9.0 - path_provider 2.1.3 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows] - permission_handler 11.3.1 [flutter meta permission_handler_android permission_handler_apple permission_handler_html permission_handler_windows permission_handler_platform_interface] - photo_view 0.15.0 [flutter] - purchases_flutter 6.29.4 [flutter freezed_annotation json_annotation] - rate_my_app 2.2.0 [shared_preferences flutter_rating_bar flutter] - rxdart 0.27.7 - scrollable_positioned_list 0.3.8 [flutter collection] - 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] - shimmer 3.0.0 [flutter] - showcaseview 3.0.0 [flutter] - stack_trace 1.11.1 [path] - store_redirect 2.0.2 [flutter] - swipe_to 1.0.6 [flutter] - timeago 3.6.1 [intl] - url_launcher 6.3.0 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows] - uuid 4.4.0 [crypto sprintf meta fixnum] - webview_flutter 4.8.0 [flutter webview_flutter_android webview_flutter_platform_interface webview_flutter_wkwebview] dev dependencies: - 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] - flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math] - mocktail 1.0.4 [collection matcher test_api] - very_good_analysis 6.0.0 transitive dependencies: - _flutterfire_internals 1.3.38 [collection firebase_core firebase_core_platform_interface flutter meta] - archive 3.6.1 [crypto path] - args 2.5.0 - async 2.11.0 [collection meta] - audioplayers_android 5.0.0 [audioplayers_platform_interface flutter] - audioplayers_darwin 6.0.0 [audioplayers_platform_interface flutter] - audioplayers_linux 4.0.0 [audioplayers_platform_interface flutter] - audioplayers_platform_interface 7.0.0 [collection flutter meta plugin_platform_interface] - audioplayers_web 5.0.0 [audioplayers_platform_interface flutter flutter_web_plugins web] - audioplayers_windows 4.0.0 [audioplayers_platform_interface flutter] - boolean_selector 2.1.1 [source_span string_scanner] - 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] - cli_util 0.4.1 [meta path] - clock 1.1.1 - cloud_firestore_platform_interface 6.2.8 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - cloud_firestore_web 4.0.2 [_flutterfire_internals cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins] - cloud_functions_platform_interface 5.5.31 [firebase_core flutter meta plugin_platform_interface] - cloud_functions_web 4.9.9 [cloud_functions_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins] - collection 1.18.0 - connectivity_plus_platform_interface 2.0.0 [flutter meta plugin_platform_interface] - cross_file 0.3.4+1 [meta web] - dbus 0.7.10 [args ffi meta xml] - device_info_plus_platform_interface 7.0.0 [flutter meta plugin_platform_interface] - facebook_auth_desktop 2.0.0 [flutter http flutter_secure_storage flutter_facebook_auth_platform_interface] - 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 4.1.0 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_analytics_web 0.5.8 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins] - firebase_app_check_platform_interface 0.1.0+32 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_app_check_web 0.1.2+10 [_flutterfire_internals firebase_app_check_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins web] - firebase_auth_platform_interface 7.4.1 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_auth_web 5.12.3 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser meta web] - firebase_core_platform_interface 5.1.0 [collection flutter flutter_test meta plugin_platform_interface] - firebase_core_web 2.17.2 [firebase_core_platform_interface flutter flutter_web_plugins meta web] - firebase_crashlytics_platform_interface 3.6.38 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_database_platform_interface 0.2.5+38 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_database_web 0.2.5+10 [collection firebase_core firebase_core_web firebase_database_platform_interface flutter flutter_web_plugins] - firebase_messaging_platform_interface 4.5.40 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_messaging_web 3.8.10 [_flutterfire_internals firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins meta web] - firebase_remote_config_platform_interface 1.4.38 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_remote_config_web 1.6.10 [firebase_core firebase_core_web firebase_remote_config_platform_interface flutter flutter_web_plugins] - firebase_storage_platform_interface 5.1.25 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_storage_web 3.9.10 [_flutterfire_internals async firebase_core firebase_core_web firebase_storage_platform_interface flutter flutter_web_plugins http meta web] - firebase_ui_localizations 1.12.0 [flutter flutter_localizations path] - firebase_ui_shared 1.4.1 [flutter] - fixnum 1.1.0 - flutter_cache_manager 3.3.1 [clock collection file flutter http path path_provider rxdart sqflite uuid] - flutter_facebook_auth_platform_interface 6.0.0 [flutter plugin_platform_interface] - flutter_facebook_auth_web 6.0.0 [flutter flutter_web_plugins js flutter_facebook_auth_platform_interface] - 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.3 [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_local_notifications_linux 4.0.0+1 [dbus ffi flutter flutter_local_notifications_platform_interface path xdg_directories] - flutter_local_notifications_platform_interface 7.2.0 [flutter plugin_platform_interface] - flutter_plugin_android_lifecycle 2.0.20 [flutter] - flutter_rating_bar 4.0.1 [flutter] - flutter_riverpod 2.5.1 [collection flutter meta riverpod state_notifier] - flutter_secure_storage 9.2.2 [flutter flutter_secure_storage_linux flutter_secure_storage_macos flutter_secure_storage_platform_interface flutter_secure_storage_web flutter_secure_storage_windows meta] - flutter_secure_storage_linux 1.2.1 [flutter flutter_secure_storage_platform_interface] - flutter_secure_storage_macos 3.1.2 [flutter flutter_secure_storage_platform_interface] - flutter_secure_storage_platform_interface 1.1.2 [flutter plugin_platform_interface] - flutter_secure_storage_web 1.2.1 [flutter flutter_secure_storage_platform_interface flutter_web_plugins js] - flutter_secure_storage_windows 3.1.2 [ffi flutter flutter_secure_storage_platform_interface path path_provider win32] - freezed_annotation 2.4.1 [collection json_annotation meta] - 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.6.0 [flutter geolocator_platform_interface meta uuid] - geolocator_apple 2.3.7 [flutter geolocator_platform_interface] - geolocator_platform_interface 4.2.4 [flutter plugin_platform_interface vector_math meta] - geolocator_web 4.0.0 [flutter flutter_web_plugins geolocator_platform_interface web] - geolocator_windows 0.2.3 [flutter geolocator_platform_interface] - google_identity_services_web 0.3.1+1 [meta web] - google_sign_in_android 6.1.26 [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.3+3 [flutter flutter_web_plugins google_identity_services_web google_sign_in_platform_interface http web] - http_parser 4.0.2 [collection source_span string_scanner typed_data] - image 4.2.0 [archive meta xml] - image_cropper_for_web 5.1.0 [flutter flutter_web_plugins image_cropper_platform_interface web] - image_cropper_platform_interface 6.1.0 [flutter plugin_platform_interface http] - image_picker_android 0.8.12+3 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface] - image_picker_for_web 3.0.2 [flutter flutter_web_plugins image_picker_platform_interface mime] - image_picker_ios 0.8.12 [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] - js 0.6.7 [meta] - json_annotation 4.9.0 [meta] - leak_tracker 10.0.4 [clock collection meta path vm_service] - leak_tracker_flutter_testing 3.0.3 [flutter leak_tracker leak_tracker_testing matcher meta] - leak_tracker_testing 3.0.1 [leak_tracker matcher meta] - logging 1.2.0 - matcher 0.12.16+1 [async meta stack_trace term_glyph test_api] - material_color_utilities 0.8.0 [collection] - meta 1.12.0 - mime 1.0.5 - nm 0.5.0 [dbus] - octo_image 2.0.0 [flutter] - package_info_plus_platform_interface 3.0.0 [flutter meta plugin_platform_interface] - path_drawing 1.0.1 [vector_math meta path_parsing flutter] - path_parsing 1.0.1 [vector_math meta] - path_provider_android 2.2.6 [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.7 [flutter permission_handler_platform_interface] - permission_handler_apple 9.4.5 [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.5 - plugin_platform_interface 2.1.8 [meta] - riverpod 2.5.1 [collection meta stack_trace state_notifier] - share_plus_platform_interface 4.0.0 [cross_file flutter meta mime plugin_platform_interface path_provider uuid] - shared_preferences_android 2.2.3 [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] - sky_engine 0.0.99 - 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] - state_notifier 1.0.0 [meta] - stream_channel 2.1.2 [async] - string_scanner 1.2.0 [source_span] - synchronized 3.1.0+1 - term_glyph 1.2.1 - test_api 0.7.0 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph] - timezone 0.9.4 [path] - typed_data 1.3.2 [collection] - url_launcher_android 6.3.3 [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_graphics 1.1.11+1 [flutter http vector_graphics_codec] - vector_graphics_codec 1.1.11+1 - vector_graphics_compiler 1.1.11+1 [args meta path_parsing xml vector_graphics_codec path] - vector_math 2.1.4 - vm_service 14.2.1 - web 0.5.1 - webview_flutter_android 3.16.4 [flutter webview_flutter_platform_interface] - webview_flutter_platform_interface 2.10.0 [flutter meta plugin_platform_interface] - webview_flutter_wkwebview 3.13.1 [flutter path webview_flutter_platform_interface] - win32 5.5.1 [ffi] - win32_registry 1.1.3 [ffi win32] - 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

Lyokone commented 1 month ago

I'm not seeing any print in your demo code, what are you expecting to see?

ablbol commented 1 month ago

Hi @Lyokone, I am expecting to see the App Check Token!! Why doesn't it get printed?

Lyokone commented 1 month ago

There is not print in the code you have provided, why would it get printed ?

ablbol commented 1 month ago

Doesn't this code print the App Check Token for both Android and iOS devices? Am I missing something?

  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();

  await FirebaseAppCheck.instance.activate(
    androidProvider: AndroidProvider.debug,
    appleProvider: AppleProvider.debug,
  );
Lyokone commented 1 month ago

No, this will

print(await appCheck.getToken(true));
ablbol commented 1 month ago

@Lyokone, in your code above, where did you get the variable "appCheck"? I am following instructions over here for iOS and Android and there no such variable. Please explain so that we can understand.

I am not using the line of code you pointed out and still getting the App Check taken in iOS. How is that possible?

lunathanael commented 4 weeks ago

I am still having this issue, I think what @ablbol meant was the debug token is not being printed, not the actual app check token. Could you reopen this issue @Lyokone ?

ablbol commented 3 weeks ago

Correct, I was referring to the App Check "debug token". It does not print on Android devices 95% of the time.

lunathanael commented 3 weeks ago

@ablbol I'm excited to share I seem to have somewhat found a get-around for this issue. At least for my application: Although documentation hints at otherwise, providing any name for the firebase app during initialization will allow debug keys to be printed more consistently. An example from my code:

...
 WidgetsFlutterBinding.ensureInitialized();
  final app = await Firebase.initializeApp(
    name: 'db2',
    options: DefaultFirebaseOptions.currentPlatform,
  );
  print(app.name);
  print(app.options.appId);
  await FirebaseAppCheck.instanceFor(app: app).activate(
  ...
  )
  ...

or without the print statements, and with a more standard .instance

...
 WidgetsFlutterBinding.ensureInitialized();
 await Firebase.initializeApp(
    name: 'db2',
    options: DefaultFirebaseOptions.currentPlatform,
  );
  await FirebaseAppCheck.instance.activate(
  ...
  )
  ...

The app.name had a value of "[DEFAULT]", which could've possibly caused issues, a speculation. Look for this line:

D/com.google.firebase.appcheck.debug.internal.DebugAppCheckProvider(18512): Enter this debug secret into the allow list in the Firebase Console for your project: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX

Let me know if you have any questions that might help with your application issue @ablbol . Or anything I can do to assist with the bug hunting @Lyokone .