Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while checking google play service availability #6

Closed
Hiteshc29 opened this issue Nov 22, 2022 · 2 comments
Closed

Error while checking google play service availability #6

Hiteshc29 opened this issue Nov 22, 2022 · 2 comments

Comments

@Hiteshc29
Copy link

Hiteshc29 commented Nov 22, 2022

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}");
}
}

@pewiher
Copy link
Contributor

pewiher commented Feb 22, 2023

Hello, good afternoon, could you help us with more description, additionally the plugin was updated.

@pewiher
Copy link
Contributor

pewiher commented Feb 28, 2023

As there is no further information in this regard, the incident will be closed, in case of presenting any news, open a new incident.

@pewiher pewiher closed this as completed Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants