web-dev-qa-db-ja.com

グライドを解決できませんでした。サードパーティのGradleプラグインが原因の可能性があります

Android studio 3.0.1、ただしアップデート後Android studioで動けなくなる

構成「コンパイル」は廃止され、「実装」に置き換えられています。2018年の終わりに削除されます。解決に失敗しました:glide Open File Folder/home/lalit/repositories/Android/WaveDist/app/build/generated/source/kaptKotlin/debug Folder/home/lalit/repositories/Android/WaveDist/app/build/generated/source/kaptKotlin/releaseサードパーティのGradleプラグインが原因の可能性があります

私のグラドル依存

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.theartofdev.edmodo:Android-image-cropper:2.2.+'
    implementation 'com.github.wrdlbrnft:sorted-list-adapter:0.2.0.1'
    implementation 'com.Android.support:appcompat-v7:27.1.0'
    implementation 'com.Android.support:recyclerview-v7:27.1.0'
    implementation 'com.Android.support:cardview-v7:27.1.0'
    implementation 'com.Android.support:support-v4:27.1.0'
    implementation 'com.google.code.gson:gson:2.8.2'
    implementation 'com.squareup.retrofit2:retrofit:2.0.2'
    implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
    implementation 'com.Android.support:design:27.1.0'
    implementation 'com.Android.support:support-v13:27.1.0'
    implementation 'com.Android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.github.bumptech.glide:glide:4.6.1'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
    implementation 'com.google.firebase:firebase-core:12.0.0'
    implementation 'com.google.firebase:firebase-messaging:12.0.0'
    implementation 'com.google.Android.gms:play-services-analytics:12.0.0'
    implementation 'de.hdodenhof:circleimageview:2.1.0'
    implementation 'com.Android.support:support-vector-drawable:27.1.0'
    implementation 'com.Android.support:support-core-utils:27.1.0'
    testImplementation 'junit:junit:4.12'
    implementation 'Android.Arch.lifecycle:common-Java8:1.1.1'
    implementation 'Android.Arch.lifecycle:extensions:1.1.1'
    implementation 'Android.Arch.lifecycle:reactivestreams:1.1.1'
    implementation 'Android.Arch.persistence.room:runtime:1.0.0'
    kapt "Android.Arch.persistence.room:compiler:1.0.0"
    implementation 'com.google.firebase:firebase-auth:12.0.0'

    implementation 'com.google.Android.gms:play-services-maps:12.0.0'
    implementation 'com.google.firebase:firebase-database:12.0.0'
    implementation 'com.google.maps.Android:android-maps-utils:0.5'
    implementation 'com.google.Android.gms:play-services-location:12.0.0'
    implementation 'com.google.Android.gms:play-services-places:12.0.0'
    implementation 'com.google.Android.gms:play-services-base:12.0.0'

}

アプリレベルグラドル:

buildscript {
    ext.kotlin_version = '1.2.30'
    ext.roomVersion = '1.0.0'
    repositories {
        jcenter()
        maven { url 'https://maven.google.com' }
        google()
    }
    dependencies {
        classpath 'com.Android.tools.build:gradle:3.1.0'
        classpath 'com.google.gms:google-services:3.1.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 {
        jcenter()
        google()
    }
}

この問題を解決するにはどうすればよいですか?私を助けてください..

[〜#〜] edit [〜#〜]「glideの解決に失敗しました」を解決するmavenCentral()を追加しましたが、これで終了です。

Folder /home/lalit/repositories/Android/WaveDist/app/build/generated/source/kaptKotlin/debug


Folder /home/lalit/repositories/Android/WaveDist/app/build/generated/source/kaptKotlin/release


3rd-party Gradle plug-ins may be the cause

編集

私はdexModeを使用しているので、それを削除しました

 dexOptions {
        jumboMode true
    }

デフォルト設定にmultiDexEnabled trueを追加し、コンパイル時エラーを削除しました。

今、アプリケーションを実行しようとすると、長いエラーが表示されます...

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.Java:100)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.Java:70)
    at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.Java:51)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.Java:62)
    at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.Java:54)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.Java:60)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.Java:97)
    at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.Java:87)
    at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.Java:52)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.Java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.Java:54)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.Java:43)
    at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.Java:34)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.Java:248)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.Java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.Java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.Java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.Java:110)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.Java:241)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.Java:230)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.Java:123)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.Java:79)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.Java:104)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.Java:98)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.Java:626)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.Java:581)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.Java:98)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.Java:63)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.Java:46)
    at Java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.Java:1142)
    at Java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.Java:617)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.Java:55)
    at Java.lang.Thread.run(Thread.Java:745)
