Replies: 23 comments
-
Plz use the issue template. |
Beta Was this translation helpful? Give feedback.
-
I have the same problem I've tried your suggestion with flutter version 3.7.11, and android 9 and 12 and it doesn't work
BUILD FAILED in 1s Thanks |
Beta Was this translation helpful? Give feedback.
-
I hava same problem:
BUILD FAILED in 1s Android 13 |
Beta Was this translation helpful? Give feedback.
-
Same problem here... (with Linux tryingo to build android)
|
Beta Was this translation helpful? Give feedback.
-
I had audioplayers 1.0.1 integrated into my app. Then I updated to the latest (4.0.1) and got the same error. I've tried cleaning project and pub cache Nothing helped. |
Beta Was this translation helpful? Give feedback.
-
**/.pub-cache/hosted/pub.flutter-io.cn/audioplayers_android-3.0.1/android/build.gradle // apply plugin: 'com.android.library' |
Beta Was this translation helpful? Give feedback.
-
Can someone post their For a working template see: https://github.com/bluefireteam/audioplayers/blob/main/packages/audioplayers/example/android/build.gradle |
Beta Was this translation helpful? Give feedback.
-
@Gustl22 , please find it attached. android/app/build.gradle
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.my-app.id"
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
lintOptions {
checkReleaseBuilds false
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
} |
Beta Was this translation helpful? Give feedback.
-
@AlexanderKostiev Thanks for providing the file. Seems nothing suspicious in it. Can you compare it with the file in our example project: Pay attention to the kotlin and Build gradle (and maybe Java compatibility?) version. If you still don't succeed, try executing our example, and compare step by step. You also can delete the |
Beta Was this translation helpful? Give feedback.
-
To get rid off this problem you have to update gradle in your project to min 7.3. I also had to change to: distributionUrl=https://services.gradle.org/distributions/gradle-7.4-all.zip in gradle-wrapper |
Beta Was this translation helpful? Give feedback.
-
I have just changed the gradle configuration as stated before:
And I could generate my app for Android in a Windows environment. |
Beta Was this translation helpful? Give feedback.
-
Has there been any progress on this issue? I am having the same problem |
Beta Was this translation helpful? Give feedback.
-
@luomo-pro plz try the solution right above your comment... |
Beta Was this translation helpful? Give feedback.
-
I have successfully run my software and modified gradle to 7.3.1 as described above.
|
Beta Was this translation helpful? Give feedback.
-
Such issue appears on projects with Android Gradle plugin < 4.2, but I would suggest to move to 7.x versions already, like the person above did. Here is a discussion about an issue: flutter/flutter#125181 (comment) |
Beta Was this translation helpful? Give feedback.
-
Even after setting still getting the error
-- Anyone has any suggestions how to fix the issue? |
Beta Was this translation helpful? Give feedback.
-
You changed the version of your Gradle wrapper, which is also something that you need to do. |
Beta Was this translation helpful? Give feedback.
-
in my androig/build.gradle
Has got rid of audio player issue but now I ran into another lib giving me trouble :D |
Beta Was this translation helpful? Give feedback.
-
Had the same issue. But there is a solution on Stack Overflow to this, see The solution is to remove
from the |
Beta Was this translation helpful? Give feedback.
-
This is not a solution, don't mislead other users. Updating Android Gradle Plugin to >= 4.2.0 in android folder of your project is a solution that wouldn't require updating all packages. |
Beta Was this translation helpful? Give feedback.
-
FAILURE: Build failed with an exception.
What could be the possible issue? |
Beta Was this translation helpful? Give feedback.
-
So, what is the standard solution? |
Beta Was this translation helpful? Give feedback.
-
I am getting this error when running
flutter run
The
flutter run --verbose
shows this output:Please guide how to proceed.
My pubspec.yaml file is:
Thanks
Beta Was this translation helpful? Give feedback.
All reactions