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

Made App Size 24MB #174

Merged

Conversation

Gaurav-Kushwaha-1225
Copy link
Contributor

  • I have solved the issue Make app lightweight.. #145
  • How I resolved it.
    • Firstly, release app app-release.apk wasn't being compiled after running flutter build apk or flutter build apk --release command in the terminal. It was constantly giving below error.
BUILD FAILED in 8s
[!] Your project requires a newer version of the Kotlin Gradle plugin.
    Find the latest version on https://kotlinlang.org/docs/gradle.html#plugin-and-versions, then update project/android/build.gradle:
    ext.kotlin_version = '<latest-version>'
    • Then, I saw a solution on StackOverFlow to delete the android folder in the project directory and run flutter create .
    • After that, flutter build apk or flutter build apk --release commands worked and gave an .apk file of 35 MB size
    • But, using flutter build apk --split-per-abi command also I got an .apk file of 28 MB size. I read about this command on this StackOverFlow Page 2nd Answer.
    • Then, I reduced the size of some images in assets folders like black.svg, onion.png, etc
    • At last, I got an .apk file of size 24.8 MB.
  • Hope this resolved the Issue Make app lightweight.. #145.

@sapatevaibhav sapatevaibhav requested a review from K123Ritesh June 10, 2024 02:47
@@ -51,36 +42,26 @@ android {

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "vdrs.sappu.lafk.learn"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why you changed package name man??

// 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
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does multidex enabling really needed??

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope will remove it since app supports minSdk 21

@@ -1,6 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change in label??

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Icon Changed Why??

@K123Ritesh
Copy link
Collaborator

@sapatevaibhav @Gaurav-Kushwaha-1225 changed icon app label and package name also this is needed or he did it by mistake ??

@Gaurav-Kushwaha-1225
Copy link
Contributor Author

Hi @K123Ritesh,

In above mentioned comment, after running flutter create . after deleting the android folder, since the usual command for generating app-release.apk i.e. flutter build apk wasn't working, a new android folder was created which has default package name, default icon, etc.

But it appears shocking that even during testing the app after the default android folder was generated the app's icon didn't change and was the a\same as before.

Anyways, I will make sure this time and push further commits to resolve this matter.

Thank you.

@sapatevaibhav sapatevaibhav requested a review from K123Ritesh June 12, 2024 08:58
@K123Ritesh K123Ritesh merged commit 993eee5 into VaibhavCodeClub:master Jun 12, 2024
1 check passed
@sapatevaibhav sapatevaibhav added gssoc Girl Script Summer of Code level3 Complex to solve issues for GSSoC'24 labels Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gssoc Girl Script Summer of Code level3 Complex to solve issues for GSSoC'24
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants