I don't understand what is my problem Firebase? - flutter

One or more plugins require a higher Android SDK version.
Fix this issue by adding the following to C:\Users\User\AndroidStudioProjects\tour\android\app\build.gradle:
android {
compileSdkVersion 33
...
}
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.google.android.material:material:<version>.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/google/android/material/material/<version>/material-<version>.pom
- https://repo.maven.apache.org/maven2/com/google/android/material/material/<version>/material-<version>.pom
- https://storage.googleapis.com/download.flutter.io/com/google/android/material/material/<version>/material-<version>.pom
- https://jcenter.bintray.com/com/google/android/material/material/<version>/material-<version>.pom
Required by:
project :app
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

Your compileSdkVersion is low try to increase it to 33 to do this:
open the android/app/build.gradle file in your project, and find the android block. Inside this block, you should see a compileSdkVersion setting. This setting specifies the version of the Android SDK that your app is built against. The error message indicates that you need to update this setting to a higher version (currently 33) to fix the issue.
android {
compileSdkVersion 33
// Other settings here...
}
and rebuild your app

Related

I've been taking an error in flutter and couldn't fix it

Even I remove and setup again nothing changed.
error
FAILURE: Build failed with an exception.
* What went wrong:
Could not open settings generic class cache for settings file 'C:\Users\Ozgur\Documents\flutterprojects\android\settings.gradle' (C:\Users\Ozgur\.gradle\caches\7.4\scripts\ea4ydi90mwjg9g63m7r6nimmx).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 63
* 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 1s
Exception: Gradle task assembleDebug failed with exit code 1
I remove program and setup again added JAVA_HOME path and reinstall Java JDK-19 and didn't fix
it looks like gradle cache issues, remove the cache and re-install it via android studio, i will auto-install it based on the version you specified.
I recently fixed error it's happening due to gradle version and JDK version aren't capatible. There are 2 solution one of them is remove JDK 19 completelty and install JDK 17 instead of it. Or edit link in gradle-wrapper.properties like this gradle-7.4-all.zip

One or more plugins require a higher Android SDK version error

One or more plugins require a higher Android SDK version.
Fix this issue by adding the following to D:\Flutter Projets\scheduler\android\app\build.gradle:
android {
compileSdkVersion 33
...
}
2
FAILURE: Build failed with an exception.
Where:
Script 'C:\Users\lijoj\Documents\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1156
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command 'C:\Users\lijoj\Documents\flutter\bin\flutter.bat'' finished with non-zero exit value 1
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 7s
Exception: Gradle task assembleDebug failed with exit code 1
Go into the Android -> App -> build.gradle and set targetSdkVersion and compileSdkVersion to 33
Because You have used many plugins in your project and one of them is latest plugin, so latest plugin requires latest Android sdk platfrom.
In your IDE open folder android/app/build.gradle and search for compileSdkVersion(usually inside android attribute) and in from of that replace 'flutter.compileSdkVersion' with '33'.

NDK not configured. Download it with SDK manager when compile flutter app

Today when I compile the flutter(2.5.1) app, show error like this:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':system_clock'.
> NDK not configured. Download it with SDK manager. Preferred NDK version is '21.1.6352462'.
* 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 1s
Exception: Gradle task assembleDebug failed with exit code 1
I have already checked the NDK configuration and make sure the version is installed:
why the project prefer another version of NDK version? what should I do to configure the right version of NDK?
Just check '21.1.6352462' in NDK and press ok.
It'll do the rest.
Or check this issue
https://github.com/flutter/flutter/issues/53657

FAILURE: Build failed with an exception. * What went wrong: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'

FAILURE: Build failed with an exception.
What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
Could not find com.google.firebase:firebase-analytics:.
Required by:
project :app
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 45s
Exception: Gradle task assembleDebug failed with exit code 1
I am not really sure but try to :
Set your java SDK location in project settings
upgrade your buildToolsVersion in your build.gradle file. See which version is the latest and set it to that.
If neither of these methods work , save your project in a repository and re-download android studio if it comes to that.
You can even visit this thread and see if any of the methods solve your problem : Execution failed for task ':app:compileDebugJavaWithJavac' Android Studio 3.1 Update

Flutter: Build Error: Execution failed for task ':app:processDebugResources'

Everything was working fine before upgrading flutter to v1.17.3,
Already tried:
flutter clean
And
flutter downgrade
Error that I'm getting (Build Fail):
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
C:\Users\Shamuvel\Desktop\App Development\PROJECTS\Grocery Store\groci\android\Store\groci\android\app\src\main\AndroidManifest.xml:8:5-47:19: AAPT: error: attribute android:requestLegacyExternalStorage not found.
* 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 1m 27s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin path_provider...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'path_provider'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
* 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 5s
Exception: The plugin path_provider could not be built due to the issue above.
gradle.properties file:
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
Solutions Appreciated
Thanks!
Finally, switching compileSdkVersion & targetSdkVersion from 28 to 29 in android/app/build.gradle file worked.
Check these solutions as well, might help you:-
AAPT: error: attribute android:requestLegacyExternalStorage not found
Flutter: Debug build successful but release gives error
Go to File->Project Structure->Project->Project SDK
and select the latest SDK.
I am a rookie in flutter app development and faced this problem in the very first app I was building.
Fix it with remove android:networkSecurityConfig="#xml/network_security_config" from android manifest.