Serhii
Serhii

Reputation: 73

Project transfer and update

I have a project on Flutter (v3.3.4) for Android (v10), personal (not public) installed manually via APK file. I moved the project to a new device (laptop) with fresh Flutter (v3.5) installed. Made a new build (APK) and tried to update the application on an Android device that already has a previous version. However, I got a rejection: Failed to update the app.

How can I avoid such problems? And so that in the future, when the application gets into Google Play, there are no complications during the update.

I tried to modify the pubspec.yaml file. Changed the SDK version from >=3.3.4 <4.0.0 to 3.5.0 and started the package update. I also tried to create a new project with the same name and transfer all the functionality. However, all these attempts were futile, I still can't update my app.

Interestingly, if you install the application on another device (Android), everything will be fine. Or if you delete the old app and install the new one, that will work too. Therefore, I think that the problem is not in the application. It seems that the phone (Android) doesn't want to update an app that was built on one version of Flutter (v3.3) and then on another version of Flutter (v3.5).

Upvotes: 1

Views: 46

Answers (1)

Serhii
Serhii

Reputation: 73

After many attempts to understand the cause of the problem, I was never able to do so. However, later I found a solution!

I decided to test this by using keystores. I used the instructions from Create an upload keystore to create and connect the test keystore.

  • Use keytool to generate a key.
  • Create file key.properties with propertys.
  • Add configuration to build.gradle.

As before, I created an application on SDK 3.3.4, created an assembly and installed it on Android. After that, moved the project to another machine, updated the pubspec.yaml file (SDK 3.5.0) and updated all packages (flutter pub get). Built the build and successfully updated the app on the Android device.

So. Use a keystore for Android apps so you don't have to worry about updating or moving your projects. Even if it is a local project that you do not plan to upload to the Google Play.

Upvotes: 0

Related Questions