我尝试添加新的实现,以查看是否可以绕过此问题来构建gradle,但是它一直不起作用,只是一直告诉我这个问题。
[Fatal Error] core-1.0.0.pom:2:1: Content is not allowed in prolog.
[Fatal Error] vectordrawable-1.0.0.pom:2:1: Content is not allowed in prolog.
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:kaptDebugKotlin'.
> Could not resolve all task dependencies for configuration ':app:kapt'.
> Could not resolve androidx.core:core:1.0.0.
Required by:
project :app > com.github.bumptech.glide:glide:4.9.0 > androidx.fragment:fragment:1.0.0
project :app > com.github.bumptech.glide:glide:4.9.0 > androidx.fragment:fragment:1.0.0 > androidx.legacy:legacy-support-core-ui:1.0.0
project :app > com.github.bumptech.glide:glide:4.9.0 > androidx.fragment:fragment:1.0.0 > androidx.legacy:legacy-support-core-utils:1.0.0
project :app > com.github.bumptech.glide:glide:4.9.0 > androidx.fragment:fragment:1.0.0 > androidx.loader:loader:1.0.0
project :app > com.github.bumptech.glide:glide:4.9.0 > androidx.fragment:fragment:1.0.0 > androidx.legacy:legacy-support-core-ui:1.0.0 > androidx.customview:customview:1.0.0
project :app > com.github.bumptech.glide:glide:4.9.0 > androidx.fragment:fragment:1.0.0 > androidx.legacy:legacy-support-core-ui:1.0.0 > androidx.viewpager:viewpager:1.0.0
project :app > com.github.bumptech.glide:glide:4.9.0 > androidx.fragment:fragment:1.0.0 > androidx.legacy:legacy-support-core-ui:1.0.0 > androidx.coordinatorlayout:coordinatorlayout:1.0.0
project :app > com.github.bumptech.glide:glide:4.9.0 > androidx.fragment:fragment:1.0.0 > androidx.legacy:legacy-support-core-ui:1.0.0 > androidx.drawerlayout:drawerlayout:1.0.0
project :app > com.github.bumptech.glide:glide:4.9.0 > androidx.fragment:fragment:1.0.0 > androidx.legacy:legacy-support-core-ui:1.0.0 > androidx.slidingpanelayout:slidingpanelayout:1.0.0
project :app > com.github.bumptech.glide:glide:4.9.0 > androidx.fragment:fragment:1.0.0 > androidx.legacy:legacy-support-core-ui:1.0.0 > androidx.swiperefreshlayout:swiperefreshlayout:1.0.0
project :app > com.github.bumptech.glide:glide:4.9.0 > androidx.fragment:fragment:1.0.0 > androidx.legacy:legacy-support-core-ui:1.0.0 > androidx.asynclayoutinflater:asynclayoutinflater:1.0.0
> Could not resolve androidx.core:core:1.0.0.
> Could not parse POM https://dl.google.com/dl/android/maven2/androidx/core/core/1.0.0/core-1.0.0.pom
> Content is not allowed in prolog.
> Could not resolve androidx.vectordrawable:vectordrawable:1.0.0.
Required by:
project :app > com.github.bumptech.glide:glide:4.9.0 > androidx.vectordrawable:vectordrawable-animated:1.0.0
> Could not resolve androidx.vectordrawable:vectordrawable:1.0.0.
> Could not parse POM https://dl.google.com/dl/android/maven2/androidx/vectordrawable/vectordrawable/1.0.0/vectordrawable-1.0.0.pom
> Content is not allowed in prolog.
该模块的Gradle Build
Gradle build
清单
错误的屏幕截图
我用Kotlin
所以我设法使构建成功构建,我运行了模拟器以查看我的图片库是否正常工作,并且我明白了:
答案 0 :(得分:0)
您似乎在其中一个文件中具有传递依赖。您需要强制使用android.core.1.0.0
:
implementation('androidx.core:core:1.0.0') {
force = true
}
您可能还需要对vectorDrawable
做同样的事情:
implementation('androidx.vectordrawable:vectordrawable:1.0.0') {
force = true
}
您还应该在清单中添加<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
。