App build has warning issues "Unable to strip the following libraries"
See original GitHub issueDescription
When I build the simple app only shows “Hello world”, I’ve got the following warning, and the size of my app reaches 32MB.
I used the build command ./gradlew assembleRelease
and also used Android Studio. I got the same warning in both cases.
Android Studio has installed the NDK(side by side) to strip these packages.
How can I fix this issue?
> Task :app:stripDebugDebugSymbols
Unable to strip the following libraries, packaging them as
they are: libbetter.so, libc++_shared.so, libevent-2.1.so,
Version
0.66.4
Output of npx react-native info
info Fetching system and libraries information…
System:
OS: Windows 10 10.0.18362
CPU: (8) x64 Intel® Core™ i5-10210U CPU @ 1.60GHz
Memory: 1.97 GB / 11.85 GB
Binaries:
Node: 14.17.4 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.14.14 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: Version 4.2.0.0 AI-202.7660.26.42.7351085
Visual Studio: Not Found
Languages:
Java: Not Found
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.66.4 => 0.66.4
react-native-windows: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
I created the app with this command.
npx react-native init sample
I installed react-native-geolocation-service.
I build the app with ./gradlew assembleRelease
But I’ve got a warning.
Snack, code example, screenshot, or link to a repository
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:7
Top GitHub Comments
If you are using Gradle build tools version 4 or higher, adding android:extractNativeLibs=“true” to application as per android documentation, may solve the issue.
https://developer.android.com/studio/releases/gradle-plugin#extractNativeLibs
The NDK version set by
ndkVersion
insideandroid/build.gradle
must be installed using Android Studio SDK Tools.ndkVersion
insideandroid/build.gradle
android/build.gradle
and then hit the Apply button.Wait to finish installing and then clean the app with something like
cd android && ./gradlew clean && cd ..
and then rebuild it.This fixed this issue for me and there are no “Unable to strip the following libraries” errors any more after clean builds.