alan_sorkan
alan_sorkan

Reputation: 1

running flutter build app bundle not working

i made keystore according to flutter documentation using this command keytool -genkey -v -keystore %userprofile%\upload-keystore.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias upload

and I created my key.properties in android/key.properties and this is it's content

storePassword=mypassword 
keyPassword=mypassword
keyAlias=upload
storeFile=d:\key\upload-keystore.jks

this is the path of my keystore file d:\key\upload-keystore.jks

and this is the content of my app\build.gradle

 def keystoreProperties = new Properties()
   def keystorePropertiesFile = rootProject.file('D:\\passport\\android\\key.properties')
   if (keystorePropertiesFile.exists()) {
       keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
   }


android {
    compileSdkVersion 33
    ndkVersion flutter.ndkVersion

    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.raparin.passport"
        // You can update the following values to match your application needs.
        // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
        minSdkVersion 21
        targetSdkVersion 33
        versionCode 1
        versionName "1.0"
    }

  
     signingConfigs {
       release {
           keyAlias keystoreProperties['keyAlias']
           keyPassword keystoreProperties['keyPassword']
           storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
           storePassword keystoreProperties['storePassword']
       }
   }
   buildTypes {
       release {
           signingConfig signingConfigs.release
       }
   }
}

but when i try to run flutter app bundle this error came up

enter image description here

i downloaded and configured all of java,gradle,flutter,keytool and dart

i tried so hard to solve the issue i don't know what is the issue NOTE (flutter -doctor ) has no error or warnings

Upvotes: 0

Views: 771

Answers (1)

Fahmida
Fahmida

Reputation: 1210

In your app/build.gradle, change your def keystorePropertiesFile = rootProject.file('D:\\passport\\android\\key.properties') to this

def keystorePropertiesFile = rootProject.file('key.properties')

Also in your key.properties file specify your storeFile properly. Let me know if that helps.

Upvotes: 0

Related Questions