Skip to content

Made App Size 24MB#174

Merged
K123Ritesh merged 4 commits intoEkaAI-Tech:masterfrom
Gaurav-Kushwaha-1225:AppLightWeight
Jun 12, 2024
Merged

Made App Size 24MB#174
K123Ritesh merged 4 commits intoEkaAI-Tech:masterfrom
Gaurav-Kushwaha-1225:AppLightWeight

Conversation

@Gaurav-Kushwaha-1225
Copy link
Copy Markdown
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
Comment thread android/app/build.gradle

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

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??

Comment thread android/app/build.gradle
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
Copy link
Copy Markdown
Contributor

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
Copy Markdown
Collaborator

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
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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
Copy Markdown
Contributor

@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
Copy Markdown
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 EkaAI-Tech:master Jun 12, 2024
@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