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

APK size is too big #94

Open
rajiniyadav opened this issue Sep 13, 2024 · 10 comments
Open

APK size is too big #94

rajiniyadav opened this issue Sep 13, 2024 · 10 comments

Comments

@rajiniyadav
Copy link

Hello,

We have implemented Genius SDK in our app, We are using app center to generate and distribute the builds.

We are facing the apk size issue, how to reduce the apk size.

Added below in my app. gradle file
ndkVersion '26.1.10909125'
defaultConfig{
ndk {
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
}
}
@guillaume-tgl

@guillaume-tgl
Copy link
Contributor

Did you check this troubleshooting answer?
Can you analyze the size of your APK with Android Studio and send us a screenshot showing the size of the native libraries?

@rajiniyadav
Copy link
Author

rajiniyadav commented Sep 13, 2024

In android studio it is showing around 116 MB
Here you go analyze apk
image

@rajiniyadav
Copy link
Author

Here app center build details,
image

@rajiniyadav
Copy link
Author

Installed NDK
image

@rajiniyadav
Copy link
Author

@guillaume-tgl

@guillaume-tgl
Copy link
Contributor

Ok, so there's a difference in size when you build on your machine and in App Center, right?
Do you have the logs of the build on AppCenter?
You need to make sure the version of the NDK used on the machine building the app (so AppCenter here) matches the version you have in your Gradle file so that the native libraries get properly stripped from debugging symbols.

Is your app a native Android app or does it use a crossplatform framework?

@rajiniyadav
Copy link
Author

image
I can see the same NDK version in app center logs and Android studio manager

My app is Native development using Android Java.

@guillaume-tgl
Copy link
Contributor

Do you see the stripReleaseDebugSymbols Gradle task result in AppCenter logs?

@rajiniyadav
Copy link
Author

Here find the logs,

