Après avoir activé la liaison de données en ajoutant ce qui suit au fichier build.gradle dans le module d'application:
ext { versions = [ // For project configuration java : JavaVersion.VERSION_1_8, compileSdk : 28, targetSdk : 28, minSdk : 21, buildTools : '28.0.3', dokka : '0.9.16', // For app kotlin : '1.2.71', coroutine : '0.25.0', appCompat : '1.0.0', recyclerview : '1.0.0', constraintLayout : '2.0.0-alpha2', cardview : '1.0.0', browser : '1.0.0', androidKtx : '1.0.0', legacy : '1.0.0', workmanager : '1.0.0-alpha09', dagger : '2.20', firebaseCloudMessage : '17.3.0', firebaseAnalytics : '16.0.3', playServices : '16.0.0', exoPlayer : '2.8.2', flexbox : '1.1.0', material : '1.0.0-beta01', room : '2.0.0', lifecycle : '2.0.0', livedataKtx : '2.0.1', rxKotlin : '2.3.0', rxAndroid : '2.1.0', moshi : '1.6.0', okhttp : '3.11.0', timber : '4.7.1', threeTenABP : '1.1.0', rxBinding : '2.1.1', fresco : '1.10.0', kotshi : '1.0.4', frescoImageViewer : '0.5.1', markwon : '2.0.0', aVLoadingIndicatorView: '2.1.3', glide : '4.8.0', // For wearable wear : '2.3.0', playServicesWearable : '15.0.1', supportWearable : '27.1.1', // For testing junit : '4.12', truth : '0.42', espresso : '3.1.0-alpha4', mockito : '2.21.0' ] libraries = [ kotlin : "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${versions.kotlin}", coroutines : "org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions.coroutine}", coroutinesAndroid : "org.jetbrains.kotlinx:kotlinx-coroutines-android:${versions.coroutine}", appCompat : "androidx.appcompat:appcompat:${versions.appCompat}", recyclerview : "androidx.recyclerview:recyclerview:${versions.recyclerview}", constraintlayout : "androidx.constraintlayout:constraintlayout:${versions.constraintLayout}", cardview : "androidx.cardview:cardview:${versions.cardview}", browser : "androidx.browser:browser:${versions.browser}", androidKtx : "androidx.core:core-ktx:${versions.androidKtx}", fragmentsKtx : "androidx.fragment:fragment-ktx:${versions.androidKtx}", legacy : "androidx.legacy:legacy-support-v4:${versions.legacy}", workmanager : "android.arch.work:work-runtime-ktx:${versions.workmanager}", workmanagerFirebase : "android.arch.work:work-firebase:${versions.workmanager}", dagger : "com.google.dagger:dagger:${versions.dagger}", daggerSupport : "com.google.dagger:dagger-android-support:${versions.dagger}", daggerProcessor : "com.google.dagger:dagger-compiler:${versions.dagger}", daggerAndroidApt : "com.google.dagger:dagger-android-processor:${versions.dagger}", exoPlayer : "com.google.android.exoplayer:exoplayer:${versions.exoPlayer}", flexbox : "com.google.android:flexbox:${versions.flexbox}", material : "com.google.android.material:material:${versions.material}", room : "androidx.room:room-runtime:${versions.room}", roomProcessor : "androidx.room:room-compiler:${versions.room}", lifecycleExtensions : "androidx.lifecycle:lifecycle-extensions:${versions.lifecycle}", lifecycleCompiler : "androidx.lifecycle:lifecycle-compiler:${versions.lifecycle}", viewmodelKtx : "androidx.lifecycle:lifecycle-viewmodel-ktx:${versions.lifecycle}", livedataKtx : "com.shopify:livedata-ktx:${versions.livedataKtx}", rxKotlin : "io.reactivex.rxjava2:rxkotlin:${versions.rxKotlin}", rxAndroid : "io.reactivex.rxjava2:rxandroid:${versions.rxAndroid}", moshi : "com.squareup.moshi:moshi:${versions.moshi}", moshiKotlin : "com.squareup.moshi:moshi-kotlin:${versions.moshi}", okhttp : "com.squareup.okhttp3:okhttp:${versions.okhttp}", okhttpLogger : "com.squareup.okhttp3:logging-interceptor:${versions.okhttp}", timber : "com.jakewharton.timber:timber:${versions.timber}", threeTenABP : "com.jakewharton.threetenabp:threetenabp:${versions.threeTenABP}", rxBinding : "com.jakewharton.rxbinding2:rxbinding-kotlin:${versions.rxBinding}", fresco : "com.facebook.fresco:fresco:${versions.fresco}", frescoOkHttp : "com.facebook.fresco:imagepipeline-okhttp3:${versions.fresco}", frescoAnimatedGif : "com.facebook.fresco:animated-gif:${versions.fresco}", frescoWebP : "com.facebook.fresco:webpsupport:${versions.fresco}", frescoAnimatedWebP : "com.facebook.fresco:animated-webp:${versions.fresco}", kotshiApi : "se.ansman.kotshi:api:${versions.kotshi}", kotshiCompiler : "se.ansman.kotshi:compiler:${versions.kotshi}", frescoImageViewer : "com.github.luciofm:FrescoImageViewer:${versions.frescoImageViewer}", glide : "com.github.bumptech.glide:glide:${versions.glide}", glideProcessor : "com.github.bumptech.glide:compiler:${versions.glide}", markwon : "ru.noties:markwon:${versions.markwon}", aVLoadingIndicatorView: "com.wang.avi:library:${versions.aVLoadingIndicatorView}", // Proprietary libraries fcm : "com.google.firebase:firebase-messaging:${versions.firebaseCloudMessage}", firebaseAnalytics : "com.google.firebase:firebase-core:${versions.firebaseAnalytics}", playServicesAuth : "com.google.android.gms:play-services-auth:${versions.playServices}", // For wearable wearable : "com.google.android.support:wearable:${versions.wear}", playServicesWearable : "com.google.android.gms:play-services-wearable:${versions.playServicesWearable}", percentLayout : "com.android.support:percent:${versions.supportWearable}", supportWearable : "com.android.support:support-v4:${versions.supportWearable}", wearableRecyclerView : "com.android.support:recyclerview-v7:${versions.supportWearable}", wearSupport : "com.android.support:wear:${versions.supportWearable}", // For testing junit : "junit:junit:${versions.junit}", espressoCore : "androidx.test.espresso:espresso-core:${versions.espresso}", espressoIntents : "androidx.test.espresso:espresso-intents:${versions.espresso}", roomTest : "android.arch.persistence.room:testing:${versions.room}", truth : "com.google.truth:truth:${versions.truth}" ] }
Je vois cette erreur lors de la création de mon application:
L'artefact donné contient une chaîne littérale avec une référence de package 'android / support / v4' qui ne peut pas être réécrite en toute sécurité. Les bibliothèques utilisant la réflexion, telles que les processeurs d'annotations, doivent être mises à jour manuellement pour ajouter la prise en charge d'Androidx.
J'ai parcouru Internet pour résoudre le problème mais pas de chance.
Journal plus détaillé:
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { apply from: rootProject.file('dependencies.gradle') repositories { google() jcenter() maven { url 'https://maven.fabric.io/public' } mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:3.2.1' classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta02' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}" classpath "org.jetbrains.dokka:dokka-gradle-plugin:${versions.dokka}" classpath 'com.google.gms:google-services:4.2.0' classpath 'io.fabric.tools:gradle:1.27.0' classpath "com.github.ben-manes:gradle-versions-plugin:0.20.0" } } allprojects { repositories { google() jcenter() maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } maven { url "https://jitpack.io" } } apply from: rootProject.file('dependencies.gradle') } task clean(type: Delete) { delete rootProject.buildDir }
fichier build.gradle:
org.gradle.execution.MultipleBuildFailures: Build completed with 1 failures. at org.gradle.initialization.DefaultGradleLauncher$ExecuteTasks.run(DefaultGradleLauncher.java:358) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) at org.gradle.initialization.DefaultGradleLauncher.runTasks(DefaultGradleLauncher.java:219) at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:149) at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:124) at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:77) at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:74) at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:154) at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:38) at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:96) at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:74) at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:55) at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32) at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.run(RunAsBuildOperationBuildActionRunner.java:50) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:45) at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51) at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:47) at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:44) at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:79) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:44) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30) at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39) at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25) at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80) at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53) at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:62) at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:34) at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36) at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25) at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43) at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29) at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:59) at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:31) at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59) at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44) at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:46) at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30) at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74) at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72) at org.gradle.util.Swapper.swap(Swapper.java:38) at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:81) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50) at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295) 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: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:kaptGenerateStubsFossDebugKotlin'. at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:49) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101) at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44) at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91) at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59) 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.api.internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:51) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46) at org.gradle.execution.taskgraph.LocalTaskInfoExecutor.execute(LocalTaskInfoExecutor.java:42) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:277) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:262) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:135) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:130) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.execute(DefaultTaskPlanExecutor.java:200) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.executeWithWork(DefaultTaskPlanExecutor.java:191) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.run(DefaultTaskPlanExecutor.java:130) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:74) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph.execute(DefaultTaskExecutionGraph.java:143) at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:40) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:40) at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:24) at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:46) at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:49) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:40) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:33) at org.gradle.initialization.DefaultGradleLauncher$ExecuteTasks.run(DefaultGradleLauncher.java:355) ... 77 more Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:kapt'. at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.rethrowFailure(DefaultConfiguration.java:1054) at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$1700(DefaultConfiguration.java:123) at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:1028) at org.gradle.api.internal.file.AbstractFileCollection.iterator(AbstractFileCollection.java:76) at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.iterator(DefaultConfiguration.java:439) at org.gradle.api.internal.file.CompositeFileCollection.iterator(CompositeFileCollection.java:65) at org.jetbrains.kotlin.gradle.internal.SubpluginUtilsKt$withWrappedKaptOptions$1.apply(subpluginUtils.kt:71) at org.jetbrains.kotlin.gradle.internal.SubpluginUtilsKt$withWrappedKaptOptions$1.apply(subpluginUtils.kt) at java.util.HashMap.compute(HashMap.java:1196) at org.jetbrains.kotlin.gradle.internal.SubpluginUtilsKt.withWrappedKaptOptions(subpluginUtils.kt:50) at org.jetbrains.kotlin.gradle.internal.KaptGenerateStubsTask.setupCompilerArgs(KaptGenerateStubsTask.kt:73) at org.jetbrains.kotlin.gradle.internal.KaptGenerateStubsTask.setupCompilerArgs(KaptGenerateStubsTask.kt:36) at org.jetbrains.kotlin.gradle.internal.CompilerArgumentAware$DefaultImpls.setupCompilerArgs$default(CompilerArgumentAware.kt:37) at org.jetbrains.kotlin.gradle.internal.CompilerArgumentAwareKt.prepareCompilerArguments(CompilerArgumentAware.kt:41) at org.jetbrains.kotlin.gradle.internal.CompilerArgumentAware$DefaultImpls.getFilteredArgumentsMap(CompilerArgumentAware.kt:34) at org.jetbrains.kotlin.gradle.internal.CompilerArgumentAwareWithInput$DefaultImpls.getFilteredArgumentsMap(CompilerArgumentAware.kt:54) at org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompileTool.getFilteredArgumentsMap(Tasks.kt:49) at org.jetbrains.kotlin.gradle.internal.KaptGenerateStubsTask_Decorated.getFilteredArgumentsMap(Unknown Source) at sun.reflect.GeneratedMethodAccessor1732.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.gradle.api.internal.tasks.properties.bean.AbstractNestedRuntimeBeanNode$DefaultPropertyValue$1$1.create(AbstractNestedRuntimeBeanNode.java:83) at org.gradle.util.SingleMessageLogger.whileDisabled(SingleMessageLogger.java:313) at org.gradle.api.internal.tasks.properties.bean.AbstractNestedRuntimeBeanNode$DefaultPropertyValue$1.get(AbstractNestedRuntimeBeanNode.java:80) at com.google.common.base.Suppliers$MemoizingSupplier.get(Suppliers.java:125) at org.gradle.api.internal.tasks.properties.bean.AbstractNestedRuntimeBeanNode$DefaultPropertyValue.getValue(AbstractNestedRuntimeBeanNode.java:138) at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:1025) ... 137 more Caused by: java.lang.RuntimeException: Failed to transform '/home/utkarsh/.gradle/caches/modules-2/files-2.1/com.android.tools.build.jetifier/jetifier-core/1.0.0-alpha10/9eb7027c383061de12f93aae7a22cbeb97832d2a/jetifier-core-1.0.0-alpha10.jar' using Jetifier. Reason: The given artifact contains a string literal with a package reference 'android/support/v4' that cannot be safely rewritten. Libraries using reflection such as annotation processors need to be updated manually to add support for androidx.. (Run with --stacktrace for more details.) To disable Jetifier, set android.enableJetifier=false in your gradle.properties file. at com.android.build.gradle.internal.dependency.JetifyTransform.transform(JetifyTransform.kt:204) at org.gradle.api.internal.artifacts.transform.TransformArtifactsAction.apply(TransformArtifactsAction.java:44) at org.gradle.api.internal.artifacts.transform.TransformArtifactsAction.apply(TransformArtifactsAction.java:29) at org.gradle.api.internal.artifacts.transform.DefaultTransformedFileCache$TransformAction.execute(DefaultTransformedFileCache.java:251) at org.gradle.api.internal.artifacts.transform.DefaultTransformedFileCache$TransformAction.execute(DefaultTransformedFileCache.java:238) at com.android.tools.build.jetifier.processor.transform.bytecode.asm.CustomRemapper.mapValue(CustomRemapper.kt:75) at org.objectweb.asm.commons.MethodRemapper.visitLdcInsn(MethodRemapper.java:179) at org.objectweb.asm.ClassReader.readCode(ClassReader.java:1582) at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1126) at org.objectweb.asm.ClassReader.accept(ClassReader.java:698) at org.objectweb.asm.ClassReader.accept(ClassReader.java:500) at com.android.tools.build.jetifier.processor.transform.bytecode.ByteCodeTransformer.runTransform(ByteCodeTransformer.kt:39) at com.android.tools.build.jetifier.processor.Processor.visit(Processor.kt:366) at com.android.tools.build.jetifier.processor.archive.ArchiveFile.accept(ArchiveFile.kt:41) at com.android.tools.build.jetifier.processor.Processor.visit(Processor.kt:348) at com.android.tools.build.jetifier.processor.archive.Archive.accept(Archive.kt:70) at com.android.tools.build.jetifier.processor.Processor.transformLibrary(Processor.kt:344) at com.android.tools.build.jetifier.processor.Processor.transform(Processor.kt:207) at com.android.build.gradle.internal.dependency.JetifyTransform.transform(JetifyTransform.kt:199) ... 189 more
fichier dependencies.gradle:
android { ... dataBinding { enabled = true } }
3 Réponses :
cela n'a rien à voir avec la bibliothèque de liaison de données, mais avec la migration Jetifier pour androidx
:
L'artefact donné contient une chaîne littérale avec une référence de package 'android / support / v4' qui ne peut pas être réécrite en toute sécurité. Les bibliothèques utilisant la réflexion, telles que les processeurs d'annotations, doivent être mises à jour manuellement pour ajouter la prise en charge d'Androidx .
... c'est ce dont se plaint com.android.tools.build.jetifier.processor
.
la classe correspondante serait: androidx.legacy:legacy-support-v4:1.0.0
.
Merci d'avoir essayé d'aider et désolé, je suis assez nouveau sur Android et je ne savais pas que l'erreur n'avait rien à voir avec la bibliothèque de liaison de données. De plus, l'erreur se produit uniquement lors de l'ajout de dataBinding { enabled = true }
J'ai modifié ma question et mon titre et ajouté tous les fichiers nécessaires. Malheureusement, l'ajout de androidx.legacy:legacy-support-v4:1.0.0
ne résout pas le problème.
@UtkarshBarsaiyan supprime le chemin de classe classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta02'
car il semble que le jetifier tente de lancer son propre processeur d'annotation (dupliquer). le réglage android.enableJetifier=true
suffit pour l'utiliser.
Merci! Tu es un sauveur!
Salut, j'ai eu un problème similaire.
Message d'erreur -
L'artefact donné contient une chaîne littérale avec une référence de package «android.support.design.widget» qui ne peut pas être réécrite en toute sécurité. Les bibliothèques utilisant la réflexion, telles que les processeurs d'annotations, doivent être mises à jour manuellement pour ajouter la prise en charge d'Androidx.
J'ai compris que la dépendance args sûre causait cette erreur.
implémentation "android.arch.navigation: navigation-safe-args-gradle-plugin: $ version_navigation"
Si je supprime cette construction de projet de dépendance avec succès. Vous pouvez essayer de rétrograder la version de dépendance que j'utilise '1.0.0'
J'ai sauvé ma journée! Merci! ce n'est pas la première fois que j'ai des problèmes avec les arguments sécurisés
@dnhyde Bienvenue! Oui, il y a encore des problèmes avec les safe-args.
Cela peut également être causé par l'ajout de safeargs en tant que dépendance de bibliothèque, plutôt qu'en tant que plugin Gradle.
Faux:
implementation "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
dans les dépendances de build.gradle
niveau de votre module.
Droite:
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
dans les dépendances de build.gradle
niveau de votre projet (ainsi que pour apply plugin: "androidx.navigation.safeargs"
).
Source: https://developer.android.com/guide/navigation/navigation-pass-data#Safe-args
pourquoi vous n'avez pas ajouté tout le
build.gradle
... en particulier lesdependencies
?@MartinZeitler Ajout du fichier build.gradle