sqflite failed to read the directory in flutter - flutter

the error appears without any changes that I do:
> * What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Path '/Users/mac/Documents/projects/build/sqflite/intermediates/compiled_local_resources/debug/out' is not a readable directory.

I managed to solve it by upgrading Gradle and kotlin

You can try to add the following line into your app/build.gradle file.
buildToolsVersion "29.0.2"
Look at the official document for more info.

Related

CommandInvokationFailure: Gradle build failed

I am new to unity. I am using unity 2021.3.10f1 I made my own game and added advertising and other features. When trying to build, it shows the error "CommandInvokationFailure: Gradle build failed." Can you help? An error that is shown in unity:
CommandInvokationFailure: Gradle build failed.
D:\HappyWin\Unity and projects\2021.3.10f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "D:\HappyWin\gradle-6.1.1\lib\gradle-launcher-6.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
stderr[
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':launcher:lintVitalRelease'.
> This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry.
The following AndroidX dependencies are detected: androidx.fragment:fragment:1.0.0, androidx.slidingpanelayout:slidingpanelayout:1.0.0, androidx.versionedparcelable:versionedparcelable:1.1.0, androidx.core:core:1.2.0, androidx.customview:customview:1.0.0, androidx.swiperefreshlayout:swiperefreshlayout:1.0.0, androidx.interpolator:interpolator:1.0.0, androidx.loader:loader:1.0.0, androidx.drawerlayout:drawerlayout:1.0.0, androidx.viewpager:viewpager:1.0.0, androidx.collection:collection:1.0.0, androidx.localbroadcastmanager:localbroadcastmanager:1.0.0, androidx.lifecycle:lifecycle-common:2.0.0, androidx.arch.core:core-common:2.0.0, androidx.annotation:annotation:1.2.0, androidx.startup:startup-runtime:1.0.0, androidx.tracing:tracing:1.0.0, androidx.legacy:legacy-support-core-ui:1.0.0, androidx.lifecycle:lifecycle-livedata:2.0.0, androidx.lifecycle:lifecycle-viewmodel:2.0.0, androidx.lifecycle:lifecycle-livedata-core:2.0.0, androidx.arch.core:core-runtime:2.0.0, androidx.legacy:legacy-support-core-utils:1.0.0, androidx.documentfile:documentfile:1.0.0, androidx.cursoradapter:cursoradapter:1.0.0, androidx.lifecycle:lifecycle-runtime:2.0.0, androidx.coordinatorlayout:coordinatorlayout:1.0.0, androidx.asynclayoutinflater:asynclayoutinflater:1.0.0, androidx.print:print:1.0.0
Changed gradle to different versions. Did not help.

When I run my flutter code I face the following Gradle Dependency problem. What should I do?

I have tried to solve it through different pre-answered questions on StackOverflow but they are not working, That is why asking here, Please help.
here is the problem:
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\TME_Education\StudioProjects\jeda\android\app\build.gradle' line: 58
* What went wrong:
A problem occurred evaluating project ':app'.
> Could not find method compile() for arguments [com.android.tools.build:gradle:7.1.2] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Here is my dependency
dependencies {
compile 'com.android.tools.build:gradle:7.1.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
I was runing the code but this gradle Dependency eror happened.

Flutter: A problem occurred evaluating project ':app' (firebase-perf)

I updated gradle to 7.4 and got this issue:
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/dani/Desktop/repos/dani/my_rents/android/app/build.gradle' line: 30
* What went wrong:
A problem occurred evaluating project ':app'.
> com/android/build/api/extension/AndroidComponentsExtension
It points to this line:
apply plugin: 'com.google.firebase.firebase-perf'

Package Build gradle failed

everytime i add google_maps_flutter package i always get this error but in another project it's fine.
Please help...
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\flutter\.pub-cache\hosted\pub.dartlang.org\google_maps_flutter-2.1.2\android\build.gradle'
* What went wrong:
Could not compile build file 'C:\flutter\.pub-cache\hosted\pub.dartlang.org\google_maps_flutter-2.1.2\android\build.gradle'.
> startup failed:
General error during conversion: Unsupported class file major version 61
java.lang.IllegalArgumentException: Unsupported class file major version 61

Gradle suddenly broke

I haven't modified any build files (and even tried reverting code), but Gradle started crashing on this:
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':macros:compileScala'.
> No value has been specified for property 'zincClasspath'.
* Try:
Run with --info or --debug option to get more log output.
* Exception is:
org.gradle.api.tasks.TaskValidationException: A problem was found with the configuration of task ':macros:compileScala'.
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:55)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.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:53)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
I was writing tests and after one run it just stopped working. Any ideas why it happened and how to fix it?
PS: Search only returned https://stackoverflow.com/a/43085471/1017211 which didn't help and I don't see any reason to update Gradle since it was working nicely with current version.
Have you tried on Android Studio:
File > Invalidate Caches / Restart...
and/or
Tools > Android > Sync Projects with Gradle Files
You can also delete the .gradle folder, then rebuild the project...