Task :app-kantar:stripUkglobalReleaseDebugSymbols 2024-09-12T09:17:56.7175210Z Unable to strip the following libraries, packaging them as they are: libgssdk-core.so, libgssdk-ocr.so, libimage_processing_util_jni.so, librealm-jni.so, libtensorflowlite_jni.so. 2024-09-12T09:17:56.7915870Z 2024-09-12T09:17:56.7917700Z > Task :app-kantar:processUkglobalReleaseJavaRes NO-SOURCE 2024-09-12T09:17:56.7918050Z 2024-09-12T09:17:56.7920030Z > Task :app-kantar:extractUkglobalReleaseNativeSymbolTables 2024-09-12T09:17:56.7920890Z Unable to extract native debug metadata from /Users/runner/work/1/s/app-kantar/build/intermediates/merged_native_libs/ukglobalRelease/out/lib/armeabi-v7a/libgssdk-core.so because unable to locate the objcopy executable for the armeabi-v7a ABI. 2024-09-12T09:17:56.7922180Z Unable to extract native debug metadata from /Users/runner/work/1/s/app-kantar/build/intermediates/merged_native_libs/ukglobalRelease/out/lib/armeabi-v7a/libgssdk-ocr.so because unable to locate the objcopy executable for the armeabi-v7a ABI. 2024-09-12T09:17:56.8924740Z Unable to extract native debug metadata from /Users/runner/work/1/s/app-kantar/build/intermediates/merged_native_libs/ukglobalRelease/out/lib/armeabi-v7a/libtensorflowlite_jni.so because unable to locate the objcopy executable for the armeabi-v7a ABI. 2024-09-12T09:17:56.9872830Z Unable to extract native debug metadata from /Users/runner/work/1/s/app-kantar/build/intermediates/merged_native_libs/ukglobalRelease/out/lib/armeabi-v7a/libimage_processing_util_jni.so because unable to locate the objcopy executable for the armeabi-v7a ABI. 2024-09-12T09:17:56.9902860Z Unable to extract native debug metadata from /Users/runner/work/1/s/app-kantar/build/intermediates/merged_native_libs/ukglobalRelease/out/lib/armeabi-v7a/librealm-jni.so because unable to locate the objcopy executable for the armeabi-v7a ABI. 2024-09-12T09:17:56.9904330Z Unable to extract native debug metadata from /Users/runner/work/1/s/app-kantar/build/intermediates/merged_native_libs/ukglobalRelease/out/lib/x86/libgssdk-core.so because unable to locate the objcopy executable for the x86 ABI. 2024-09-12T09:17:56.9908760Z Unable to extract native debug metadata from /Users/runner/work/1/s/app-kantar/build/intermediates/merged_native_libs/ukglobalRelease/out/lib/x86/libgssdk-ocr.so because unable to locate the objcopy executable for the x86 ABI. 2024-09-12T09:17:56.9912440Z Unable to extract native debug metadata from /Users/runner/work/1/s/app-kantar/build/intermediates/merged_native_libs/ukglobalRelease/out/lib/x86/libtensorflowlite_jni.so because unable to locate the objcopy executable for the x86 ABI. 2024-09-12T09:17:57.0402200Z Unable to extract native debug metadata from /Users/runner/work/1/s/app-kantar/build/intermediates/merged_native_libs/ukglobalRelease/out/lib/x86/libimage_processing_util_jni.so because unable to locate the objcopy executable for the x86 ABI. 2024-09-12T09:17:57.0405230Z Unable to extract native debug metadata from /Users/runner/work/1/s/app-kantar/build/intermediates/merged_native_libs/ukglobalRelease/out/lib/x86/librealm-jni.so because unable to locate the objcopy executable for the x86 ABI. 2024-09-12T09:17:57.0409020Z Unable to extract native debug metadata from /Users/runner/work/1/s/app-kantar/build/intermediates/merged_native_libs/ukglobalRelease/out/lib/arm64-v8a/libgssdk-core.so because unable to locate the objcopy executable for the arm64-v8a ABI. 2024-09-12T09:17:57.0411640Z Unable to extract native debug metadata from /Users/runner/work/1/s/app-kantar/build/intermediates/merged_native_libs/ukglobalRelease/out/lib/arm64-v8a/libgssdk-ocr.so because unable to locate the objcopy executable for the arm64-v8a ABI. 2024-09-12T09:17:57.0413650Z Unable to extract native debug metadata from /Users/runner/work/1/s/app-kantar/build/intermediates/merged_native_libs/ukglobalRelease/out/lib/arm64-v8a/libtensorflowlite_jni.so because unable to locate the objcopy executable for the arm64-v8a ABI. 2024-09-12T09:17:57.0416160Z Unable to extract native debug metadata from /Users/runner/work/1/s/app-kantar/build/intermediates/merged_native_libs/ukglobalRelease/out/lib/arm64-v8a/libimage_processing_util_jni.so because unable to locate the objcopy executable for the arm64-v8a ABI. 2024-09-12T09:17:57.0418420Z Unable to extract native debug metadata from /Users/runner/work/1/s/app-kantar/build/intermediates/merged_native_libs/ukglobalRelease/out/lib/arm64-v8a/librealm-jni.so because unable to locate the objcopy executable for the arm64-v8a ABI. 2024-09-12T09:17:57.0422620Z Unable to extract native debug metadata from /Users/runner/work/1/s/app-kantar/build/intermediates/merged_native_libs/ukglobalRelease/out/lib/x86_64/libgssdk-core.so because unable to locate the objcopy executable for the x86_64 ABI. 2024-09-12T09:17:57.1004780Z Unable to extract native debug metadata from /Users/runner/work/1/s/app-kantar/build/intermediates/merged_native_libs/ukglobalRelease/out/lib/x86_64/libgssdk-ocr.so because unable to locate the objcopy executable for the x86_64 ABI. 2024-09-12T09:17:57.1009490Z Unable to extract native debug metadata from /Users/runner/work/1/s/app-kantar/build/intermediates/merged_native_libs/ukglobalRelease/out/lib/x86_64/libtensorflowlite_jni.so because unable to locate the objcopy executable for the x86_64 ABI. 2024-09-12T09:17:57.1012340Z Unable to extract native debug metadata from /Users/runner/work/1/s/app-kantar/build/intermediates/merged_native_libs/ukglobalRelease/out/lib/x86_64/libimage_processing_util_jni.so because unable to locate the objcopy executable for the x86_64 ABI. 2024-09-12T09:17:57.1039780Z Unable to extract native debug metadata from /Users/runner/work/1/s/app-kantar/build/intermediates/merged_native_libs/ukglobalRelease/out/lib/x86_64/librealm-jni.so because unable to locate the objcopy executable for the x86_64 ABI. 2024-09-12T09:17:57.1041900Z

@guillaume-tgl
Copy link
Contributor

Unable to strip the following libraries, packaging them as they are: libgssdk-core.so, libgssdk-ocr.so, libimage_processing_util_jni.so, librealm-jni.so, libtensorflowlite_jni.so

This probably means that the NDK version that you specify in your build.gradle file (26.1.10909125 according to your previous messages) is not present on the AppCenter machine when it's building your app. You either need to install this NDK version on the AppCenter machine if you can control it or set the NDK version installed on the AppCenter machine in your build.gradle file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants