One or more plugins require a higher Android SDK version error - flutter

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'.

Related

Flutter app run issue - FAILURE: Build failed with an exception

FAILURE: Build failed with an exception.
* What went wrong:
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher.
The following dependencies do not satisfy the required version:
project ':platform_device_id' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50
* 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 26s
Exception: Gradle task assembleDebug failed with exit code 1
In .yaml file platform_device_id: ^1.0.1
',I need to fix app run issues.
It's an error due to the latest version of Gradle used in the project.platform_device_id Package contains a lower Gradle and Kotlin version that is not supported to build with the latest Gradle version.
There's also a GitHub issue ongoing, you can check it out with this link
The solution is to use this plugin called device_info_plus instead. It is presented by the Flutter community itself so it works seamlessly as you expected. Also, it works will all platforms.

I don't understand what is my problem Firebase?

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

Problem to run the application showing some error message in Flutter

PS D:\Development\ULTIMAT POS\App POS Backup\UltimatePOS_Flutter_1.7.1\pos> flutter run
Launching lib\main.dart on M2102J20SG in debug mode...
FAILURE: Build failed with an exception.
Where:
Build file 'D:\Development\ULTIMAT POS\App POS Backup\UltimatePOS_Flutter_1.7.1\pos\android\app\build.gradle' line: 50
What went wrong:
A problem occurred evaluating project ':app'.
Could not get unknown property 'minSdkVersion20' for extension 'flutter' of type FlutterExtension.
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 3s
Running Gradle task 'assembleDebug'... 4.6s
Exception: Gradle task assembleDebug failed with exit code 1
Go to your App level build.gradle file in android folder and then change
minSdkVersion 20
to
minSdkVersion flutter.minSdkVersion
Hope it will solve your error
try change minSdkVersion20 -> minSdkVersion 21 (add space before version)

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.