I have the following login with google code in java android.
private void signIn() {
Intent signInIntent = mGoogleSignInClient.getSignInIntent();
someActivityResultLauncher.launch(signInIntent);
}
ActivityResultLauncher<Intent> someActivityResultLauncher = registerForActivityResult(
new ActivityResultContracts.StartActivityForResult(),
new ActivityResultCallback<ActivityResult>() {
@Override
public void onActivityResult(ActivityResult result) {
if (result.getResultCode() == Activity.RESULT_OK) {
Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(result.getData());
handleSignInResult(task);
}
}
}
);
And I get this linting error. App does run on device. But I would like to fix this issue.
/home/runner/work/etu-android/etu-android/app/src/main/java/com/encycode/etus/Login.java:151: Error: Upgrade Fragment version to at least 1.3.0. [InvalidFragmentVersionForActivityResult]
ActivityResultLauncher<Intent> someActivityResultLauncher = registerForActivityResult(
^
Explanation for issues of type "InvalidFragmentVersionForActivityResult":
In order to use the ActivityResult APIs you must upgrade your
Fragment version to 1.3.0. Previous versions of FragmentActivity
failed to call super.onRequestPermissionsResult() and used invalid
request codes
I am using following library version
implementation "androidx.fragment:fragment:1.3.1"