I previously released an app on Google Play in 2016. The app was created using AppInventor, including using a keystore created by AppInventor.
I am now re-writing this app in Flutter. I have the app working well in Flutter and it's able to run on my phone. I haven't yet successfully made it replaceable of the app on Google Play, which I understand would require using the same keystore and app id.
From what I've read, the following are the changes that are necessary to make my Flutter app be able to replace my new app in Google Play:
- Add a
key.propertiesfile in the/android/folder which points to my old keystore file from AppInventor - Reference the
key.propertiesfile in/android/app/build.gradle - Update the version code (in my case to be version 9 because the previous version of the app was version 8)
- Update both the
namespaceand theapplicationIdin the/android/app/build.gradlefile to be the id that I find in the URL of my app on the playstore - Update the
android:labelproperty in the/android/app/AnrdoidManifest.xmlfile to include the correct name of the app - Update the
buildTypesandsigningConfigsin/android/app/build.gradleas described in the documentation
After making these changes, my app no longer runs on an emulator. Flutter will still compile an APK and it will install on my phone, but when I try to run it, I simply get the error message: Dice has stopped.
My questions are these:
- Have I taken the correct steps to make my app be able to replace my previous app on Google Play?
- The debugger isn't throwing anything because the emulator won't start the app. Are any of the changes I made likely to cause breaking changes? Any thoughts on how I can go about debugging my app to figure out what is causing the error?
Here's the full git diff for the breaking changes (excluding the key.properties file which is untracked):
diff --git a/android/app/build.gradle b/android/app/build.gradle
index f7d59a4..ba9652b 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -14,16 +14,22 @@ if (localPropertiesFile.exists()) {
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
- flutterVersionCode = '1'
+ flutterVersionCode = '9'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
- flutterVersionName = '1.0'
+ flutterVersionName = '9.0'
+}
+
+def keystoreProperties = new Properties()
+def keystorePropertiesFile = rootProject.file('key.properties')
+if (keystorePropertiesFile.exists()) {
+ keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
- namespace "com.example.dice"
+ namespace "appinventor.ai_ansonsavage.DiceRole_Magic8Ball_Extension_Two_Die"
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
@@ -42,7 +48,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
- applicationId "com.example.dice"
+ applicationId "appinventor.ai_ansonsavage.DiceRole_Magic8Ball_Extension_Two_Die"
// 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
@@ -51,13 +57,20 @@ android {
versionName flutterVersionName
}
- 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
- }
- }
+ signingConfigs {
+ release {
+ keyAlias keystoreProperties['keyAlias']
+ keyPassword keystoreProperties['keyPassword']
+ storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
+ storePassword keystoreProperties['storePassword']
+ }
+ }
+ buildTypes {
+ release {
+ signingConfig signingConfigs.release
+ }
+ }
+
}
flutter {
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index dc22b8f..a1533b1 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -1,6 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
+ <uses-permission android:name="android.permission.INTERNET"/>
<application
- android:label="dice"
+ android:label="Dice"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
diff --git a/pubspec.yaml b/pubspec.yaml
index 5b70c5f..874236b 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# 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
+version: 9.0.0+1
environment:
sdk: '>=3.2.3 <4.0.0'
Thanks!