Launching libmain.dart on Android SDK built for x86 in debug mode…

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:package_info_plus:compileDebugJavaWithJavac’.

error: invalid source release: 17

  • 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

BUILD FAILED in 1m 23s
Running Gradle task ‘assembleDebug’… 86.6s
Error: Gradle task assembleDebug failed with exit code 1

I have tried and changed the jdk version but nothing happens

name: grihum
description: "A new Flutter project."
# The following line prevents the package from being accidentally published to
# using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at
# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
# Read more about iOS versioning at
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.0+1

  sdk: '>=3.2.0 <4.0.0'

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on To see which dependencies have newer
# versions available, run `flutter pub outdated`.
    sdk: flutter

  cupertino_icons: ^1.0.2
  get: ^4.6.6
  animated_splash_screen: ^1.3.0
  http: ^1.2.0
  shared_preferences: ^2.2.2
  flutter_secure_storage: ^9.0.0
  image: ^4.1.7
  cached_network_image: ^3.3.1
  path_provider: ^2.1.2
  screenshot: ^2.1.0
  flutter_image: ^4.1.11
  flutter_file_dialog: ^3.0.2
  dio: ^5.4.1
  share_plus: ^8.0.2
  image_picker: ^1.0.7
  file_picker: ^6.2.0
  dotenv: ^4.2.0
  crypto: ^3.0.3
  image_gallery_saver: ^2.0.3
  video_player: ^2.8.3
  chewie: ^1.7.5
  shimmer: ^3.0.0
  permission_handler: ^11.3.0
  connectivity_plus: ^5.0.2
  native_video_player: ^1.3.1
  flutter_pdfview: ^1.3.2
  pdf: ^3.10.8
  get_storage: ^2.1.1
  flutter_launcher_icons: ^0.13.1
  flutter_local_notifications: ^17.0.0
  flutter_dotenv: ^5.1.0
  dotted_border: ^2.1.0
  loading_animation_widget: ^1.2.1
  package_info_plus: ^5.0.1
  android: "launcher_icon"
  ios: true
  image_path_android: "assets/logo.jpeg"
  image_path_ios: "assets/logo.jpeg"
  remove_alpha_ios: true

    sdk: flutter
  flutter_lints: ^3.0.1
  flutter_launcher_icons: ^0.13.1

# For information on the generic Dart part of this file, see the
# following page:

# The following section is specific to Flutter packages.

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
         - assets/
         - .env

  # An image asset can refer to one or more resolution-specific "variants", see

  # For details regarding adding assets from package dependencies, see

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
    - family: Times
        - asset: fonts/times-ro.ttf
        # - asset: fonts/Schyler-Italic.ttf
          # style: Regular
    - family: serif
        - asset: fonts/serif/AbhayaLibre-Bold.ttf
        - asset: fonts/serif/AbhayaLibre-ExtraBold.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  # For details regarding fonts from package dependencies,
  # see

plugins {
    id ""
    id "kotlin-android"
    id "dev.flutter.flutter-gradle-plugin"

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'

android {
    namespace "com.example.grihum"
    compileSdkVersion 34
    ndkVersion flutter.ndkVersion
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8

    kotlinOptions {
        jvmTarget = '1.8'

    sourceSets { += 'src/main/kotlin'

    defaultConfig {
        applicationId "com.example.grihum"
        minSdkVersion 26
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName

    buildTypes {
        release {
            signingConfig signingConfigs.debug

flutter {
    source '../..'

dependencies {

New contributor

Yogesh Kumawat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.