Country Code Picker (CCP) is an android library which provides an easy way to search and select country or international phone code. Also supports Android EditText phone mask and international phone validation.
Apache License 2.0
1.52k
stars
505
forks
source link
NoSuchMethodError: No virtual method parseAndKeepRawInput #592
Significant crash had appeared after adding your library in my project:
Fatal Exception: java.lang.NoSuchMethodError: No virtual method parseAndKeepRawInput(Ljava/lang/String;Ljava/lang/String;)Lcom/google/i18n/phonenumbers/Phonenumber$PhoneNumber; in class Lcom/google/i18n/phonenumbers/PhoneNumberUtil; or its super classes (declaration of 'com.google.i18n.phonenumbers.PhoneNumberUtil' appears in base.apk!classes3.dex)
What is weird about it is that I am using PhoneInputLayout on totally different screen from where I am using your library.
On PhoneNumberFragmet:
phoneNumberButton.setOnClickListener(new OnOneClickListener() {
@Override
public void onOneClick(View v) {
String pattern = "^\\+[1-9]\\d{5,14}$";
if (phoneInputLayout.getPhoneNumber().matches(pattern)) { // <-------------
// doing something unrelated here
} else {
phoneInputLayout.setError(getActivity().getResources().getString(R.string.bad_phone_number_format_error));
}
}
});
and it seems problem is on phoneInputLayout.getPhoneNumber() since it is implemented as:
(getPhoneNumber() is calling the method above and it crashes on mPhoneUtil.parseAndKeepRawInput)
We did not do anything with PhoneNumberFragmet for ages and crash appears there after adding:
implementation 'com.hbb20:ccp:2.7.1'
My question is if I should exclude PhoneUtills from your library or put your library or PhoneUtils in proguard-rules.txt since it looks like my release build is missing PhoneUtils (?!) after adding your library to my code, or do anything else?
Significant crash had appeared after adding your library in my project:
What is weird about it is that I am using
PhoneInputLayout
on totally different screen from where I am using your library. OnPhoneNumberFragmet
:and it seems problem is on
phoneInputLayout.getPhoneNumber()
since it is implemented as:(
getPhoneNumber()
is calling the method above and it crashes onmPhoneUtil.parseAndKeepRawInput
)We did not do anything with
PhoneNumberFragmet
for ages and crash appears there after adding:My question is if I should exclude
PhoneUtills
from your library or put your library orPhoneUtils
inproguard-rules.txt
since it looks like my release build is missingPhoneUtils
(?!) after adding your library to my code, or do anything else?