-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
On Android, flutter run
throws "error: package androidx.multidex does not exist"
#148368
Comments
This is related to #98136 |
Possible workaround: https://stackoverflow.com/questions/49886597/multidex-issue-with-flutter/60158352 But I suggest Flutter handles multidex by itself when an existing project is migrated to a newer version. |
@songyang-dev just delete the |
Deleting the |
Thanks for the report @songyang-dev |
Manually deleting worked for me too, but in my opinion this has to work out of the box after upgrading to Flutter 3.22. |
I forgot to specify that the existing project needs to be using multidex support. When you run it on the older version of Flutter, it should say in the console that multidex support is being used. Oh and sorry about the version number. The old version is 3.19. |
Thanks for the update. I will try to setup and replicate this by going back to previous stable versions and have multidex support. I tried with an existing project by running it in 3.19 and upon upgrading it worked fine, but need to see the multidex support for that project, but it'll take a bit time to properly replicate this. Meantime, I'll keep the issue open and label based on the reported behavior, for team's attention. |
In my side, I had to update my android {
defaultConfig {
multiDexEnabled true
}
}
dependencies {
implementation "androidx.multidex:multidex:2.0.1"
} Now everything went back to normal. I had to update my android {
defaultConfig {
multiDexEnabled true
}
}
dependencies {
implementation "androidx.multidex:multidex:2.0.1"
} Now everything went back to normal. The doc mentions
Maybe it works for project that hardcode EDIT: Look at #148368 (comment) before doing this. |
In my project "minSdkVersion 23" is hardcoded in |
Hmm yes, it looks like this was an oversight in https://github.com/flutter/flutter/pull/142267/files - there was logic to create a But the removal of the logic to create the file doesn't remove the file itself, and that file itself relies on imports that were also removed in that PR, it seems. The correct solution here is to delete the file. |
Fixes #148368. See [my comment](#148368 (comment)) for the specific context.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Steps to reproduce
flutter upgrade
to Flutter 3.22.flutter run
on AndroidActual results
The app should launch in the Android emulator.
Logs
Logs
error.log
run.log
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: