【发布时间】:2021-10-23 23:11:18
【问题描述】:
我正在添加一个外部库:-
implementation 'com.hbb20:ccp:X.Y.Z'
我正在将此依赖项添加到 app 模块中的 build.gradle 文件中。成功同步项目后,当我在我的 xml 文件中添加该特定依赖项时,它不起作用。我使用了以下代码:-
<com.hbb20.CountryCodePicker
android:id="@+id/ccp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
这显示以下错误:-
Class referenced in the layout file, com.hbb20.CountryCodePicker, was not found in the project or the libraries
Cannot resolve class com.hbb20.CountryCodePicker
在 JAVA 文件中调用私有国家代码时也显示错误。我该怎么办?
【问题讨论】:
标签: android android-studio gradle dependencies