skip to Main Content

I am adding an external library :-

implementation 'com.hbb20:ccp:X.Y.Z'

and I am adding this dependency to my build.gradle file in app module. After successfully syncing the project, when I add that particular dependency in my xml file, it is not working. I used the following code:-

<com.hbb20.CountryCodePicker
    android:id="@+id/ccp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

This is showing the following error:-

Class referenced in the layout file, com.hbb20.CountryCodePicker, was not found in the project or the libraries
Cannot resolve class com.hbb20.CountryCodePicker 

Also while calling the private Country Code in JAVA file, it is showing errors. What should I do?

2

Answers


  1. instead of X.Y.Z. you should put a version number like this

    implementation 'com.hbb20:ccp:2.5.4'
    
    Login or Signup to reply.
  2. The X.Y.Z should be a particular dependency version,
    the latest version I can see is 2.5.4, as mentioned on library’s repository.

    You should be adding the dependency like this:

    implementation 'com.hbb20:ccp:2.5.4'
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search