question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

App build has warning issues "Unable to strip the following libraries"

See original GitHub issue

Description

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:open
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

3reactions
thejadasaricommented, Jan 21, 2022

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

2reactions
clytrascommented, Jul 28, 2022

The NDK version set by ndkVersion inside android/build.gradle must be installed using Android Studio SDK Tools.

  1. Check the ndkVersion inside android/build.gradle
buildscript {
    ext {
        buildToolsVersion = "31.0.0"
        minSdkVersion = 21
        compileSdkVersion = 31
        targetSdkVersion = 31

        if (System.properties['os.arch'] == "aarch64") {
            // For M1 Users we need to use the NDK 24 which added support for aarch64
            ndkVersion = "24.0.8215888"
        } else {
            // Otherwise we default to the side-by-side NDK version from AGP.
            ndkVersion = "21.4.7075529"
        }
    }
}
  1. Open Android Studio 🡪 Settings 🡪 Android SDK 🡪 SDK Tools, check the “Show Package Details” at bottom right and then under NDK (Side by side) check the exact version to match the one inside android/build.gradle and then hit the Apply button. android studio - sdk tools

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Studio : Missing Strip Tool - Stack Overflow
Unable to strip library 'lib.so' due to missing strip tool for ABI 'ARMEABI'. Packaging it as is. Please help me on how to...
Read more >
Debug symbols are not stripped when ndkVesion is not ...
When AGP builds the app module and tries to bundle native libraries (*.so), it fails to strip debug symbols so the final aab/apk...
Read more >
Andriod build issue after NDK version update
Still the error persist, seeing support help to see you have any solution. Error: Task :app:stripQaReleaseDebugSymbols FAILED WARNING: Support for ...
Read more >
Unable to build apk : r/flutterhelp - Reddit
Execution failed for task ':app:lint'. > Lint found errors in the project; aborting build. Fix the issues identified by lint, or add the ......
Read more >
List of the armlink error and warning messages - Arm Developer
The ARM Compiler Errors and Warnings Reference Guide provides lists of the errors ... The following example fails with Fatal error: L6004U: Missing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found