I want to upgrade my project gradle version from 6.1.1 to 7.0.0 and above, but when I upgrade anything above 6.9 I get errors and cannot find the problem.
Them message it gives me is this:
> Configure project :core
publishNonDefault is deprecated and has no effect anymore. All variants are now published.
> Configure project {name}
Warning: The 'kotlin-android-extensions' Gradle plugin is deprecated. Please use this migration guide (https://goo.gle/kotlin-android-extensions-deprecation) to start working with View Binding (https://developer.android.com/topic/libraries/view-binding) and the 'kotlin-parcelize' plugin.
WARNING: DSL element 'android.dataBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.dataBinding'.
It will be removed in version 5.0 of the Android Gradle plugin.
> Task :core:preBuild UP-TO-DATE
> Task :core:preDebugBuild UP-TO-DATE
> Task :core:compileDebugAidl NO-SOURCE
> Task :core:compileDebugRenderscript NO-SOURCE
> Task :core:generateDebugBuildConfig UP-TO-DATE
> Task :core:generateDebugResValues UP-TO-DATE
> Task :core:generateDebugResources UP-TO-DATE
> Task :core:packageDebugResources UP-TO-DATE
> Task :core:parseDebugLocalResources UP-TO-DATE
> Task :core:processDebugManifest UP-TO-DATE
> Task :core:generateDebugRFile UP-TO-DATE
> Task :core:kaptGenerateStubsDebugKotlin UP-TO-DATE
> Task :core:kaptDebugKotlin UP-TO-DATE
> Task :core:compileDebugKotlin UP-TO-DATE
> Task :core:javaPreCompileDebug UP-TO-DATE
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':core:compileDebugJavaWithJavac'.
> Failed to query the value of task ':core:compileDebugJavaWithJavac' property 'options.generatedSourceOutputDirectory'.
> Querying the mapped value of map(java.io.File property(org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, {direcory}
org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer#cea20b4) before task ':core:compileDebugJavaWithJavac' has completed is not supported
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':core:compileDebugJavaWithJavac'.
at org.gradle.api.internal.tasks.properties.DefaultTaskProperties.resolve(DefaultTaskProperties.java:74)
at org.gradle.execution.plan.LocalTaskNode.resolveMutations(LocalTaskNode.java:202)
at org.gradle.execution.plan.DefaultExecutionPlan.getResolvedMutationInfo(DefaultExecutionPlan.java:654)
at org.gradle.execution.plan.DefaultExecutionPlan.selectNext(DefaultExecutionPlan.java:577)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$executeNextNode$1(DefaultPlanExecutor.java:166)
at org.gradle.internal.resources.DefaultResourceLockCoordinationService.withStateLock(DefaultResourceLockCoordinationService.java:45)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:155)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: org.gradle.api.internal.provider.AbstractProperty$PropertyQueryException: Failed to query the value of task ':core:compileDebugJavaWithJavac' property 'options.generatedSourceOutputDirectory'.
at org.gradle.api.internal.provider.AbstractProperty.doCalculateValue(AbstractProperty.java:136)
at org.gradle.api.internal.provider.AbstractProperty.calculateOwnValueNoProducer(AbstractProperty.java:121)
at org.gradle.api.internal.file.DefaultFilePropertyFactory$AbstractFileVar.access$100(DefaultFilePropertyFactory.java:180)
at org.gradle.api.internal.file.DefaultFilePropertyFactory$AbstractFileVar$2.calculateOwnValue(DefaultFilePropertyFactory.java:263)
at org.gradle.api.internal.provider.AbstractMinimalProvider.getOrNull(AbstractMinimalProvider.java:93)
at org.gradle.api.internal.tasks.properties.FileParameterUtils.resolveOutputFilePropertySpecs(FileParameterUtils.java:115)
at org.gradle.api.internal.tasks.properties.GetOutputFilesVisitor.visitOutputFileProperty(GetOutputFilesVisitor.java:44)
at org.gradle.api.internal.tasks.properties.CompositePropertyVisitor.visitOutputFileProperty(CompositePropertyVisitor.java:64)
at org.gradle.api.internal.tasks.properties.annotations.AbstractOutputPropertyAnnotationHandler.visitPropertyValue(AbstractOutputPropertyAnnotationHandler.java:50)
at org.gradle.api.internal.tasks.properties.bean.AbstractNestedRuntimeBeanNode.visitProperties(AbstractNestedRuntimeBeanNode.java:56)
at org.gradle.api.internal.tasks.properties.bean.NestedRuntimeBeanNode.visitNode(NestedRuntimeBeanNode.java:41)
at org.gradle.api.internal.tasks.properties.DefaultPropertyWalker.visitProperties(DefaultPropertyWalker.java:41)
at org.gradle.api.internal.tasks.TaskPropertyUtils.visitProperties(TaskPropertyUtils.java:44)
at org.gradle.api.internal.tasks.properties.DefaultTaskProperties.resolve(DefaultTaskProperties.java:65)
at org.gradle.execution.plan.LocalTaskNode.resolveMutations(LocalTaskNode.java:202)
at org.gradle.execution.plan.DefaultExecutionPlan.getResolvedMutationInfo(DefaultExecutionPlan.java:654)
at org.gradle.execution.plan.DefaultExecutionPlan.selectNext(DefaultExecutionPlan.java:577)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$executeNextNode$1(DefaultPlanExecutor.java:166)
at org.gradle.internal.resources.DefaultResourceLockCoordinationService.withStateLock(DefaultResourceLockCoordinationService.java:45)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:155)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: org.gradle.api.InvalidUserCodeException: Querying the mapped value of map(java.io.File property(org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory,{directory} org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer#cea20b4) before task ':core:compileDebugJavaWithJavac' has completed is not supported
at org.gradle.api.internal.provider.TransformBackedProvider.lambda$beforeRead$0(TransformBackedProvider.java:84)
at org.gradle.api.internal.provider.ValueSupplier$TaskProducer.visitContentProducerTasks(ValueSupplier.java:136)
at org.gradle.api.internal.provider.TransformBackedProvider.beforeRead(TransformBackedProvider.java:81)
at org.gradle.api.internal.provider.TransformBackedProvider.calculateOwnValue(TransformBackedProvider.java:63)
at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateValue(AbstractMinimalProvider.java:103)
at org.gradle.api.internal.provider.MappingProvider.calculateOwnValue(MappingProvider.java:55)
at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateValue(AbstractMinimalProvider.java:103)
at org.gradle.api.internal.provider.DefaultProperty.calculateValueFrom(DefaultProperty.java:128)
at org.gradle.api.internal.provider.DefaultProperty.calculateValueFrom(DefaultProperty.java:25)
at org.gradle.api.internal.provider.AbstractProperty.doCalculateValue(AbstractProperty.java:133)
... 23 more
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 3s
10 actionable tasks: 10 up-to-date
It has multiple libraries, and target and compile SDK is 30. I have tried to update some of the libraries like Hilt, but this does not fixed the issue. It has a lot of deprecated methods, but as I know this usually is not big problem.
Related
I am migrating from API 30 to API 31. After resolving generic compatible errors, I got the below error. app_context is a module in my project.
I could successfully migrate simple application to API 31 irrespective of java, gradle, studio versions etc.
Please help if you have come across this error.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app_context:compileDebugJavaWithJavac'.
> Failed to calculate the value of task ':app_context:compileDebugJavaWithJavac' property 'options.generatedSourceOutputDirectory'.
> Querying the mapped value of map(java.io.File property(org.gradle.api.file.Directory, property(org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, /project/app_context/build/generated/ap_generated_sources/debug/out))) org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer#84cc612) before task ':app_context:compileDebugJavaWithJavac' has completed is not supported
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app_context:compileDebugJavaWithJavac'.
at org.gradle.api.internal.tasks.properties.DefaultTaskProperties.resolve(DefaultTaskProperties.java:82)
at org.gradle.execution.plan.LocalTaskNode.resolveMutations(LocalTaskNode.java:200)
at org.gradle.execution.plan.DefaultExecutionPlan.getResolvedMutationInfo(DefaultExecutionPlan.java:665)
at org.gradle.execution.plan.DefaultExecutionPlan.selectNext(DefaultExecutionPlan.java:577)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$executeNextNode$1(DefaultPlanExecutor.java:166)
at org.gradle.internal.resources.DefaultResourceLockCoordinationService.withStateLock(DefaultResourceLockCoordinationService.java:45)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:155)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: org.gradle.api.internal.provider.AbstractProperty$PropertyQueryException: Failed to calculate the value of task ':app_context:compileDebugJavaWithJavac' property 'options.generatedSourceOutputDirectory'.
at org.gradle.api.internal.provider.AbstractProperty.finalizeNow(AbstractProperty.java:239)
at org.gradle.api.internal.provider.AbstractProperty.beforeRead(AbstractProperty.java:230)
at org.gradle.api.internal.provider.AbstractProperty.calculateOwnValueNoProducer(AbstractProperty.java:120)
at org.gradle.api.internal.file.DefaultFilePropertyFactory$AbstractFileVar.access$100(DefaultFilePropertyFactory.java:180)
at org.gradle.api.internal.file.DefaultFilePropertyFactory$AbstractFileVar$2.calculateOwnValue(DefaultFilePropertyFactory.java:263)
at org.gradle.api.internal.provider.AbstractMinimalProvider.getOrNull(AbstractMinimalProvider.java:93)
at org.gradle.api.internal.tasks.properties.FileParameterUtils.resolveOutputFilePropertySpecs(FileParameterUtils.java:115)
at org.gradle.api.internal.tasks.properties.OutputUnpacker.visitOutputFileProperty(OutputUnpacker.java:67)
at org.gradle.api.internal.tasks.properties.CompositePropertyVisitor.visitOutputFileProperty(CompositePropertyVisitor.java:64)
at org.gradle.api.internal.tasks.properties.annotations.AbstractOutputPropertyAnnotationHandler.visitPropertyValue(AbstractOutputPropertyAnnotationHandler.java:50)
at org.gradle.api.internal.tasks.properties.bean.AbstractNestedRuntimeBeanNode.visitProperties(AbstractNestedRuntimeBeanNode.java:56)
at org.gradle.api.internal.tasks.properties.bean.NestedRuntimeBeanNode.visitNode(NestedRuntimeBeanNode.java:41)
at org.gradle.api.internal.tasks.properties.DefaultPropertyWalker.visitProperties(DefaultPropertyWalker.java:41)
at org.gradle.api.internal.tasks.TaskPropertyUtils.visitProperties(TaskPropertyUtils.java:44)
at org.gradle.api.internal.tasks.properties.DefaultTaskProperties.resolve(DefaultTaskProperties.java:73)
at org.gradle.execution.plan.LocalTaskNode.resolveMutations(LocalTaskNode.java:200)
at org.gradle.execution.plan.DefaultExecutionPlan.getResolvedMutationInfo(DefaultExecutionPlan.java:665)
at org.gradle.execution.plan.DefaultExecutionPlan.selectNext(DefaultExecutionPlan.java:577)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$executeNextNode$1(DefaultPlanExecutor.java:166)
at org.gradle.internal.resources.DefaultResourceLockCoordinationService.withStateLock(DefaultResourceLockCoordinationService.java:45)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:155)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: org.gradle.api.InvalidUserCodeException: Querying the mapped value of map(java.io.File property(org.gradle.api.file.Directory, property(org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, /project/app_context/build/generated/ap_generated_sources/debug/out))) org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer#84cc612) before task ':app_context:compileDebugJavaWithJavac' has completed is not supported
at org.gradle.api.internal.provider.TransformBackedProvider.lambda$beforeRead$0(TransformBackedProvider.java:84)
at org.gradle.api.internal.provider.ValueSupplier$TaskProducer.visitContentProducerTasks(ValueSupplier.java:136)
at org.gradle.api.internal.provider.TransformBackedProvider.beforeRead(TransformBackedProvider.java:81)
at org.gradle.api.internal.provider.TransformBackedProvider.calculateOwnValue(TransformBackedProvider.java:63)
at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateValue(AbstractMinimalProvider.java:103)
at org.gradle.api.internal.provider.MappingProvider.calculateOwnValue(MappingProvider.java:55)
at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateValue(AbstractMinimalProvider.java:103)
at org.gradle.api.internal.provider.AbstractMinimalProvider.withFinalValue(AbstractMinimalProvider.java:151)
at org.gradle.api.internal.provider.DefaultProperty.finalValue(DefaultProperty.java:133)
at org.gradle.api.internal.provider.DefaultProperty.finalValue(DefaultProperty.java:25)
at org.gradle.api.internal.provider.AbstractProperty.finalizeNow(AbstractProperty.java:236)
... 24 more
SO WHEN I CLICK BUILD PROJECT IT SAYS ZERO ERRORS BUT I STILL GET THIS
Executing tasks: [clean, :unityLibrary:assembleDebug, :launcher:assembleDebug] in
project C:\Users\mehmo\OneDrive\Documents\Game
> Configure project :launcher
WARNING: The option 'android.enableR8' is deprecated and should not be used
anymore.
It will be removed in a future version of the Android Gradle plugin, and will no
longer allow you to disable R8.
> Task :clean UP-TO-DATE
> Task :launcher:clean
> Task :launcher:preBuild UP-TO-DATE
> Task :launcher:preDebugBuild UP-TO-DATE
> Task :launcher:mergeDebugJniLibFolders
> Task :launcher:generateDebugBuildConfig
> Task :launcher:generateDebugResValues
> Task :launcher:mergeDebugNativeLibs
> Task :launcher:stripDebugDebugSymbols
> Task :launcher:copyDebugJniLibsProjectAndLocalJars
> Task :launcher:mergeDebugShaders
> Task :launcher:compileDebugShaders
> Task :launcher:generateDebugAssets
> Task :launcher:packageDebugAssets
> Task :launcher:packageDebugRenderscript NO-SOURCE
> Task :launcher:prepareLintJarForPublish UP-TO-DATE
> Task :launcher:processDebugJavaRes NO-SOURCE
> Task :launcher:processDebugManifest
> Task :launcher:mergeDebugJavaResource
> Task :unityLibrary:clean
> Task :unityLibrary:preBuild UP-TO-DATE
> Task :unityLibrary:preDebugBuild UP-TO-DATE
> Task :unityLibrary:compileDebugAidl NO-SOURCE
> Task :launcher:compileDebugAidl NO-SOURCE
> Task :unityLibrary:BuildIl2CppTask
Building libil2cpp.so with AndroidToolChain
Output directory: C:\Users\mehmo\OneDrive\Documents\Game\unityLibrary\src\main\jniLibs\armeabi-v7a
Cache directory: C:\Users\mehmo\OneDrive\Documents\Game\unityLibrary\build\il2cpp_armeabi-v7a_Release\il2cpp_cache
ObjectFiles: 221 of which compiled: 221
Time Compile: 12829 milliseconds Lump_libil2cpp_vm.cpp
Time Compile: 12407 milliseconds Il2CppInvokerTable.cpp
Time Compile: 11982 milliseconds Unity.TextMeshPro2.cpp
Time Compile: 11898 milliseconds Generics1.cpp
Time Compile: 11286 milliseconds Generics.cpp
Time Compile: 10922 milliseconds Unity.TextMeshPro3.cpp
Time Compile: 10625 milliseconds mscorlib4.cpp
Time Compile: 9856 milliseconds Unity.TextMeshPro4.cpp
Time Compile: 9713 milliseconds Lump_libil2cpp_icalls.cpp
Time Compile: 8830 milliseconds Generics10.cpp
Total compilation time: 56052 milliseconds.
Total link time: 2164 milliseconds.
Cleaned up 0 object files.
Building libil2cpp.so with AndroidToolChain
Output directory: C:\Users\mehmo\OneDrive\Documents\Game\unityLibrary\src\main\jniLibs\arm64-v8a
Cache directory: C:\Users\mehmo\OneDrive\Documents\Game\unityLibrary\build\il2cpp_arm64-v8a_Release\il2cpp_cache
ObjectFiles: 221 of which compiled: 221
Time Compile: 12777 milliseconds Lump_libil2cpp_vm.cpp
Time Compile: 11706 milliseconds Il2CppInvokerTable.cpp
Time Compile: 11465 milliseconds Generics1.cpp
Time Compile: 11200 milliseconds Unity.TextMeshPro2.cpp
Time Compile: 10710 milliseconds Generics.cpp
Time Compile: 10155 milliseconds Unity.TextMeshPro3.cpp
Time Compile: 9667 milliseconds Lump_libil2cpp_icalls.cpp
Time Compile: 9315 milliseconds mscorlib4.cpp
Time Compile: 9026 milliseconds Unity.TextMeshPro4.cpp
Time Compile: 8415 milliseconds Generics3.cpp
Total compilation time: 54646 milliseconds.
Total link time: 3373 milliseconds.
Cleaned up 0 object files.
> Task :unityLibrary:mergeDebugJniLibFolders
> Task :unityLibrary:compileDebugRenderscript NO-SOURCE
> Task :unityLibrary:generateDebugBuildConfig
> Task :unityLibrary:generateDebugResValues
> Task :unityLibrary:generateDebugResources
> Task :unityLibrary:packageDebugResources
> Task :unityLibrary:parseDebugLocalResources
> Task :unityLibrary:mergeDebugShaders
> Task :unityLibrary:compileDebugShaders
> Task :unityLibrary:generateDebugAssets
> Task :unityLibrary:packageDebugAssets
> Task :unityLibrary:packageDebugRenderscript NO-SOURCE
> Task :launcher:compileDebugRenderscript NO-SOURCE
> Task :unityLibrary:prepareLintJarForPublish UP-TO-DATE
> Task :launcher:generateDebugResources
> Task :unityLibrary:processDebugJavaRes NO-SOURCE
> Task :unityLibrary:processDebugManifest
> Task :unityLibrary:javaPreCompileDebug
> Task :launcher:packageDebugResources
> Task :launcher:parseDebugLocalResources
> Task :unityLibrary:mergeDebugNativeLibs
> Task :unityLibrary:stripDebugDebugSymbols
> Task :unityLibrary:copyDebugJniLibsProjectAndLocalJars
> Task :unityLibrary:mergeDebugJavaResource
> Task :unityLibrary:generateDebugRFile
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':unityLibrary:compileDebugJavaWithJavac'.
Failed to query the value of task ':unityLibrary:compileDebugJavaWithJavac' property 'options.generatedSourceOutputDirectory'.
Querying the mapped value of map(java.io.File property(org.gradle.api.file.Directory, property(org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, C:\Users\mehmo\OneDrive\Documents\Game\unityLibrary\build\generated\ap_generated_sources\debug\out))) org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer#35383760) before task ':unityLibrary:compileDebugJavaWithJavac' has completed is not supported
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 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 1m 59s
34 actionable tasks: 31 executed, 3 up-to-date
IN DEBUG I GET THIS:
2021-05-19T16:15:40.480+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-05-19T16:15:40.480+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
2021-05-19T16:15:40.480+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-05-19T16:15:40.480+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
2021-05-19T16:15:40.480+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':unityLibrary:compileDebugJavaWithJavac'.
2021-05-19T16:15:40.481+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Failed to query the value of task ':unityLibrary:compileDebugJavaWithJavac' property 'options.generatedSourceOutputDirectory'.
2021-05-19T16:15:40.481+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Querying the mapped value of map(java.io.File property(org.gradle.api.file.Directory, property(org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, C:\Users\mehmo\OneDrive\Documents\Game\unityLibrary\build\generated\ap_generated_sources\debug\out))) org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer#4ece53fe) before task ':unityLibrary:compileDebugJavaWithJavac' has completed is not supported
2021-05-19T16:15:40.481+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-05-19T16:15:40.481+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
2021-05-19T16:15:40.481+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace. Run with --scan to get full insights.
2021-05-19T16:15:40.481+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-05-19T16:15:40.481+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
2021-05-19T16:15:40.481+0100 [WARN] [org.gradle.internal.featurelifecycle.LoggingDeprecatedFeatureHandler]
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0.1/userguide/command_line_interface.html#sec:command_line_warnings
2021-05-19T16:15:40.481+0100 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger]
2021-05-19T16:15:40.481+0100 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 2m 1s
I encountered this issue as well and decided to scrap my entire project and do a clean setup. Turns out that Gradle 7.x is incompatible with Android development. If you downgrade your Gradle to 6.9 everything works as expected.
This would explain also why "Build Project" works, but through Gradle it doesn't, it's a different wrapper instance.
Changing the Gradle version of distributionUrl in gradle-wrapper.properties file works for me.
I'm now using Unity 2021.3.5f1 version. From here (https://docs.unity3d.com/Manual/android-gradle-overview.html), I know that I should use Gradle version 6.1.1.
To change the Gradle version, open gradle-wrapper.properties file, update distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip with the Gradle version found above. Then, sync and rebuild the project. Build success!
Hope it would help you!
I recently upgraded my expo's SDK version from 35 to 41 and also upgraded expo-cli from 3.18.5 to 4.4.3.
However, when I try to build a standalone APK/AAB, I'm getting the following error:
× Build failed. Standalone build failed!
In order to understand what was exactly causing this issue, I examined the Gradle logs of build Gradle on expo, and here's what I was able to find.
Installing unimodules:
unimodules-core#7.1.0 from /app/turtle/workingdir/android/sdk41/packages/#unimodules/core
unimodules-react-native-adapter#6.2.2 from /app/turtle/workingdir/android/sdk41/packages/#unimodules/react-native-adapter
expo-application#3.1.2 from /app/turtle/workingdir/android/sdk41/packages/expo-application
expo-barcode-scanner#10.1.2 from /app/turtle/workingdir/android/sdk41/packages/expo-barcode-scanner
expo-camera#11.0.2 from /app/turtle/workingdir/android/sdk41/packages/expo-camera
expo-constants#10.1.3 from /app/turtle/workingdir/android/sdk41/packages/expo-constants
expo-error-recovery#2.1.0 from /app/turtle/workingdir/android/sdk41/packages/expo-error-recovery
expo-file-system#11.0.2 from /app/turtle/workingdir/android/sdk41/packages/expo-file-system
expo-font#9.1.0 from /app/turtle/workingdir/android/sdk41/packages/expo-font
expo-image-loader#2.1.1 from /app/turtle/workingdir/android/sdk41/packages/expo-image-loader
expo-keep-awake#9.1.2 from /app/turtle/workingdir/android/sdk41/packages/expo-keep-awake
expo-notifications#0.11.6 from /app/turtle/workingdir/android/sdk41/packages/expo-notifications
unimodules-app-loader#2.1.0 from /app/turtle/workingdir/android/sdk41/packages/unimodules-app-loader
expo-permissions#12.0.1 from /app/turtle/workingdir/android/sdk41/packages/expo-permissions
unimodules-barcode-scanner-interface#6.1.0 from /app/turtle/workingdir/android/sdk41/packages/unimodules-barcode-scanner-interface
unimodules-camera-interface#6.1.0 from /app/turtle/workingdir/android/sdk41/packages/unimodules-camera-interface
unimodules-constants-interface#6.1.0 from /app/turtle/workingdir/android/sdk41/packages/unimodules-constants-interface
unimodules-face-detector-interface#6.1.0 from /app/turtle/workingdir/android/sdk41/packages/unimodules-face-detector-interface
unimodules-file-system-interface#6.1.0 from /app/turtle/workingdir/android/sdk41/packages/unimodules-file-system-interface
unimodules-font-interface#6.1.0 from /app/turtle/workingdir/android/sdk41/packages/unimodules-font-interface
unimodules-image-loader-interface#6.1.0 from /app/turtle/workingdir/android/sdk41/packages/unimodules-image-loader-interface
unimodules-permissions-interface#6.1.0 from /app/turtle/workingdir/android/sdk41/packages/unimodules-permissions-interface
unimodules-sensors-interface#6.1.0 from /app/turtle/workingdir/android/sdk41/packages/unimodules-sensors-interface
unimodules-task-manager-interface#6.1.0 from /app/turtle/workingdir/android/sdk41/packages/unimodules-task-manager-interface
Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Could not find google-services.json while looking in [src/nullnull/release, src/release/nullnull, src/nullnull, src/release, src/nullnullRelease]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
> Task :app:preBuild UP-TO-DATE
> Task :app:extractProguardFiles
> Task :app:preReleaseBuild
> Task :app:compileReleaseRenderscript NO-SOURCE
> Task :app:generateReleaseResValues
> Task :app:generateReleaseResources
> Task :app:processReleaseGoogleServices
Parsing json file: /app/turtle/workingdir/android/sdk41/android-shell-app/app/google-services.json
> Task :app:createReleaseCompatibleScreenManifests
> Task :app:extractDeepLinksRelease
> Task :app:mergeReleaseResources
> Task :app:processReleaseMainManifest
[com.facebook.soloader:soloader:0.8.2] /root/.gradle/caches/transforms-3/cfd0b9e5b303f54f13e669e38ab029ae/transformed/jetified-soloader-0.8.2/AndroidManifest.xml Warning:
Package name 'com.facebook.soloader' used in: com.facebook.soloader:soloader:0.8.2, com.facebook.soloader:annotation:0.8.2.
/app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/AndroidManifest.xml:35:1-94 Warning:
Element uses-permission#android.permission.SYSTEM_ALERT_WINDOW at AndroidManifest.xml:35:1-94 duplicated with element declared at AndroidManifest.xml:16:3-76
/app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/AndroidManifest.xml:23:1-101 Warning:
uses-permission#android.permission.ACCESS_BACKGROUND_LOCATION was tagged at AndroidManifest.xml:23 to remove other declarations but no other declaration present
/app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/AndroidManifest.xml:24:1-87 Warning:
uses-permission#android.permission.RECORD_AUDIO was tagged at AndroidManifest.xml:24 to remove other declarations but no other declaration present
/app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/AndroidManifest.xml:26:1-89 Warning:
uses-permission#android.permission.WRITE_CONTACTS was tagged at AndroidManifest.xml:26 to remove other declarations but no other declaration present
/app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/AndroidManifest.xml:32:1-88 Warning:
uses-permission#android.permission.USE_BIOMETRIC was tagged at AndroidManifest.xml:32 to remove other declarations but no other declaration present
/app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/AndroidManifest.xml:33:1-82 Warning:
uses-permission#android.permission.VIBRATE was tagged at AndroidManifest.xml:33 to remove other declarations but no other declaration present
/app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/AndroidManifest.xml:34:1-91 Warning:
uses-permission#android.permission.READ_PHONE_STATE was tagged at AndroidManifest.xml:34 to remove other declarations but no other declaration present
/app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/AndroidManifest.xml:35:1-94 Warning:
uses-permission#android.permission.SYSTEM_ALERT_WINDOW was tagged at AndroidManifest.xml:35 to remove other declarations but no other declaration present
/app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/AndroidManifest.xml:37:1-83 Warning:
uses-permission#android.permission.READ_SMS was tagged at AndroidManifest.xml:37 to remove other declarations but no other declaration present
/app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/AndroidManifest.xml:38:1-99 Warning:
uses-permission#android.permission.REQUEST_INSTALL_PACKAGES was tagged at AndroidManifest.xml:38 to remove other declarations but no other declaration present
/app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/AndroidManifest.xml:41:1-104 Warning:
uses-permission#com.android.launcher.permission.INSTALL_SHORTCUT was tagged at AndroidManifest.xml:41 to remove other declarations but no other declaration present
/app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/AndroidManifest.xml:208:5-213:39 Warning:
activity#com.facebook.FacebookActivity#android:theme was tagged at AndroidManifest.xml:208 to replace other declarations but no other declaration present
/app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/AndroidManifest.xml:17:9-26:20 Warning:
provider#expo.modules.filesystem.FileSystemFileProvider#android:authorities was tagged at AndroidManifest.xml:17 to replace other declarations but no other declaration present
> Task :app:processReleaseManifest
> Task :app:processApplicationManifestReleaseForBundle
> Task :app:mergeReleaseShaders
> Task :app:compileReleaseShaders NO-SOURCE
> Task :app:generateReleaseAssets UP-TO-DATE
> Task :app:mergeReleaseAssets
> Task :app:compileReleaseAidl
NO-SOURCE
> Task :app:generateReleaseBuildConfig
> Task :app:checkReleaseDuplicateClasses
> Task :app:javaPreCompileRelease
> Task :app:checkReleaseAarMetadata
> Task :app:processReleaseJavaRes NO-SOURCE
> Task :app:bundleReleaseResources
> Task :app:mergeReleaseJniLibFolders
> Task :app:collectReleaseDependencies
> Task :app:configureReleaseDependencies
> Task :app:parseReleaseIntegrityConfig
> Task :app:validateSigningRelease
> Task :app:processReleaseManifestForPackage
> Task :app:mergeReleaseNativeLibs
> Task :app:processReleaseResources
> Task :app:mergeReleaseJavaResource
> Task :app:compileReleaseJavaWithJavac
[stderr] /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/java/host/exp/exponent/generated/AppConstants.java:8: error: package expo.modules.splashscreen does not exist
[stderr] import expo.modules.splashscreen.SplashScreenImageResizeMode;
[stderr] ^
[stderr] /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/java/host/exp/exponent/generated/AppConstants.java:25: error: cannot find symbol
[stderr] public static SplashScreenImageResizeMode SPLASH_SCREEN_IMAGE_RESIZE_MODE = SplashScreenImageResizeMode.CONTAIN;
[stderr] ^
[stderr] symbol: class SplashScreenImageResizeMode
[stderr] location: class AppConstants
[stderr] /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/java/host/exp/exponent/generated/AppConstants.java:25: error: cannot find symbol
[stderr] public static SplashScreenImageResizeMode SPLASH_SCREEN_IMAGE_RESIZE_MODE = SplashScreenImageResizeMode.CONTAIN;
[stderr] ^
[stderr] symbol: variable SplashScreenImageResizeMode
[stderr] location: class AppConstants
[stderr] /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/java/host/exp/exponent/generated/AppConstants.java:53: error: cannot access SplashScreenImageResizeMode
[stderr] constants.SPLASH_SCREEN_IMAGE_RESIZE_MODE = SPLASH_SCREEN_IMAGE_RESIZE_MODE;
[stderr] ^
[stderr] class file for expo.modules.splashscreen.SplashScreenImageResizeMode not found
[stderr] 4 errors
> Task :app:compileReleaseJavaWithJavac FAILED
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:compileReleaseJavaWithJavac'.
[stderr] > Compilation failed; see the compiler error output for details.
[stderr] * Try:
[stderr] 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.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 35s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.8/userguide/command_line_interface.html#sec:command_line_warnings
26 actionable tasks: 26 executed
Error: ./gradlew exited with non-zero code: 1
at ChildProcess.completionListener (/app/turtle/node_modules/#expo/xdl/node_modules/#expo/spawn-async/build/spawnAsync.js:52:23)
at Object.onceWrapper (events.js:418:26)
at ChildProcess.emit (events.js:311:20)
at ChildProcess.EventEmitter.emit (domain.js:482:12)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
...
at spawnAsync (/app/turtle/node_modules/#expo/xdl/node_modules/#expo/spawn-async/build/spawnAsync.js:17:21)
at spawnAsyncThrowError (/app/turtle/node_modules/#expo/xdl/build/detach/ExponentTools.js:201:45)
at buildShellAppAsync (/app/turtle/node_modules/#expo/xdl/build/detach/AndroidShellApp.js:976:11)
at async Object.createAndroidShellAppAsync (/app/turtle/node_modules/#expo/xdl/build/detach/AndroidShellApp.js:396:5)
at async runShellAppBuilder (/app/turtle/build/builders/android.js:95:9)
at async Object.buildAndroid [as android] (/app/turtle/build/builders/android.js:43:28)
at async build (/app/turtle/build/jobManager.js:181:33)
at async processJob (/app/turtle/build/jobManager.js:118:32)
at async Object.doJob (/app/turtle/build/jobManager.js:49:5)
at async main (/app/turtle/build/server.js:66:13)
If we notice the above logs, it can be seen that the issue is mostly pertaining to the Splash screen.
[stderr] /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/java/host/exp/exponent/generated/AppConstants.java:8: error: package expo.modules.splashscreen does not exist
[stderr] import expo.modules.splashscreen.SplashScreenImageResizeMode;
[stderr] ^
[stderr] /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/java/host/exp/exponent/generated/AppConstants.java:25: error: cannot find symbol
[stderr] public static SplashScreenImageResizeMode SPLASH_SCREEN_IMAGE_RESIZE_MODE = SplashScreenImageResizeMode.CONTAIN;
[stderr] ^
[stderr] symbol: class SplashScreenImageResizeMode
[stderr] location: class AppConstants
[stderr] /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/java/host/exp/exponent/generated/AppConstants.java:25: error: cannot find symbol
[stderr] public static SplashScreenImageResizeMode SPLASH_SCREEN_IMAGE_RESIZE_MODE = SplashScreenImageResizeMode.CONTAIN;
[stderr] ^
[stderr] symbol: variable SplashScreenImageResizeMode
[stderr] location: class AppConstants
[stderr] /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/java/host/exp/exponent/generated/AppConstants.java:53: error: cannot access SplashScreenImageResizeMode
[stderr] constants.SPLASH_SCREEN_IMAGE_RESIZE_MODE = SPLASH_SCREEN_IMAGE_RESIZE_MODE;
[stderr] ^
[stderr] class file for expo.modules.splashscreen.SplashScreenImageResizeMode not found
[stderr] 4 errors
> Task :app:compileReleaseJavaWithJavac FAILED
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:compileReleaseJavaWithJavac'.
[stderr] > Compilation failed; see the compiler error output for details.
[stderr] * Try:
[stderr] 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.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 35s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
Here's my app.json
{
"expo": {
"name": "APP_NAME",
"slug": "APP_SLUG",
"platforms": [
"ios",
"android",
"web"
],
"version": "1.0.1",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true,
"bundleIdentifier": "BUNDLE_IDENTIFIER"
},
"android": {
"package": "APP_PACKAGE",
"softwareKeyboardLayoutMode": "pan",
"versionCode": 1,
"permissions": [
"CAMERA"
],
"enableDangerousExperimentalLeanBuilds": true
}
}
}
The builds were successful with the older SDK version, but few packages were not compatible with the older SDK, hence I had to upgrade it to the latest. The application is running perfectly fine in the expo go mobile application, but unable to build a standalone app.
How to solve this problem? Or, is it possible to downgrade from SDK 41 to 40 or 39? Any suggestions or recommendation is appreciated.
There are two major reasons for this cause.
Setting enableDangerousExperimentalLeanBuils to true.
Missing expo-splash-screen package.
The error is because it's(Gradle build) looking for expo-modules-splashscreen package, which is supposedly moved out of expo's main module in SDK 41, hence needs to be separately installed.
In order to fix this, there are two workarounds:
Remove enableDangerousExperimentalLeanBuilds property. (Not tested)
Install expo-splash-screen using npm install expo-splash-screen.(Tested and working)
I'm trying call DrawImage() on my code, I'm following this tutorial
Jetpack Tutorial,
But I'm getting this error.:
Unresolved reference: DrawImage
I tried implement on build.gradle, this lib.:
implementation 'androidx.ui:ui-foundation:0.1.0-dev04'
But I getting this error.:
Executing tasks: [clean, :app:assembleDebug] in project
C:\Users\samue\Desktop\Projetos Kotlin\first-jetpack
Task :clean
Task :app:clean
Task :app:preBuild UP-TO-DATE
Task :app:preDebugBuild UP-TO-DATE
Task :app:compileDebugAidl NO-SOURCE
Task :app:generateDebugBuildConfig
Task :app:compileDebugRenderscript NO-SOURCE
Task :app:prepareDebugKotlinCompileTask
Task :app:generateDebugResValues
Task :app:generateDebugResources
Task :app:createDebugCompatibleScreenManifests
Task :app:extractDeepLinksDebug
Task :app:processDebugManifest
Task :app:mergeDebugResources
Task :app:processDebugResources
Task :app:compileDebugKotlin FAILED w: ATTENTION! This build uses unsafe internal compiler arguments:
-XXLanguage:+NonParenthesizedAnnotationsOnFunctionalTypes
This mode is not recommended for production use, as no
stability/compatibility guarantees are given on compiler or generated
code. Use it at your own risk!
e: java.lang.IllegalStateException: Backend Internal error: Exception
during code generation Element is unknownThe root cause
java.util.NoSuchElementException was thrown at:
androidx.compose.plugins.kotlin.compiler.lower.ComposableCallTransformer.irComposableExpr(ComposableCallTransformer.kt:1362)
at
org.jetbrains.kotlin.codegen.CompilationErrorHandler.lambda$static$0(CompilationErrorHandler.java:35)
at
org.jetbrains.kotlin.backend.jvm.JvmBackendFacade.doGenerateFilesInternal$backend_jvm(JvmBackendFacade.kt:93)
at
org.jetbrains.kotlin.backend.jvm.JvmBackendFacade.doGenerateFilesInternal$backend_jvm$default(JvmBackendFacade.kt:64)
at
org.jetbrains.kotlin.backend.jvm.JvmBackendFacade.doGenerateFilesInternal$backend_jvm(JvmBackendFacade.kt:52)
at
org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory.generateModule(JvmIrCodegenFactory.kt:36)
at
org.jetbrains.kotlin.codegen.KotlinCodegenFacade.doGenerateFiles(KotlinCodegenFacade.java:47)
at
org.jetbrains.kotlin.codegen.KotlinCodegenFacade.compileCorrectFiles(KotlinCodegenFacade.java:39)
at
org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.generate(KotlinToJVMBytecodeCompiler.kt:638)
at
org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:198)
at
org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:172)
at
org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:56)
at
org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:85)
at
org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:43)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:104) at
org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:349)
at
org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:105)
at
org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally(IncrementalCompilerRunner.kt:237)
at
org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.access$compileIncrementally(IncrementalCompilerRunner.kt:37)
at
org.jetbrains.kotlin.incremental.IncrementalCompilerRunner$compile$2.invoke(IncrementalCompilerRunner.kt:79)
at
org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:91)
at
org.jetbrains.kotlin.daemon.CompileServiceImplBase.execIncrementalCompiler(CompileServiceImpl.kt:606)
at
org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execIncrementalCompiler(CompileServiceImpl.kt:99)
at
org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1645)
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
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
at sun.rmi.transport.Transport$1.run(Transport.java:200) at
sun.rmi.transport.Transport$1.run(Transport.java:197) at
java.security.AccessController.doPrivileged(Native Method) at
sun.rmi.transport.Transport.serviceCall(Transport.java:196) at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
at java.security.AccessController.doPrivileged(Native Method) at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748) Caused by:
java.util.NoSuchElementException: Collection contains no element
matching the predicate. at
androidx.compose.plugins.kotlin.compiler.lower.ComposableCallTransformer.irComposableExpr(ComposableCallTransformer.kt:1362)
at
androidx.compose.plugins.kotlin.compiler.lower.ComposableCallTransformer.visitBlock(ComposableCallTransformer.kt:252)
at
org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitBlock(IrElementTransformerVoid.kt:128)
at
org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitBlock(IrElementTransformerVoid.kt:24)
at
org.jetbrains.kotlin.ir.expressions.impl.IrBlockImpl.accept(IrBlockImpl.kt:52)
at
org.jetbrains.kotlin.ir.expressions.IrExpression$DefaultImpls.transform(IrExpression.kt:28)
at
org.jetbrains.kotlin.ir.expressions.impl.IrExpressionBase.transform(IrExpressionBase.kt:24)
at
org.jetbrains.kotlin.ir.declarations.impl.IrVariableImpl.transformChildren(IrVariableImpl.kt:93)
at
org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoidKt.transformChildrenVoid(IrElementTransformerVoid.kt:288)
at
org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.transformChildrenVoid(IrElementTransformerVoid.kt:283)
at
org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.transformChildren(IrElementTransformerVoid.kt:25)
at
org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitDeclaration(IrElementTransformerVoid.kt:46)
at
org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitVariable(IrElementTransformerVoid.kt:87)
at
org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitVariable(IrElementTransformerVoid.kt:88)
at
org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitVariable(IrElementTransformerVoid.kt:24)
at
org.jetbrains.kotlin.ir.declarations.impl.IrVariableImpl.accept(IrVariableImpl.kt:86)
at
org.jetbrains.kotlin.ir.declarations.IrDeclaration$DefaultImpls.transform(IrDeclaration.kt:42)
at
org.jetbrains.kotlin.ir.declarations.impl.IrDeclarationBase.transform(IrDeclarationBase.kt:27)
at
org.jetbrains.kotlin.ir.expressions.impl.IrBlockBodyImpl.transformChildren(IrBlockBodyImpl.kt:49)
at
org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoidKt.transformChildrenVoid(IrElementTransformerVoid.kt:288)
at
org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.transformChildrenVoid(IrElementTransformerVoid.kt:283)
at
org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.transformChildren(IrElementTransformerVoid.kt:25)
at
org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitBody(IrElementTransformerVoid.kt:93)
at
org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitBlockBody(IrElementTransformerVoid.kt:99)
at
org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitBlockBody(IrElementTransformerVoid.kt:100)
at
org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitBlockBody(IrElementTransformerVoid.kt:24)
at
org.jetbrains.kotlin.ir.expressions.impl.IrBlockBodyImpl.accept(IrBlockBodyImpl.kt:40)
at
org.jetbrains.kotlin.ir.expressions.IrBody$DefaultImpls.transform(IrBody.kt:24)
at
org.jetbrains.kotlin.ir.expressions.IrBlockBody$DefaultImpls.transform(IrBody.kt)
at
org.jetbrains.kotlin.ir.expressions.impl.IrBlockBodyImpl.transform(IrBlockBodyImpl.kt:26)
at
org.jetbrains.kotlin.ir.declarations.impl.IrFunctionBase.transformChildren(IrFunctionBase.kt:77)
at
org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoidKt.transformChildrenVoid(IrElementTransformerVoid.kt:288)
at
org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.transformChildrenVoid(IrElementTransformerVoid.kt:283)
at
org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.transformChildren(IrElementTransformerVoid.kt:25)
at
org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitDeclaration(IrElementTransformerVoid.kt:46)
at
org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitFunction(IrElementTransformerVoid.kt:55)
at
androidx.compose.plugins.kotlin.compiler.lower.ComposableCallTransformer.visitFunction(ComposableCallTransformer.kt:205)
at
org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitSimpleFunction(IrElementTransformerVoid.kt:58)
at
org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitSimpleFunction(IrElementTransformerVoid.kt:59)
at
org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitSimpleFunction(IrElementTransformerVoid.kt:24)
at
org.jetbrains.kotlin.ir.declarations.impl.IrFunctionImpl.accept(IrFunctionImpl.kt:89)
at
org.jetbrains.kotlin.ir.declarations.IrDeclaration$DefaultImpls.transform(IrDeclaration.kt:42)
at
org.jetbrains.kotlin.ir.declarations.impl.IrDeclarationBase.transform(IrDeclarationBase.kt:27)
at
org.jetbrains.kotlin.ir.declarations.impl.IrFileImpl.transformChildren(IrFileImpl.kt:71)
at
org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoidKt.transformChildrenVoid(IrElementTransformerVoid.kt:288)
at
androidx.compose.plugins.kotlin.compiler.lower.ComposableCallTransformer.lower(ComposableCallTransformer.kt:197)
at org.jetbrains.kotlin.backend.common.LowerKt.lower(Lower.kt:66) at
org.jetbrains.kotlin.backend.common.phaser.PhaseBuildersKt$makeIrModulePhase$1.invoke(PhaseBuilders.kt:235)
at
org.jetbrains.kotlin.backend.common.phaser.PhaseBuildersKt$makeIrModulePhase$1.invoke(PhaseBuilders.kt:228)
at
org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper$runBody$1.invoke(CompilerPhase.kt:128)
at
org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.downlevel(CompilerPhase.kt:24)
at
org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.runBody(CompilerPhase.kt:127)
at
org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.invoke(CompilerPhase.kt:105)
at
org.jetbrains.kotlin.backend.common.phaser.CompositePhase.invoke(PhaseBuilders.kt:29)
at
org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.invokeToplevel(CompilerPhase.kt:42)
at org.jetbrains.kotlin.backend.jvm.JvmLower.lower(JvmLower.kt:288)
at
org.jetbrains.kotlin.backend.jvm.JvmBackendFacade.doGenerateFilesInternal$backend_jvm(JvmBackendFacade.kt:91)
... 38 more
Task :app:javaPreCompileDebug
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:compileDebugKotlin'.
Internal compiler error. See log for more 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
BUILD FAILED in 15s 12 actionable tasks: 12 executed
Can someone help me with this issue?
In your module's build.gradle file, make sure that you have this in your android closure:
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerVersion "1.3.61-dev-withExperimentalGoogleExtensions-20200129"
kotlinCompilerExtensionVersion "0.1.0-dev04"
}
My guess is that you are missing the composeOptions.
DrawImage() is part of androidx.ui:ui-foundation.
Open the build.gradle (Module: app) file and add the following line to the list of dependencies:
dependencies {
...
implementation 'androidx.ui:ui-foundation:0.1.0-dev03'
}
I would recommend following Jetpack Compose Basics - Codelab, a more comprehensive tutorial by Google.
You can see the latest composeOptions for the correct build here.
But keep in mind that the library API can vary greatly from version to version, and it would be better to take a look at the official example to examine the use of the Compose library.
Don't forget to switch the repository to the right branch corresponding to the latest version of the library (for example, at the time of the answer it's dev05 branch).
At first I could build and install the app on my Android device but as I launched it crashed, the Logcat was saying that a Firebase library was not included in the package and advising to use the Play Services Jar Resolver. So I used it.
Now I have this error when trying to build my app. (excuse me, I had some issues understanding how to insert a code snippet :) )
CommandInvokationFailure: Gradle build failed.
/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/java -classpath "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/gradle/lib/gradle-launcher-2.14.jar" org.gradle.launcher.GradleMain "assembleRelease"
stderr[
/Users/andreamarchetti/Desktop/Squarcuit/Temp/gradleOut/src/main/AndroidManifest.xml:4: Error: Avoid hardcoding the debug mode; leaving it out allows debug and release builds to automatically assign one [HardcodedDebugMode]
<application android:icon="#drawable/app_icon" android:label="#string/app_name" android:debuggable="false" android:isGame="true" android:banner="#drawable/app_banner">
Explanation for issues of type "HardcodedDebugMode":
It's best to leave out the android:debuggable attribute from the manifest.
If you do, then the tools will automatically insert android:debuggable=true
when building an APK to debug on an emulator or device. And when you
perform a release build, such as Exporting APK, it will automatically set
it to false.
If on the other hand you specify a specific value in the manifest file,
then the tools will always use it. This can lead to accidentally publishing
your app with debug information.
1 errors, 0 warnings
Dex: Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:591)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:546)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:528)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:164)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:504)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformClassesWithDexForRelease'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
]
stdout[
Incremental java compilation is an incubating feature.
:preBuild UP-TO-DATE
:preReleaseBuild UP-TO-DATE
:checkReleaseManifest
:preDebugBuild UP-TO-DATE
:Firebase:preBuild UP-TO-DATE
:Firebase:preReleaseBuild UP-TO-DATE
:Firebase:compileReleaseNdk UP-TO-DATE
:Firebase:compileLint
:Firebase:copyReleaseLint UP-TO-DATE
:Firebase:mergeReleaseProguardFiles
:Firebase:packageReleaseRenderscript UP-TO-DATE
:Firebase:checkReleaseManifest
:Firebase:prepareReleaseDependencies
:Firebase:compileReleaseRenderscript
:Firebase:generateReleaseResValues
:Firebase:generateReleaseResources
:Firebase:packageReleaseResources
:Firebase:compileReleaseAidl
:Firebase:generateReleaseBuildConfig
:Firebase:mergeReleaseShaders
:Firebase:compileReleaseShaders
:Firebase:generateReleaseAssets
:Firebase:mergeReleaseAssets
:Firebase:processReleaseManifest
:Firebase:processReleaseResources
:Firebase:generateReleaseSources
:Firebase:incrementalReleaseJavaCompilationSafeguard
:Firebase:compileReleaseJavaWithJavac
:Firebase:processReleaseJavaRes UP-TO-DATE
:Firebase:transformResourcesWithMergeJavaResForRelease
:Firebase:transformClassesAndResourcesWithSyncLibJarsForRelease
:Firebase:mergeReleaseJniLibFolders
:Firebase:transformNative_libsWithMergeJniLibsForRelease
:Firebase:transformNative_libsWithSyncJniLibsForRelease
:Firebase:bundleRelease
:prepareAnimatedVectorDrawable2340Library
:prepareAppcompatV72340Library
:prepareCardviewV72340Library
:prepareCustomtabs2340Library
:prepareFacebookAndroidSdk4170Library
:prepareFacebookAndroidWrapper794Library
:prepareFirebaseAppUnity401Library
:prepareFirebaseCommon1100Library
:prepareFirebaseIid1100Library
:prepareFirebaseMessaging1100Library
:prepareFirebaseMessagingUnity401Library
:prepareGradleOutFirebaseUnspecifiedLibrary
:preparePlayServicesBase1100Library
:preparePlayServicesBasement1100Library
:preparePlayServicesTasks1100Library
:prepareSupportCompat2520Library
:prepareSupportCoreUi2520Library
:prepareSupportCoreUtils2520Library
:prepareSupportFragment2520Library
:prepareSupportMediaCompat2520Library
:prepareSupportV42340Library
:prepareSupportV42520Library
:prepareSupportVectorDrawable2340Library
:prepareReleaseDependencies
:compileReleaseAidl
:compileReleaseRenderscript
:generateReleaseBuildConfig
:mergeReleaseShaders
:compileReleaseShaders
:generateReleaseAssets
:mergeReleaseAssets
:generateReleaseResValues
:generateReleaseResources
:mergeReleaseResources
:processReleaseManifest
:processReleaseResources
:generateReleaseSources
:incrementalReleaseJavaCompilationSafeguard
:compileReleaseJavaWithJavac
:compileReleaseNdk UP-TO-DATE
:compileReleaseSources
:lintVitalRelease
:prePackageMarkerForRelease
:transformClassesWithDexForRelease
To run dex in process, the Gradle daemon needs a larger heap.
It currently has approximately 910 MB.
For faster builds, increase the maximum heap size for the Gradle daemon to more than 2048 MB.
To do this set org.gradle.jvmargs=-Xmx2048M in the project gradle.properties.
For more information see https://docs.gradle.org/current/userguide/build_environment.html
:transformClassesWithDexForRelease FAILED
BUILD FAILED
Total time: 45.841 secs
]
exit code: 1
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.GradleWrapper.RunJava (System.String args, System.String workingdir, UnityEditor.Android.Progress progress)
UnityEditor.Android.GradleWrapper.Run (System.String workingdir, System.String task, UnityEditor.Android.Progress progress)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.HostView:OnGUI()
I do not have - android:debuggable="false" -anywhere in any AndroidManifest.xml in my project.
I think the problem was that I had multiple .aar files of the same package but different versions. So Facebook SDK was conflicting with some Google Firebase stuff. I deleted the Facebook SDK .aar (which were older versions).