将android gradle 3.0更新为5.1运行时出错

将android gradle 3.0更新为5.1运行时出错,android,gradle,android-gradle-plugin,Android,Gradle,Android Gradle Plugin,我正在尝试升级我的应用程序的gradle和库,出现如下运行时错误 FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':UIModule:compileDevDebugJavaWithJavac'. > Compilation failed; see the compiler error output for details. * Try: Run with --

我正在尝试升级我的应用程序的gradle和库,出现如下运行时错误

FAILURE: Build failed with an exception.

* What went wrong:
 Execution failed for task ':UIModule:compileDevDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
格拉德尔:-

buildscript {
repositories {`enter code here`
    mavenCentral()
    maven { url 'https://maven.fabric.io/public' }
    google()

}

dependencies {
    classpath 'com.android.tools.build:gradle:3.4.0'
    classpath 'io.fabric.tools:gradle:1.+'

   }
 }
    apply plugin: 'com.android.application'
       apply plugin: 'io.fabric'

 repositories {

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


 android {
flavorDimensions "default"
signingConfigs {
    config {
    }
}
compileSdkVersion 26
buildToolsVersion '26.0.1'
useLibrary 'org.apache.http.legacy'
defaultConfig {
    applicationId "com.kisan.samvaad"
    minSdkVersion 19
    targetSdkVersion 26
    versionCode 128
    versionName "1.32.20190424.00"
    multiDexEnabled true

    //giving support for ndk
    ndk {
        moduleName "webp"
    }
    //getting error some file crunching fail
    aaptOptions {
        cruncherEnabled = false
    }

}
buildTypes {
    debug {
        minifyEnabled false
        debuggable true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 
  'proguard-rules.pro'
    }
    release {
        minifyEnabled false
        multiDexEnabled true
        proguardFiles getDefaultProguardFile("proguard-android.txt"), 
  "proguard-rules.pro"
    }
}

defaultConfig{
    vectorDrawables.useSupportLibrary = true
}

ext {
    enableCrashlytics = true
}

packagingOptions {
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/NOTICE.txt'
}
repositories {
    maven { url 'http://leocad.io/mvn' }
    maven { url "https://jitpack.io" }
}

productFlavors {
    Dev {
        applicationIdSuffix ".dev"
    }

    Staging {
        applicationIdSuffix ".staging"
    }
    Prod {

    }
}
sourceSets { Prod { java.srcDirs = ['src/Prod/java', 'src/Prod/java/'] 
} }

sourceSets.main {
    jniLibs.srcDir 'libs'
    jni.srcDir s = [] //disable automatic ndk-build call
}
  }

 ext {
smackVersion = '4.2.3'
}
configurations {
all*.exclude group: 'xpp3', module: 'xpp3'
 }

 dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-
core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-
 annotations'
})
implementation files('libs/httpmime-4.2.5.jar')
implementation files('libs/aspectjrt-1.7.3 (1).jar')
implementation files('libs/isoparser-1.0.6.jar')
implementation 'com.android.support:cardview-v7:26.+'
implementation 'com.android.support:multidex:1.0.1'
implementation 'com.android.support:animated-vector-drawable:26.+'
implementation 'com.android.support:appcompat-v7:26.+'
implementation 'com.android.support:design:26.+'
implementation 'com.android.support:recyclerview-v7:26.+'
implementation 'com.android.support:exifinterface:26.+'
implementation 'com.google.code.gson:gson:2.4'
implementation 'com.nostra13.universalimageloader:universal-image-
 loader:1.9.5'
implementation 'com.github.ozodrukh:CircularReveal:1.1.0'
implementation 'com.miguelcatalan:materialsearchview:1.4.0'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.getbase:floatingactionbutton:1.10.1'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.2.1'
implementation 'com.google.android.gms:play-services:11.0.2'
implementation 'com.google.android.gms:play-services-maps:11.0.2'
implementation 'com.google.android.gms:play-services-location:11.0.2'
implementation 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
implementation 'io.jsonwebtoken:jjwt:0.6.0'
implementation 'com.android.support.constraint:constraint-
 layout:1.0.2'
implementation 'junit:junit:4.12'
implementation 'com.facebook.android:account-kit-sdk:4.27.0'
implementation 'org.ocpsoft.prettytime:prettytime:4.0.1.Final'
implementation 'me.dm7.barcodescanner:zxing:1.9'
implementation('org.igniterealtime.smack:smack-android-
 extensions:4.1.7') {
    exclude module: 'smack-omemo'
    exclude module: 'smack-omemo-signal'
  }

implementation "org.igniterealtime.smack:smack-tcp:$smackVersion"
implementation "org.igniterealtime.smack:smack-
experimental:$smackVersion"
implementation("org.igniterealtime.smack:smack-android:$smackVersion") 
{
    exclude module: 'smack-omemo'
    exclude module: 'smack-omemo-signal'
}
implementation "org.igniterealtime.smack:smack-im:$smackVersion"
implementation "org.igniterealtime.smack:smack-legacy:$smackVersion"
implementation 'com.android.support:multidex:1.0.1'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
testImplementation 'junit:junit:4.12'
implementation project(':BusinessLogicModule')
implementation project(':sdkui')
ext.enableCrashlytics = true
implementation files('libs/YouTubeAndroidPlayerApi.jar')
}


 apply plugin: 'com.google.gms.google-services'

考虑到编译错误,您很可能遇到这样的更改:Gradle 5.x将不再将Maven元数据中声明为
runtime
的依赖项放在编译类路径上。请看一看这方面的最新进展

调试这个的最简单方法是运行:
/gradlew:UIModule:dependencies--configuration
,其中
被替换为正确的名称,我不知道。如果没有可用的信息,只需在不使用
--configuration
参数的情况下运行任务即可。 在新旧Gradle版本中运行此功能将允许找出差异,并通过在有意义的地方添加缺少的依赖项来解决它


请注意,从3.x跳到5.x也可能会迫使您执行进一步的更新。

鉴于编译错误,您很可能遇到这样的更改,即Gradle 5.x将不再将Maven元数据中声明为
运行时的依赖项放在编译类路径上。请看一看这方面的最新进展

调试这个的最简单方法是运行:
/gradlew:UIModule:dependencies--configuration
,其中
被替换为正确的名称,我不知道。如果没有可用的信息,只需在不使用
--configuration
参数的情况下运行任务即可。 在新旧Gradle版本中运行此功能将允许找出差异,并通过在有意义的地方添加缺少的依赖项来解决它


请注意,从3.x跳转到5.x也可能会迫使您执行进一步的更新。

只需从项目文件夹中删除
.iml
,然后尝试重建项目只需从项目文件夹中删除
.iml
,然后尝试重建项目