Caused by: Java.lang.RuntimeException: com.Android.build.api.transform.TransformException: com.Android.builder.dexing.DexArchiveBuilderException: com.Android.builder.dexing.DexArchiveBuilderException: Failed to process /home/lalit/.gradle/caches/modules-2/files-2.1/Android.Arch.lifecycle/common-Java8/1.1.1/795d68cd761d093ccb235d1d91b8fd17c2ae25ff/common-Java8-1.1.1.jar
    at com.Android.builder.profile.Recorder$Block.handleException(Recorder.Java:55)
    at com.Android.builder.profile.ThreadRecorder.record(ThreadRecorder.Java:104)
    at com.Android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.Java:212)
    at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at Sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.Java:62)
    at Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:43)
    at Java.lang.reflect.Method.invoke(Method.Java:498)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.Java:73)
    at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.Java:46)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.Java:39)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.Java:26)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.Java:121)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.Java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.Java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.Java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.Java:110)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.Java:110)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.Java:92)
    ... 32 more
Caused by: com.Android.build.api.transform.TransformException: com.Android.builder.dexing.DexArchiveBuilderException: com.Android.builder.dexing.DexArchiveBuilderException: Failed to process /home/lalit/.gradle/caches/modules-2/files-2.1/Android.Arch.lifecycle/common-Java8/1.1.1/795d68cd761d093ccb235d1d91b8fd17c2ae25ff/common-Java8-1.1.1.jar
    at com.Android.build.gradle.internal.transforms.DexArchiveBuilderTransform.transform(DexArchiveBuilderTransform.Java:327)
    at com.Android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.Java:221)
    at com.Android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.Java:217)
    at com.Android.builder.profile.ThreadRecorder.record(ThreadRecorder.Java:102)
    ... 48 more
Caused by: com.Android.builder.dexing.DexArchiveBuilderException: com.Android.builder.dexing.DexArchiveBuilderException: Failed to process /home/lalit/.gradle/caches/modules-2/files-2.1/Android.Arch.lifecycle/common-Java8/1.1.1/795d68cd761d093ccb235d1d91b8fd17c2ae25ff/common-Java8-1.1.1.jar
    at Sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at Sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.Java:62)
    at Sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.Java:45)
    at Java.lang.reflect.Constructor.newInstance(Constructor.Java:423)
    at Java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.Java:593)
    at Java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.Java:677)
    at Java.util.concurrent.ForkJoinTask.join(ForkJoinTask.Java:720)
    at com.Android.ide.common.internal.WaitableExecutor.waitForTasksWithQuickFail(WaitableExecutor.Java:146)
    at com.Android.build.gradle.internal.transforms.DexArchiveBuilderTransform.transform(DexArchiveBuilderTransform.Java:306)
    ... 51 more
Caused by: com.Android.builder.dexing.DexArchiveBuilderException: Failed to process /home/lalit/.gradle/caches/modules-2/files-2.1/Android.Arch.lifecycle/common-Java8/1.1.1/795d68cd761d093ccb235d1d91b8fd17c2ae25ff/common-Java8-1.1.1.jar
    at com.Android.build.gradle.internal.transforms.DexArchiveBuilderTransform.launchProcessing(DexArchiveBuilderTransform.Java:803)
    at com.Android.build.gradle.internal.transforms.DexArchiveBuilderTransform.lambda$convertToDexArchive$8(DexArchiveBuilderTransform.Java:728)
    at Java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.Java:1424)
    at Java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.Java:289)
    at Java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.Java:1056)
    at Java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.Java:1692)
    at Java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.Java:157)
Caused by: com.Android.builder.dexing.DexArchiveBuilderException: Error while dexing.
    at com.Android.builder.dexing.D8DexArchiveBuilder.getExceptionToRethrow(D8DexArchiveBuilder.Java:169)
    at com.Android.builder.dexing.D8DexArchiveBuilder.convert(D8DexArchiveBuilder.Java:146)
    at com.Android.build.gradle.internal.transforms.DexArchiveBuilderTransform.launchProcessing(DexArchiveBuilderTransform.Java:798)
    ... 6 more
