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

[Android] Remove debug info in release build to reduce package size #283

Merged
merged 7 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ jobs:
echo "CORE_SIZE_ARM64=$CORE_SIZE_ARM64" >> $GITHUB_ENV
echo "CORE_SIZE_ARMV7=$CORE_SIZE_ARMV7" >> $GITHUB_ENV
echo "CORE_SIZE_X64=$CORE_SIZE_X64" >> $GITHUB_ENV
dir ${{ github.workspace}}/packages/opencv_core/android/.cxx

# Build full APK for opencv_core (universal)
- name: opencv_core full apk size
Expand All @@ -135,6 +136,7 @@ jobs:
echo "DART_SIZE_ARM64=$DART_SIZE_ARM64" >> $GITHUB_ENV
echo "DART_SIZE_ARMV7=$DART_SIZE_ARMV7" >> $GITHUB_ENV
echo "DART_SIZE_X64=$DART_SIZE_X64" >> $GITHUB_ENV
dir ${{ github.workspace}}/packages/opencv_core/android/.cxx

# Build full APK for opencv_dart (universal)
- name: opencv_dart full apk size
Expand Down Expand Up @@ -200,7 +202,11 @@ jobs:
with:
name: android-size-report
path: android_size_report.json

- name: Upload apk
uses: actions/upload-artifact@v4
with:
name: opencv_core-arm64-v8a-release.apk
path: packages/opencv_core/example/build/app/outputs/flutter-apk/app-arm64-v8a-release.apk

linux:
name: linux-size-comparison
Expand Down
10 changes: 10 additions & 0 deletions packages/opencv_core/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,15 @@ android {
"-DDARTCV_WITH_GAPI=OFF"
}
}

buildTypes {
release {
externalNativeBuild {
cmake {
arguments "-DCMAKE_BUILD_TYPE=Release"
}
}
}
}
}
}
28 changes: 14 additions & 14 deletions packages/opencv_core/images/opencv_core_size_report.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions packages/opencv_dart/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,15 @@ android {
"-DDARTCV_WITH_GAPI=OFF"
}
}

buildTypes {
release {
externalNativeBuild {
cmake {
arguments "-DCMAKE_BUILD_TYPE=Release"
}
}
}
}
}
}
28 changes: 14 additions & 14 deletions packages/opencv_dart/images/opencv_dart_size_report.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading