Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Urgent need of a migration guide/documentation for amplitude_flutter 4.0.0 #182

Closed
Dohmanlechx opened this issue Mar 20, 2024 · 4 comments
Closed

Comments

@Dohmanlechx
Copy link

First of all, I am using Amplitude for Flutter.

Today I bumped the Amplitude package version from 3.16.2 to 4.0.0-beta.1 because our app uses the latest Android Gradle version.

Then all the Amplitude code stopped working because you have removed/changed every method and I can't find a migration guide or documentation about it anywhere.

getInstance is no longer available and I can't find a replacement or find out the intended way.

The logEvent method was removed (why?), and it looks like you have replaced it with the track method where you have to pass a BaseEvent which doesn't even have a name parameter. How am I supposed to track a simple event with a name and properties? This is not intuitive to me and I need a guide.

TL;DR

I need a migration guide or documentation for the Flutter code of amplitude_flutter 4.0.0-beta.1.

@Dohmanlechx
Copy link
Author

Found it. Sorry. I'll paste the link here in case someone can't find it:
https://www.docs.developers.amplitude.com/data/sdks/flutter/migration/

@Dohmanlechx
Copy link
Author

However, that link should definitively be in the description of the Flutter package!

@Mercy811
Copy link
Contributor

Hi @Dohmanlechx, Thanks for choosing Amplitude. We are in the progress of updating the Flutter SDK and just release 4.0.0-beta.1. We follow semantic versioning. As you can see it's a major version with breaking changes and also a beta version with potential interfaces changes. The beta version is under the branch beta and you can find the example app under the example directory.

Today I bumped the Amplitude package version from 3.16.2 to 4.0.0-beta.1 because our app uses the latest Android Gradle version.

What is your dependencies section of your pubspec.yaml? If it's amplitude_flutter: ^3, it should not auto upgrade to a new major version even if your app uses the latest Android Gradle version.

@Dohmanlechx
Copy link
Author

Hi @Dohmanlechx, Thanks for choosing Amplitude. We are in the progress of updating the Flutter SDK and just release 4.0.0-beta.1. We follow semantic versioning. As you can see it's a major version with breaking changes and also a beta version with potential interfaces changes. The beta version is under the branch beta and you can find the example app under the example directory.

@Mercy811 Yeah, breaking changes in a major version update is fair. I didn't find any documentation or migration guide, but I eventually found it when I made another Google search. #182 (comment)

What is your dependencies section of your pubspec.yaml? If it's amplitude_flutter: ^3, it should not auto upgrade to a new major version even if your app uses the latest Android Gradle version.

amplitude_flutter ^3 is unable to run with the latest version of Android Gradle. At least I got this error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':amplitude_flutter:compileReleaseKotlin'.
> 'compileReleaseJavaWithJavac' task (current target is 1.8) and 'compileReleaseKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version.
  Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain

It's the reason why I bumped the Amplitude package to 4.0.0. This is explicitly stated in the description:

From Amplitude Flutter v4, we bump up the kotlin version to v1.9.22 to support latest Gradle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants