You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unhandled Exception: PlatformException(error, Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference, null, java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
Please help me with this. Provided the API key in the manifest file as mentioned in docs inside tag
Also added safety net dependency in android/app/build.gradle as:
Using package version: safetynet_attestation: ^0.0.5
E/flutter ( 1551): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:653:7)
E/flutter ( 1551): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:296:18)
E/flutter ( 1551):
E/flutter ( 1551): #2 MethodChannelSafetynetAttestation.googlePlayServicesAvailability (package:safetynet_attestation/safetynet_attestation_method_channel.dart:28:9)
E/flutter ( 1551): ''
Unhandled Exception: PlatformException(error, Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference, null, java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
Please help me with this. Provided the API key in the manifest file as mentioned in docs inside tag
Also added safety net dependency in android/app/build.gradle as:
dependencies {
implementation 'com.google.android.gms:play-services-safetynet:18.0.1'
}
Please find the code below:
void safetyNet() async {
SafetynetAttestation safetynetAttestation = SafetynetAttestation();
GooglePlayServicesAvailability? googlePlayServicesAvailability = await safetynetAttestation.googlePlayServicesAvailability();
if (googlePlayServicesAvailability != null) {
print("googlePlayServicesAvailability.name = ${googlePlayServicesAvailability.name}");
JWSPayloadModel result = await safetynetAttestation.safetyNetAttestationPayload(Nonce.generate());
print("safety result = ${result.basicIntegrity}, ${result.ctsProfileMatch}");
}
}
The text was updated successfully, but these errors were encountered: