Closed nabtron closed 11 months ago
Plz use the issue template.
Also did you try flutter pub cache clean
followed by flutter pub get
.
What OS? What flutter version?
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 `FAILURE: Build failed with an exception.
Where: Build file '/Users/.../.pub-cache/hosted/pub.dev/audioplayers_android-3.0.1/android/build.gradle' line: 31
What went wrong: A problem occurred evaluating project ':audioplayers_android'.
No signature of method: build_6id6i07gggvsff2lwuabj4kpi.android() is applicable for argument types: (build_6id6i07gggvsff2lwuabj4kpi$_run_closure2) values: [build_6id6i07gggvsff2lwuabj4kpi$_run_closure2@307bb301]
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`
Thanks
I hava same problem: problem: FAILURE: Build failed with an exception.
Where: Build file 'C:\Users\Administrator\AppData\Local\Pub\Cache\hosted\pub.dev\audioplayers_android-3.0.1\android\build.gradle' line: 44
What went wrong: A problem occurred evaluating project ':audioplayers_android'.
Could not find method disable() for arguments [InvalidPackage] on task ':audioplayers_android:lint' of type com.android.build.gradle.tasks.LintGlobalTask.
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
Android 13 Flutter (Channel master, 3.10.0-5.0.pre.1, on Microsoft Windows [版本 10.0.22621.1555], locale zh-CN) • Flutter version 3.10.0-5.0.pre.1 on channel master at D:\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 954760829b (25 hours ago), 2023-04-12 22:42:12 -0400 • Engine revision 39ec48fd7e • Dart version 3.0.0 (build 3.0.0-437.0.dev) • DevTools version 2.23.1
Same problem here... (with Linux tryingo to build android)
>
> $ flutter build appbundle --build-name=2.4.1 --build-number=020401 --release
>
> 💪 Building with sound null safety 💪
>
>
> FAILURE: Build failed with an exception.
>
> * Where:
> Build file '/home/macplinio/.pub-cache/hosted/pub.dev/audioplayers_android-3.0.1/android/build.gradle' line: 31
>
> * What went wrong:
> A problem occurred evaluating project ':audioplayers_android'.
> > No signature of method: build_dqixdb5wjjyvp8dlev7u2si6w.android() is applicable for argument types: (build_dqixdb5wjjyvp8dlev7u2si6w$_run_closure2) values: [build_dqixdb5wjjyvp8dlev7u2si6w$_run_closure2@1f0f1c8e]
>
> * 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.
+1
I had audioplayers 1.0.1 integrated into my app. Then I updated to the latest (4.0.1) and got the same error. When I rolled back to 1.0.1 the error was gone.
I've tried cleaning project and pub cache Reopening VSCode Upgrading Dart and Flutter to the latest versions
Nothing helped. So, for now, keeping 1.0.1 and waiting for the resolution
**/.pub-cache/hosted/pub.flutter-io.cn/audioplayers_android-3.0.1/android/build.gradle
// apply plugin: 'com.android.library'
Can someone post their build.gradle
file in android/app
folder? Seems like you aren't allowed to use compileKotlin
in newer versions :)
See: https://youtrack.jetbrains.com/issue/KT-45183
For a working template see: https://github.com/bluefireteam/audioplayers/blob/main/packages/audioplayers/example/android/build.gradle
@Gustl22 , please find it attached.
```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" } ```
@AlexanderKostiev Thanks for providing the file. Seems nothing suspicious in it. Can you compare it with the file in our example project: https://github.com/bluefireteam/audioplayers/blob/main/packages/audioplayers/example/android/app/build.gradle https://github.com/bluefireteam/audioplayers/blob/main/packages/audioplayers/example/android/build.gradle
Pay attention to the kotlin and Build gradle (and maybe Java compatibility?) version.
classpath 'com.android.tools.build:gradle:7.3.1'
(android/build.gradle)
If you still don't succeed, try executing our example, and compare step by step. You also can delete the android
folder and recreate it with flutter create .
, but this would delete some customization steps in Android of course.
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
I have just changed the gradle configuration as stated before:
classpath 'com.android.tools.build:gradle:7.3.1'
distributionUrl=https://services.gradle.org/distributions/gradle-7.4-all.zip
And I could generate my app for Android in a Windows environment. I will check Linux and post the results here later! Thanks!
Has there been any progress on this issue? I am having the same problem
@luomo-pro plz try the solution right above your comment...
I have successfully run my software and modified gradle to 7.3.1 as described above. However, after the modification, I also encountered a lot of problems, here to say, I hope it will help others:
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: https://github.com/flutter/flutter/issues/125181#issuecomment-1525894244
Even after setting
distributionUrl=https://services.gradle.org/distributions/gradle-7.4-all.zip
still getting the error
No signature of method: build_6kvx1qs7mu428qnu2nzhgyojp.android() is applicable for argument types: (build_6kvx1qs7mu428qnu2nzhgyojp$_run_closure2) values: [build_6kvx1qs7mu428qnu2nzhgyojp$_run_closure2@2b761be6]
-- Anyone has any suggestions how to fix the issue?
Even after setting
distributionUrl=https://services.gradle.org/distributions/gradle-7.4-all.zip
You changed the version of your Gradle wrapper, which is also something that you need to do.
Android Gradle Plugin version should be changed in build.gradle
of Android folder of your project.
in my androig/build.gradle putting
ext.kotlin_version = '1.7.10'
and dependencies to classpath 'com.android.tools.build:gradle:7.3.1'
Has got rid of audio player issue but now I ran into another lib giving me trouble :D
project ':flutter_config' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61
Had the same issue. But there is a solution on Stack Overflow to this, see
The solution is to remove
lint {
disable 'InvalidPackage'
}
from the .pub-cache/hosted/pub.dev/audioplayers_android-3.0.1/android/build.gradle
gradle file.
Had the same issue. But there is a solution on Stack Overflow to this, see
The solution is to remove
lint { disable 'InvalidPackage' }
from the
.pub-cache/hosted/pub.dev/audioplayers_android-3.0.1/android/build.gradle
gradle file.
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.
FAILURE: Build failed with an exception.
Could not load compiled classes for build file 'C:\Users\imroh\AppData\Local\Pub\Cache\hosted\pub.dev\audioplayers_android-3.0.2\android\build.gradle' from cache. Failed to notify project evaluation listener. Could not get unknown property 'android' for project ':audioplayers_android' of type org.gradle.api.Project. Could not get unknown property 'android' for project ':audioplayers_android' of type org.gradle.api.Project. pubsec.txt
What could be the possible issue?
So, what is the standard solution?
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