我一直在尝试使用AndroidX构建一个Android项目。但是,每次尝试构建项目时,我总是会遇到此错误:
:AndroidProjectCompanyX:compileFastdevDebugKotlin失败
e:无法解析以下类的超类型。请确保您在类路径中具有必需的依赖项:
net.quikkly.android.ui.RenderTagView类,未解析的超类型:android.support.v7.widget.AppCompatImageView
或
:base:compileFastdevDebugJavaWithJavac FAILED / Users / asantoso / code / android-clean-test / base / src / main / java / com / AndroidProjectCompanyX / social / FacebookManager.java:160:错误:无法访问片段LoginManager.getInstance( ).logInWithReadPermissions(_activity,权限); ^找不到用于android.support.v4.app.Fragment的类文件注意:某些输入文件使用或覆盖不推荐使用的API注意:请使用-Xlint:deprecation重新编译以获取详细信息注意:某些输入文件使用未经检查或不安全的操作注意:用-Xlint重新编译:未检查详细信息。1错误
此错误在以前的版本(AndroidX之前的版本)中永远不会发生。
似乎库已被正确地删除。运行find ~/.gradle -name "*jetified*"
将返回:
/Users/asantoso/.gradle/caches/transforms-2/files-2.1/d1a27947dbcec2f27c49055031793d0b/jetified-facebook-core-5.15.3-runtime
/Users/asantoso/.gradle/caches/transforms-2/files-2.1/aef02d212efb1a7cf96c2ebc4288fa39/jetified-quikkly-lib-3.4.18-runtime.jar
/Users/asantoso/.gradle/caches/transforms-2/files-2.1/2e4cf1a28c0314da3f42ebaf7517f061/jetified-quikkly-lib-3.4.18-runtime
/Users/asantoso/.gradle/caches/transforms-2/files-2.1/3af0a63073167b9a5ac74bf5402bdd29/jetified-appcompat-resources-1.1.0-runtime.jar
/Users/asantoso/.gradle/caches/transforms-2/files-2.1/aeed5b68ed0bfa7c1ab905b4c5bc1bc2/jetified-bolts-applinks-1.4.0
/Users/asantoso/.gradle/caches/transforms-2/files-2.1/239bc1925c79a0fc4124c017b931bc39/jetified-kotlin-stdlib-jdk7-1.3.72
我也尝试过在计算机上恢复出厂设置并从头开始安装所有组件,但问题仍然存在。
有人知道如何解决吗?谢谢!
gradle.properties
org.gradle.jvmargs=-Xmx3g -Dkotlin.daemon.jvm.options=-Xmx3g -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.caching=true
kapt.useBuildCache=false
kapt.use.worker.api=false
kapt.incremental.apt=false
android.useAndroidX=true
android.enableJetifier=true
android.jetifier.blacklist=byte-buddy,assertj-core,guava,maven-ant-tasks,wagon-http-lightweight,mockwebserver,org.jbundle.util.osgi.wrapped.org.apache.http.client,ant,protobuf-java,stetho,stetho-okhttp3
# Workaround for a runtime crash https://issuetracker.google.com/issues/152077756
android.generateRJava=true
android.enableUnitTestBinaryResources=true