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

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.

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.

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'

Error in flutter project build gradle problem

What went wrong:
A problem occurred configuring root project 'android'
Could not resolve all artifacts for configuration
":classpath
Could not find com.android.tools.build:gradle:6.7.
Searched in the following locations:
-nttps:1/dl.google.com/d/android/maven2/com/android/tools/build/aradle/6.7/gradle-6.7.pom
nttps://repo_naven_apache.org/maven2/com/android/tools/build/aradle/6.7/gradle-6.7.pom
Required by:
project

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

My eclipse can't find jar's

I'm trying to work with Excel in my project, so I added few additional jar's to it:
MyBuildPath
When I'm trying to run my project, I'm getting such exceptions:
:compileJavaC:\Users\Azimut\Documents\workspaces\helperandroid\MultiViewProjectFXML\src\main\java\myClasses\SearchOrders.java:12: error: package org.apache.poi.ss.usermodel does not exist
import org.apache.poi.ss.usermodel.*;
^
C:\Users\Azimut\Documents\workspaces\helperandroid\MultiViewProjectFXML\src\main\java\myClasses\SearchOrders.java:13: error: package org.apache.poi.xssf.usermodel does not exist
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
.......
C:\Users\Azimut\Documents\workspaces\helperandroid\MultiViewProjectFXML\src\main\java\myClasses\SearchOrders.java:116: error: cannot find symbol
public static String getCellText(Cell cell) {
^
symbol: class Cell
location: class SearchOrders
13 errors
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
I searched a lot through the internet, but I still can't understand how to solve this problem.
I assume you are excuting your code commandline, and not using eclipse.
In that case, You will have to add dependency jars in class path when you run the code.
java -cp <jar files> is the possible way.
Are you able to execute in eclipse ?
Regards,
~KD