Caused by: com.Android.tools.r8.CompilationFailedException: Compilation failed to complete
    at com.Android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.Java:76)
    at com.Android.tools.r8.utils.ExceptionUtils.withD8CompilationHandler(ExceptionUtils.Java:45)
    at com.Android.tools.r8.D8.run(D8.Java:88)
    at com.Android.builder.dexing.D8DexArchiveBuilder.convert(D8DexArchiveBuilder.Java:144)
    ... 7 more
Caused by: com.Android.tools.r8.utils.AbortException
    at com.Android.tools.r8.utils.Reporter.failIfPendingErrors(Reporter.Java:77)
    at com.Android.tools.r8.utils.Reporter.fatalError(Reporter.Java:67)
    at com.Android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.Java:62)
    ... 10 more
    Suppressed: com.Android.tools.r8.ApiLevelException: Default interface methods are only supported starting with Android N (--min-api 24): void Android.Arch.lifecycle.DefaultLifecycleObserver.onCreate(Android.Arch.lifecycle.LifecycleOwner)
        at com.Android.tools.r8.dex.FileWriter.checkInterfaceMethod(FileWriter.Java:247)
        at com.Android.tools.r8.dex.FileWriter.checkInterfaceMethods(FileWriter.Java:213)
        at com.Android.tools.r8.dex.FileWriter.generate(FileWriter.Java:140)
        at com.Android.tools.r8.dex.ApplicationWriter.writeDexFile(ApplicationWriter.Java:356)
        at com.Android.tools.r8.dex.ApplicationWriter.lambda$write$2(ApplicationWriter.Java:188)
        ... 5 more
8
Lalit Jadav

2回の編集の後、最後に、これを追加して問題を解決しました。

Android{
compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

およびGradleファイル

buildscript {
    ext.kotlin_version = '1.2.30'
    ext.roomVersion = '1.0.0'
    repositories {
        mavenCentral()
        jcenter()
        google()
        maven { url 'https://maven.google.com' }
    }
    dependencies {
        classpath 'com.Android.tools.build:gradle:3.1.0'
        classpath 'com.google.gms:google-services: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 {
        mavenCentral()
        jcenter()
        google()
    }
}

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

編集

これは、TaskExecutionExceptionhttps://stackoverflow.com/a/47387435/2809351

4
Lalit Jadav

Kotlin "1.2.31"のバージョンをアップグレードして、アプリレベルのgradleファイルにこの依存関係を追加します。

Android {
  ...

  sourceSets {
    main.Java.srcDirs += 'src/main/kotlin'
  }
}

dependencies {
    compile "org.jetbrains.kotlin:kotlin-stdlib"
}

プラグインの追加を忘れないでください:

プラグインの適用:「kotlin-Android」

ジェットブレインの古い依存関係を削除

実装「org.jetbrains.kotlin:kotlin-stdlib-jre7:$ kotlin_version」

それはあなたを助けます:)

4
Priya

このエラーは、gradleまたはAndroid studioを最新バージョンに更新するときに発生します。この問題の修正は次のとおりです。

プロジェクトのgradleファイルを確認してください。リポジトリにjcenterがある場合は、それを削除してプロジェクトをビルドします。プロジェクトgradleは次のようになります。

_allprojects {
repositories {
    google()
    mavenCentral()
}
_

}

エラーが再び発生した場合は、jcenter()を削除した後、リポジトリ内に_maven { url 'https://maven.google.com' }_を追加し、再度ビルドします。

これで問題が解決します。

1
Jerin A Mathews

この問題は以前にありましたが、解決しました。

(プロジェクトの)build.gradleの下に、次のものがあることを確認してください。

mavenCentral()
maven { url 'https://maven.google.com' }

両方のリポジトリにあります。

それを追加した後、まだエラーがありました。その場合は、jcenter()をコメントアウトしてください。

これはそれを機能させるための私のbuild.gradleです:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        //jcenter()
        mavenCentral()
        maven { url 'https://maven.google.com' }
    }
    dependencies {
        classpath 'com.Android.tools.build:gradle:3.1.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:3.1.0'
    }
}

allprojects {
    repositories {
        google()
        //jcenter()
        mavenCentral()
        maven { url 'https://maven.google.com' }
    }
}

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

それがあなたにとってもうまくいくかどうか教えてください。

0
H Wong