barcode_scan2 icon indicating copy to clipboard operation
barcode_scan2 copied to clipboard

[Bug] Compile SDK version too low

Open dumazy opened this issue 2 months ago • 4 comments

BUG REPORTS WITHOUT PROVIDING THESE INFORMATIONS WILL BE CLOSED DIRECTLY. DON'T REMOVE THE SECTIONS!

Describe the bug We're unable to build our app with compileSdkVersion 35. It throws an issue when we run flutter build appbundle

To Reproduce Steps to reproduce the behavior:

  1. Use barcode_scan2 in a project with Android compileSdkVersion set to 35
  2. run flutter build appbundle

Expected behavior Should build fine

Logs FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':barcode_scan2:checkReleaseAarMetadata'.

A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction 19 issues were found when checking AAR metadata:

   1.  Dependency 'androidx.fragment:fragment:1.7.1' requires libraries and applications that
       depend on it to compile against version 34 or later of the
       Android APIs.

       :barcode_scan2 is currently compiled against android-31.

       Recommended action: Update this project to use a newer compileSdk
       of at least 34, for example 36.

       Note that updating a library or application's compileSdk (which
       allows newer APIs to be used) can be done separately from updating
       targetSdk (which opts the app in to new runtime behavior) and
       minSdk (which determines which devices the app can be installed
       on).

   2.  Dependency 'androidx.window:window:1.2.0' requires libraries and applications that
       depend on it to compile against version 34 or later of the
       Android APIs.

       :barcode_scan2 is currently compiled against android-31.

       Recommended action: Update this project to use a newer compileSdk
       of at least 34, for example 36.

       Note that updating a library or application's compileSdk (which
       allows newer APIs to be used) can be done separately from updating
       targetSdk (which opts the app in to new runtime behavior) and
       minSdk (which determines which devices the app can be installed
       on).

   3.  Dependency 'androidx.window:window-java:1.2.0' requires libraries and applications that
       depend on it to compile against version 34 or later of the
       Android APIs.

       :barcode_scan2 is currently compiled against android-31.

       Recommended action: Update this project to use a newer compileSdk
       of at least 34, for example 36.

       Note that updating a library or application's compileSdk (which
       allows newer APIs to be used) can be done separately from updating
       targetSdk (which opts the app in to new runtime behavior) and
       minSdk (which determines which devices the app can be installed
       on).

   4.  Dependency 'androidx.activity:activity:1.8.1' requires libraries and applications that
       depend on it to compile against version 34 or later of the
       Android APIs.

       :barcode_scan2 is currently compiled against android-31.

       Recommended action: Update this project to use a newer compileSdk
       of at least 34, for example 36.

       Note that updating a library or application's compileSdk (which
       allows newer APIs to be used) can be done separately from updating
       targetSdk (which opts the app in to new runtime behavior) and
       minSdk (which determines which devices the app can be installed
       on).

   5.  Dependency 'androidx.lifecycle:lifecycle-livedata-core-ktx:2.7.0' requires libraries and applications that
       depend on it to compile against version 34 or later of the
       Android APIs.

       :barcode_scan2 is currently compiled against android-31.

       Recommended action: Update this project to use a newer compileSdk
       of at least 34, for example 36.

       Note that updating a library or application's compileSdk (which
       allows newer APIs to be used) can be done separately from updating
       targetSdk (which opts the app in to new runtime behavior) and
       minSdk (which determines which devices the app can be installed
       on).

   6.  Dependency 'androidx.lifecycle:lifecycle-livedata:2.7.0' requires libraries and applications that
       depend on it to compile against version 34 or later of the
       Android APIs.

       :barcode_scan2 is currently compiled against android-31.

       Recommended action: Update this project to use a newer compileSdk
       of at least 34, for example 36.

       Note that updating a library or application's compileSdk (which
       allows newer APIs to be used) can be done separately from updating
       targetSdk (which opts the app in to new runtime behavior) and
       minSdk (which determines which devices the app can be installed
       on).

   7.  Dependency 'androidx.lifecycle:lifecycle-viewmodel:2.7.0' requires libraries and applications that
       depend on it to compile against version 34 or later of the
       Android APIs.

       :barcode_scan2 is currently compiled against android-31.

       Recommended action: Update this project to use a newer compileSdk
       of at least 34, for example 36.

       Note that updating a library or application's compileSdk (which
       allows newer APIs to be used) can be done separately from updating
       targetSdk (which opts the app in to new runtime behavior) and
       minSdk (which determines which devices the app can be installed
       on).

   8.  Dependency 'androidx.lifecycle:lifecycle-livedata-core:2.7.0' requires libraries and applications that
       depend on it to compile against version 34 or later of the
       Android APIs.

       :barcode_scan2 is currently compiled against android-31.

       Recommended action: Update this project to use a newer compileSdk
       of at least 34, for example 36.

       Note that updating a library or application's compileSdk (which
       allows newer APIs to be used) can be done separately from updating
       targetSdk (which opts the app in to new runtime behavior) and
       minSdk (which determines which devices the app can be installed
       on).

   9.  Dependency 'androidx.lifecycle:lifecycle-process:2.7.0' requires libraries and applications that
       depend on it to compile against version 34 or later of the
       Android APIs.

       :barcode_scan2 is currently compiled against android-31.

       Recommended action: Update this project to use a newer compileSdk
       of at least 34, for example 36.

       Note that updating a library or application's compileSdk (which
       allows newer APIs to be used) can be done separately from updating
       targetSdk (which opts the app in to new runtime behavior) and
       minSdk (which determines which devices the app can be installed
       on).

  10.  Dependency 'androidx.lifecycle:lifecycle-viewmodel-savedstate:2.7.0' requires libraries and applications that
       depend on it to compile against version 34 or later of the
       Android APIs.

       :barcode_scan2 is currently compiled against android-31.

       Recommended action: Update this project to use a newer compileSdk
       of at least 34, for example 36.

       Note that updating a library or application's compileSdk (which
       allows newer APIs to be used) can be done separately from updating
       targetSdk (which opts the app in to new runtime behavior) and
       minSdk (which determines which devices the app can be installed
       on).

  11.  Dependency 'androidx.core:core-ktx:1.13.1' requires libraries and applications that
       depend on it to compile against version 34 or later of the
       Android APIs.

       :barcode_scan2 is currently compiled against android-31.

       Recommended action: Update this project to use a newer compileSdk
       of at least 34, for example 36.

       Note that updating a library or application's compileSdk (which
       allows newer APIs to be used) can be done separately from updating
       targetSdk (which opts the app in to new runtime behavior) and
       minSdk (which determines which devices the app can be installed
       on).

  12.  Dependency 'androidx.core:core:1.13.1' requires libraries and applications that
       depend on it to compile against version 34 or later of the
       Android APIs.

       :barcode_scan2 is currently compiled against android-31.

       Recommended action: Update this project to use a newer compileSdk
       of at least 34, for example 36.

       Note that updating a library or application's compileSdk (which
       allows newer APIs to be used) can be done separately from updating
       targetSdk (which opts the app in to new runtime behavior) and
       minSdk (which determines which devices the app can be installed
       on).

  13.  Dependency 'androidx.lifecycle:lifecycle-runtime:2.7.0' requires libraries and applications that
       depend on it to compile against version 34 or later of the
       Android APIs.

       :barcode_scan2 is currently compiled against android-31.

       Recommended action: Update this project to use a newer compileSdk
       of at least 34, for example 36.

       Note that updating a library or application's compileSdk (which
       allows newer APIs to be used) can be done separately from updating
       targetSdk (which opts the app in to new runtime behavior) and
       minSdk (which determines which devices the app can be installed
       on).

  14.  Dependency 'androidx.savedstate:savedstate:1.2.1' requires libraries and applications that
       depend on it to compile against version 33 or later of the
       Android APIs.

       :barcode_scan2 is currently compiled against android-31.

       Recommended action: Update this project to use a newer compileSdk
       of at least 33, for example 36.

       Note that updating a library or application's compileSdk (which
       allows newer APIs to be used) can be done separately from updating
       targetSdk (which opts the app in to new runtime behavior) and
       minSdk (which determines which devices the app can be installed
       on).

  15.  Dependency 'androidx.profileinstaller:profileinstaller:1.3.1' requires libraries and applications that
       depend on it to compile against version 33 or later of the
       Android APIs.

       :barcode_scan2 is currently compiled against android-31.

       Recommended action: Update this project to use a newer compileSdk
       of at least 33, for example 36.

       Note that updating a library or application's compileSdk (which
       allows newer APIs to be used) can be done separately from updating
       targetSdk (which opts the app in to new runtime behavior) and
       minSdk (which determines which devices the app can be installed
       on).

  16.  Dependency 'androidx.tracing:tracing:1.2.0' requires libraries and applications that
       depend on it to compile against version 33 or later of the
       Android APIs.

       :barcode_scan2 is currently compiled against android-31.

       Recommended action: Update this project to use a newer compileSdk
       of at least 33, for example 36.

       Note that updating a library or application's compileSdk (which
       allows newer APIs to be used) can be done separately from updating
       targetSdk (which opts the app in to new runtime behavior) and
       minSdk (which determines which devices the app can be installed
       on).

  17.  Dependency 'androidx.arch.core:core-runtime:2.2.0' requires libraries and applications that
       depend on it to compile against version 33 or later of the
       Android APIs.

       :barcode_scan2 is currently compiled against android-31.

       Recommended action: Update this project to use a newer compileSdk
       of at least 33, for example 36.

       Note that updating a library or application's compileSdk (which
       allows newer APIs to be used) can be done separately from updating
       targetSdk (which opts the app in to new runtime behavior) and
       minSdk (which determines which devices the app can be installed
       on).

  18.  Dependency 'androidx.window.extensions.core:core:1.0.0' requires libraries and applications that
       depend on it to compile against version 33 or later of the
       Android APIs.

       :barcode_scan2 is currently compiled against android-31.

       Recommended action: Update this project to use a newer compileSdk
       of at least 33, for example 36.

       Note that updating a library or application's compileSdk (which
       allows newer APIs to be used) can be done separately from updating
       targetSdk (which opts the app in to new runtime behavior) and
       minSdk (which determines which devices the app can be installed
       on).

  19.  Dependency 'androidx.annotation:annotation-experimental:1.4.0' requires libraries and applications that
       depend on it to compile against version 34 or later of the
       Android APIs.

       :barcode_scan2 is currently compiled against android-31.

       Recommended action: Update this project to use a newer compileSdk
       of at least 34, for example 36.

       Note that updating a library or application's compileSdk (which
       allows newer APIs to be used) can be done separately from updating
       targetSdk (which opts the app in to new runtime behavior) and
       minSdk (which determines which devices the app can be installed
       on).
  • 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 2m 46s

Environment (please complete the following information):

  • [ ] iOS? Version: ...
  • [x] Android? Version: ...
  • [ ] Real Device? Which?: ...
  • [ ] Emulator/Simulator? Which?: ...
  • Version of barcode_scan
  • Output of flutter --version:
Flutter 3.32.7 • channel stable • https://github.com/flutter/flutter.git
Framework • revision d7b523b356 (3 months ago) • 2025-07-15 17:03:46 -0700
Engine • revision 39d6d6e699 (3 months ago) • 2025-07-15 15:39:12 -0700
Tools • Dart 3.8.1 • DevTools 2.45.1

Additional context Our app has compileSdkVersion set to 35

dumazy avatar Oct 09 '25 14:10 dumazy

I'm getting the same error

estrickler avatar Oct 17 '25 22:10 estrickler

I am also facing the same issue. Cannot build the update of my application because of this.

athemvaruas avatar Oct 22 '25 10:10 athemvaruas

You can go and downgrade to: barcode_scan2: ^4.3.3 I'm building this version mit the following SDK settings: compileSdk 36 targetSdkVersion 36.

andro-devs avatar Nov 18 '25 07:11 andro-devs

any update?

AboodHr345 avatar Nov 25 '25 07:11 AboodHr345