Open 4bSolutionsLLP opened 3 years ago
had the same problem and only in debug mode works.
Same issue here...
Same here I finaly solved this by using the second method provided. You need first to generate keystore if you do not already have one and configure it following this.
So i end up with:
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
compileSdkVersion 30
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.soupe.my_app"
minSdkVersion 21
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
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
signingConfig signingConfigs.release
minifyEnabled true
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
Esto funciona para mi, Trabajando desde MacOs, en Android tanto para Release en APK como para Release con appbundle
Mi configuracion esta de la siguiente forma:
dependencies: flutter: sdk: flutter ssh: ^0.0.7
environment: sdk: ">=2.7.0 <3.0.0"
Quizas suene tonto pero igual lo voy a decir, no poner en dev_dependencies quizas aveces se nos van las luces como me paso a mi.
buildTypes {
release {
minifyEnabled true
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
y como dice el post en el archivo que debes crear 'proguard-rules.pro'
-keep class io.flutter.app. { *; } -keep class io.flutter.plugin.* { ; } -keep class io.flutter.util. { *; } -keep class io.flutter.view. { *; } -keep class io.flutter.* { ; } -keep class io.flutter.plugins. { *; } -keep class com.jcraft.* { ; }
Luego haz un flutter clean y intentas como dije anteriormente, eso me funciona perfecto, salu2.
Same issue here! Both workarounds didnt work! :(
In the latest version of Flutter/Android Studio, when building an android release version, the no-shrink workaround no longer works. At runtime, I get PlatformException(connection_failure.... on physical devices. Emulator in debug mode is ok.
Is there any way round this?