i want to use phone authentication in my app. When i run the app in android studio, the feature is working fine.
But when i install the released app from app gallery, i' ve got this error : "ONLY ONE String Field can be annotated as Url"
This is build.gradle file:
...
signingConfigs {
config {
storeFile file('/Users/username/AndroidStudioProjects/somepath/example.jks')
storePassword 'password'
keyAlias 'foldername'
keyPassword 'password'
}
}
...
buildTypes {
debug {
minifyEnabled false
debuggable true
signingConfig signingConfigs.config
}
release {
signingConfig signingConfigs.config
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
This is phone authentication request code:
private void startPhoneNumberVerification() {
// [START start_phone_auth]
VerifyCodeSettings settings = new VerifyCodeSettings.Builder()
.action(VerifyCodeSettings.ACTION_REGISTER_LOGIN)
.locale(Locale.getDefault())
.sendInterval(30)
.build();
Task<VerifyCodeResult> task = AGConnectAuth.getInstance().requestVerifyCode(countryCode, phoneNumberWithoutCountryCode, settings);
task.addOnSuccessListener(TaskExecutors.uiThread(), new OnSuccessListener<VerifyCodeResult>() {
@Override
public void onSuccess(VerifyCodeResult verifyCodeResult) {
phoneNumberContainer.setVisibility(View.GONE);
verifyCodeContainer.setVisibility(View.VISIBLE);
}
}).addOnFailureListener(TaskExecutors.uiThread(), new OnFailureListener() {
@Override
public void onFailure(Exception e) {
Log.e(TAG, "CODE SEND ERROR : " + e.getMessage());
// Error : code: 2 message: ONLY ONE String Field can be annotated as Url
}
}
});
// [END start_phone_auth]
}
App signing settings
Project settings
Thanks for all advice.
Try to add the following obfuscation scripts may solve your issue.