Flutterlocation: 13:9-17:56: AAPT: error: attribute android:foregroundServiceType not found.

Created on 30 Dec 2020  ·  4Comments  ·  Source: Lyokone/flutterlocation

Launching lib/main.dart on MI 8 in debug mode...
Running Gradle task 'assembleDebug'...
Plugin project :location_web not found. Please update settings.gradle.

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
    /Users/dayuyu/BrainCo/module_headband/example/build/location/intermediates/library_manifest/debug/AndroidManifest.xml:13:9-17:56: AAPT: error: attribute android:foregroundServiceType 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 26s
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 focus1_plugin...
Running Gradle task 'assembleAarRelease'...
✓ Built build/app/outputs/repo.
Building plugin audioplayers...
Running Gradle task 'assembleAarRelease'...

/Users/dayuyu/.pub-cache/hosted/http%58%47%4747.111.166.90%588081/audioplayers-0.16.1/android/src/main/java/xyz/luan/audioplayers/AudioplayersPlugin.java:6: 错误: 找不到符号
import androidx.annotation.NonNull;
^
符号: 类 NonNull
位置: 程序包 androidx.annotation
/Users/dayuyu/.pub-cache/hosted/http%58%47%4747.111.166.90%588081/audioplayers-0.16.1/android/src/main/java/xyz/luan/audioplayers/AudioplayersPlugin.java:46: 错误: 找不到符号
public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) {
^
符号: 类 NonNull
位置: 类 AudioplayersPlugin
/Users/dayuyu/.pub-cache/hosted/http%58%47%4747.111.166.90%588081/audioplayers-0.16.1/android/src/main/java/xyz/luan/audioplayers/AudioplayersPlugin.java:55: 错误: 找不到符号
public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {}
^
符号: 类 NonNull
位置: 类 AudioplayersPlugin
3 个错误

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':compileReleaseJavaWithJavac'.

    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. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 2s

Exception: The plugin audioplayers could not be built due to the issue above.

Most helpful comment

A possible workaround:

  1. Follow these instructions https://github.com/flutter/flutter/issues/57777#issuecomment-632609059
  2. Open android/app/build.gradle and update compileSdkVersion and targetSdkVersion to API Level 30 (or 29)
  3. flutter clean and build again

All 4 comments

Same Issue

Same issue here as well!

same issue

A possible workaround:

  1. Follow these instructions https://github.com/flutter/flutter/issues/57777#issuecomment-632609059
  2. Open android/app/build.gradle and update compileSdkVersion and targetSdkVersion to API Level 30 (or 29)
  3. flutter clean and build again
Was this page helpful?
0 / 5 - 0 ratings