找不到以下匹配的构造函数:org.gradle.api.internal.artifacts.ivyservice.ivyresolve.VersionInfo(java.lang.String)

时间:2019-04-06 11:13:19

标签: java android gradle

我正在开发一个Android Studio项目,而今天,当我突然打开它时,这种情况就开始发生了。

Could not find matching constructor for: org.gradle.api.internal.artifacts.ivyservice.ivyresolve.VersionInfo(java.lang.String)

我已经尝试过更改gradle版本,但是没有任何效果。另外,我尝试了经典的“清理项目”,“重建项目”和“使缓存无效并重新启动”

gradle.properties

# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.or   g/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-XX\:MaxHeapSize\=512m -Xmx512m
# When configured, Gradle will  run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

应用级gradle

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.25.4'
    }



}
plugins {
    id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.7.0'
}
apply plugin: 'com.android.application'
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'kotlin-android'
apply plugin: 'io.fabric'

android {
    dataBinding {
        enabled = false
    }
    compileSdkVersion 28
    buildToolsVersion '28.0.3'
    defaultConfig {
        applicationId "com.virtualflight.VirtualHub"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 58
        versionName "4.0.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
        android {

            vectorDrawables.useSupportLibrary = true
            defaultConfig.applicationId="com.virtualflight.VirtualHub"
            defaultConfig {

                manifestPlaceholders = [onesignal_app_id: "977e8aef-4b31-4d36-91e4-2555572b9efe",
                                        // Project number pulled from dashboard, local value is ignored.
                                        onesignal_google_project_number: "REMOTE"]
            }
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        customDebugType {
            debuggable true
        }

    }
    productFlavors {
    }
    compileOptions {
        sourceCompatibility = '1.8'
        targetCompatibility = '1.8'
    }
}




repositories {
    mavenCentral()
    maven { url 'https://maven.fabric.io/public' }


}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.1-alpha01', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    //Google dependencies bellow
    implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.intuit.sdp:sdp-android:1.0.6'
    implementation 'com.sothree.slidinguppanel:library:3.4.0'


    testImplementation 'junit:junit:4.12'
    //Mapbox dependencies bellow
    implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:6.8.1'
    implementation 'com.mapbox.mapboxsdk:mapbox-android-services:2.1.0'
    implementation 'com.mapbox.mapboxsdk:mapbox-java-core:2.1.0'
    implementation 'com.mapbox.mapboxsdk:mapbox-java-services:2.1.0'
    implementation 'com.mapbox.mapboxsdk:mapbox-java-services-rx:2.1.0'
    implementation 'com.mapbox.mapboxsdk:mapbox-android-services:2.1.0'
    implementation 'com.mapbox.mapboxsdk:mapbox-android-telemetry:3.5.7'
    implementation 'com.mapbox.mapboxsdk:mapbox-android-ui:2.1.0'

    implementation('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
        transitive = true;
    }
    implementation files('libs/volley.jar')
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.github.barteksc:android-pdf-viewer:3.1.0-beta.1'
    implementation 'com.karumi:dexter:5.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.google.android.material:material:1.1.0-alpha04'
    implementation 'androidx.appcompat:appcompat:1.1.0-alpha02'

    implementation 'com.github.AppIntro:AppIntro:v5.1.0'
    implementation 'androidx.cardview:cardview:1.0.0'
}

项目级别gradle


buildscript {
    ext.kotlin_version = '1.2.51'
    repositories {
        jcenter()

        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}




allprojects {
    repositories {
        google()
        maven { url "https://jitpack.io" }
        jcenter()
        google()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

2 个答案:

答案 0 :(得分:0)

我意识到OneSignal是造成此问题的原因。我已经通过整体删除OneSignal来“解决”了这个问题,因为我不再使用它了。

答案 1 :(得分:-1)

将您的Gradle版本降级到4.9