How To Run Gradle Build Manually On A Flutter Project
Solution 1:
For posterity I will post my comment as an answer too and I'll elaborate it a bit.
When you create a flutter project there are two new folders created inside the main folder, one is android
and one is ios
.
The android
folder contains the Android native code and all the android configurations, you can handle it as a native android project.
The ios
folder contains the iOS native code and all the ios configurations, it also has the xcworkspace
file which can be opened with Xcode like a normal ios project.
Now you can run platform specific commands in each folder, like i said, the folders contain actual native projects.
So for Android you could do:
cd android/
./gradlew clean
./gradlew build
(clean and build the project)
For iOS you could do:
cd ios/
pod repo update
pod install
(update the pod repo and install the pods)
Just a short reminder, if you want to create apk/ipa from the native folders, don't forget to run flutter build
in the main folder, otherwise you might get outdated code in your apk/ipa.
Solution 2:
Go to the folder where you have gradle installed(the place where your GRADLE_HOME variable points to).
Move inside the dists folder which is inside the wrapper folder
Delete everything that you can find inside the dists folder(cached gradle wrapper)
Run/launch your android flutter project again. It should re-download the gradle wrapper and if you don't have any connection problems your project should run correctly.
Note: I'm having the same problem because of my unstable internet connection. I'm ending up with a corrupted gradle wrapper file and the download doesn't restart.
- If the download gets interrupted and fails to completely download and launch your project repeat all of the steps.
Post a Comment for "How To Run Gradle Build Manually On A Flutter Project"