没有进行任何代码更改的Android Studio的Gradle构建失败 [英] Gradle build failing for Android Studio without any code changes
问题描述
我面临一个奇怪的问题.几天前,相同的代码库正在运行,但今天却出现以下错误.
I am facing a strange issue. The same code base was working few days ago but today breaking with below error.
Could not find matching constructor for: org.gradle.api.internal.artifacts.ivyservice.ivyresolve.VersionInfo(String)
我无法找到此错误背后的原因.你们当中的任何一个都可以帮上忙.
I am not able to find the reason behind this error. It would be really helpful if any of you can help.
请在下面找到必填信息.
Please find below are the required informations.
依赖项:
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation "com.android.support:appcompat-v7:${rootProject.ext.appCompatVersion}"
implementation "com.crashlytics.sdk.android:crashlytics:${rootProject.ext.crashlyticsVersion}"
implementation "com.android.support:design:${rootProject.ext.appCompatVersion}"
implementation "com.android.support.constraint:constraint-layout:${rootProject.ext.constraintLayoutVersion}"
implementation "com.android.support:recyclerview-v7:${rootProject.ext.appCompatVersion}"
implementation "com.android.support:cardview-v7:${rootProject.ext.appCompatVersion}"
implementation "com.onesignal:OneSignal:${rootProject.ext.onesignalVersion}"
implementation "com.flaviofaria:kenburnsview:${rootProject.ext.kenburnsViewVersion}"
implementation "com.firebase:firebase-jobdispatcher:${rootProject.ext.firebaseJobDispatcherVersion}"
implementation "com.github.bumptech.glide:glide:${rootProject.ext.glideVersion}"
//google admob
implementation 'com.google.android.gms:play-services-ads:18.0.0'
implementation 'com.google.firebase:firebase-messaging:+'
implementation 'com.android.billingclient:billing:1.1'
implementation "android.arch.persistence.room:runtime:${rootProject.ext.room_version}"
annotationProcessor "android.arch.persistence.room:compiler:${rootProject.ext.room_version}"
implementation "android.arch.lifecycle:livedata:${rootProject.ext.lifecycle_version}"
annotationProcessor "android.arch.lifecycle:compiler:${rootProject.ext.lifecycle_version}"
//below is for app tutor view
implementation "com.github.amlcurran.showcaseview:library:${rootProject.ext.showcaseViewVersion}"
//below two dependencies are for circular image transformation to gif by glide
implementation "jp.wasabeef:glide-transformations:${rootProject.ext.glideTransformationsVersion}"
implementation 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.4.1'
//below dependency is for bookmark star animation
implementation "com.github.varunest:sparkbutton:${rootProject.ext.sparkButtonVersion}"
//below dependency is for button with validation animation
implementation "com.unstoppable:submitbutton:${rootProject.ext.submitButtonVersion}"
//dependency for firebase auth
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.api-client:google-api-client:1.22.0'
implementation 'com.google.api-client:google-api-client-android:1.22.0'
implementation 'com.google.apis:google-api-services-people:v1-rev4-1.22.0'
implementation 'com.google.android.gms:play-services-auth:16.0.0'
//dependency for firebase db
implementation 'com.google.firebase:firebase-database:16.0.2'
//for signin button google custom
implementation "com.shobhitpuri.custombuttons:google-signin:${rootProject.ext.googleSigninButtonVersion}"
//youtube
implementation files('libs/YouTubeAndroidPlayerApi.jar')
//support
implementation "com.android.support:design:${rootProject.ext.appCompatVersion}"
//webview
implementation "com.thefinestartist:finestwebview:${rootProject.ext.fineWebviewVersion}"
//speech to text module
implementation project(path: ':speech-to-text', configuration: 'default')
//viewmodel and livedata
implementation "android.arch.lifecycle:extensions:${rootProject.ext.lifecycle_version}"
androidTestImplementation 'junit:junit:4.12'
//memory leaks detection
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.3'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.3'
// Optional, if you use support library fragments:
debugImplementation 'com.squareup.leakcanary:leakcanary-support-fragment:1.6.3'
implementation 'com.android.support:multidex:1.0.3'
//lottie
implementation 'com.airbnb.android:lottie:2.5.0'
}
版本:
ext {
compileSdkVersion=28
minSdkVersion=19
targetSdkVersion=28
materialDesignVersion='1.0.0'
appCompatVersion='28.0.0'
crashlyticsVersion='2.9.9'
constraintLayoutVersion='1.1.3'
onesignalVersion='3.9.1'
glideVersion='4.9.0'
firebaseJobDispatcherVersion='0.8.5'
kenburnsViewVersion='1.0.6'
room_version='1.1.1'
lifecycle_version='1.1.1'
fineWebviewVersion='1.2.7'
showcaseViewVersion='5.4.3'
glideTransformationsVersion='3.3.0'
sparkButtonVersion='1.0.5'
submitButtonVersion='1.1.3'
googleSigninButtonVersion='1.0.0'
lifecycle_version="1.1.1"
}
我正在使用3.4.1的Gradle版本 我尝试清理项目,重建项目,使缓存无效并重新启动.没有任何帮助.
I am using Gradle version of 3.4.1 I tried clean project, rebuild project, invalidate cache and restart. None of it helped.
PS:我研究了已经这个问题,我正在使用OneSignal,我需要它.
P.S: I have looked into this question already and I am using OneSignal and I need it.
推荐答案
OneSignal
插件似乎正在使用内部gradle API(VersionInfo在org.gradle.api.internal包下).与公共Gradle API不同,Gradle团队可以在不发出警告的情况下更改内部API,并且不能保证它们在Gradle版本之间不会有重大变化.
It seems that OneSignal
plugin is using internal gradle APIs (VersionInfo is under the org.gradle.api.internal package). Unlike the public Gradle APIs, the Gradle team can change internal APIs without warning and make no guarantees that they won't have breaking changes between Gradle versions.
也许您使用的是OneSignal
插件的旧版本,而现在您的较新版本的Gradle不再使用该插件.也许会有更新版本的插件可以正常工作?
Perhaps you're on an old version of the OneSignal
plugin which is now broken with your newer version of Gradle. Perhaps there's a newer version of the plugin which will work?
无法跟踪插件作者并向项目提交错误,或者提交带有修复的请求
Failing that you could track down the plugin author and submit a bug to the project, or perhaps submit a pull request with a fix
这篇关于没有进行任何代码更改的Android Studio的Gradle构建失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!