Search code examples
fluttersafetynetsafetynet-api

How to fix Remove the play-services-safetynet warning?


I am attempting to place my app in production but, continuously get the "warning"/error that wont allow me to deploy my app to production.

Critical issues have been reported with the following SDK versions:

com.google.android.gms:play-services-safetynet:18.0.0

What the SDK developer told us: The SafetyNet Attestation API is being discontinued and replaced by the new Play Integrity API. Begin migration as soon as possible to avoid user disruption. The Play Integrity API includes all the integrity signals that SafetyNet Attestation offers and more, like Google Play licensing and better error messaging. Learn more and start migrating at https://developer.android.com/training/safetynet/deprecation-timeline

I have attempted the fix in Stack Fix1 and in Stackfix2 but no luck.

I am using

dependencies:
  http: ^0.13.4
  json_annotation: ^4.1.0
  shared_preferences: ^2.0.15
  datetime_picker_formfield: ^2.0.0
  image_picker: ^0.8.4+2
  image_cropper: ^1.0.1
  path: any
  transparent_image: ^1.0.0
  clippy_flutter: ^1.1.0
  rxdart: ^0.26.0
  font_awesome_flutter: ^8.8.1
  bubble_bottom_bar: ^1.2.0
  flutter_rating: ^0.0.2
  sticky_headers: ^0.1.7
  google_maps_flutter: ^2.1.10
  geolocator: ^7.6.2
  google_maps_webservice: ^0.0.19
  geocoder: ^0.2.1
  source_gen: ^1.0.0
  flutter_counter: ^1.0.3
  share: ^0.6.4
  carousel_pro: ^1.0.0
  dropdown_menu: ^1.1.1
  flutter_flip_view: ^1.0.3
  permission_handler: ^8.1.6
  giffy_dialog: ^1.7.0
  autocomplete_textfield: ^1.6.4
  intl: ^0.17.0
  url_launcher: ^6.1.5
  js: ^0.6.0
  universal_html: ^1.2.3
  square_in_app_payments: ^1.7.4
  cached_network_image: ^3.2.1
  provider: 
  blinkid_flutter:
  flutter_mapbox_autocomplete:
  firebase_core: ^1.20.0 
  firebase_auth: ^3.6.2
  cloud_firestore: ^3.1.1
  edge_alert: ^0.0.1
  firebase_messaging: ^11.1.0 
  flutter_local_notifications: ^9.1.4
  badges: ^2.0.2
  platform: ^3.1.0
  flutter_cache_manager: ^3.3.0


  flutter:
    sdk: flutter
  flutter_auth_buttons: ^0.3.1





  cupertino_icons: ^0.1.2
  emojis: ^0.9.3
  firebase_app_check: ^0.0.6+18
  
dev_dependencies:
  flutter_test:
    sdk: flutter
  build_runner: ^1.0.0
  json_serializable: ^5.0.2 

and my build.gradle dependencies are:

dependencies {

implementation 'androidx.appcompat:appcompat:1.0.2'   
testImplementation 'junit:junit:4.12'
implementation 'com.google.firebase:firebase-analytics:17.5.0'
implementation platform('com.google.firebase:firebase-bom:30.2.0')
    implementation 'com.google.firebase:firebase-core'
    implementation('com.google.firebase:firebase-auth') {
        exclude module: "play-services-safetynet"
    }
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation 'com.google.firebase:firebase-messaging:20.1.0'
implementation 'com.google.android.play:integrity:1.0.1'

}

And I'm using classpath 'com.google.gms:google-services:4.3.13'

Firebase integration: I enter image description here

But every time I send publish the app, it hangs "In Review" and nothing happens. It has been 2 weeks now and I'm not sure how to remove the Play Services Safety Net error/warning.

Any Ideas on how to remove the safetynet error? I'm pretty sure the issue is with firebase, that is why I added the ignore dependency but. No luck


Solution

  • Please exclude play-service-safetynet in file android/app/build.gradle

    dependencies {
      //....
    }
    //add below script  
    configurations.all { 
        exclude group: 'com.google.android.gms', module: 'play-services-safetynet'
    }
    

    refer Click here!