Skip to content

Commit

Permalink
Merge pull request #15 from AbdeltwabMF/feature/reduce-apk-size
Browse files Browse the repository at this point in the history
Split apk per abi to reduce the apk size
  • Loading branch information
AbdeltwabMF authored Feb 5, 2023
2 parents e3d96ee + 1cb42f9 commit fd07c89
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ jobs:
run: |
build_number=$(awk -F+ '/version:/ {print $2}' pubspec.yaml)
echo $build_number
flutter build apk --build-name=${{github.ref_name}} --build-number=$build_number --release
flutter build apk --split-per-abi --build-name=${{github.ref_name}} --build-number=$build_number --release
- name: Release artifacts and source code
uses: ncipollo/release-action@v1
with:
artifacts: build/app/outputs/flutter-apk/app-release.apk
artifacts: build/app/outputs/flutter-apk/*
name: ${{github.ref_name}}
makeLatest: true
generateReleaseNotes: true
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
migrate_working_dir/
.metadata
pubspec.lock
.vscode

# IntelliJ related
*.iml
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"dart.flutterSdkPath": "flutter_sdk"
}
19 changes: 19 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,25 @@ android {
signingConfig signingConfigs.debug
}
}
splits {
// Configures multiple APKs based on ABI.
abi {
// Enables building multiple APKs per ABI.
enable true

// By default all ABIs are included, so use reset() and include to specify that we only
// want APKs for x86 and x86_64.

// Resets the list of ABIs that Gradle should create APKs for to none.
reset()

// Specifies a list of ABIs that Gradle should create APKs for.
include "x86", "x86_64", "armeabi", "armeabi-v7a", "arm64-v8a"

// Specifies that we do not want to also generate a universal APK that includes all ABIs.
universalApk true
}
}
}

flutter {
Expand Down
3 changes: 2 additions & 1 deletion lib/screens/about.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:loc/styles/colors.dart';
import 'package:url_launcher/url_launcher.dart';

const String version = 'v0.3.2';
const String version = 'v0.3.3';

class AboutScreen extends StatelessWidget {
const AboutScreen({super.key});
Expand Down Expand Up @@ -173,6 +173,7 @@ class AboutScreen extends StatelessWidget {
top: 8,
left: 8,
right: 8,
bottom: 16,
),
decoration: const BoxDecoration(
color: AppColors.ashGray,
Expand Down
4 changes: 1 addition & 3 deletions lib/utils/location.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ bool shouldPlaySound(BuildContext context) {

if (isInRange(context) == true) {
FlutterRingtonePlayer.playAlarm(
looping: true,
volume: 0.1,
asAlarm: true,
volume: 1.0,
);
return true;
} else {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Free and open-spurce location-based reminder for Android

publish_to: 'none' # Remove this line if you wish to publish to pub.dev

version: 0.3.2+32
version: 0.3.3+33

environment:
sdk: '>=2.18.6 <3.0.0'
Expand Down

0 comments on commit fd07c89

Please sign in to comment.