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.

Build from source doesn't generate same .so files

See original GitHub issue

Description

Hey! We recently needed to patch this package to try fixing ANRs on android, but the rn-patch of native didn’t work. We enabled the flag to force rebuild native to include patch changes too. While it works and successfully patches, the .so file generated is smaller in size compared to the .so files shipped with npm package. The app is still working and no animation issues so far. But what could be the reason of smaller .so files generated?

Screenshot 2022-10-27 at 20 44 51

Steps to reproduce

  1. Enable gradle flag to force rebuild reanimated reanimated = [ buildFromSource: true ]
  2. Generate 2 apks with buildFromSource true and false.
  3. Diff apks in Android Studio and compare .so file sizes

Snack or a link to a repository

Reanimated version

2.9.1

React Native version

0.68.3

Platforms

Android

JavaScript runtime

Hermes

Workflow

No response

Architecture

Paper (Old Architecture)

Build type

Release mode

Device

Real device

Device model

No response

Acknowledgements

Yes

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:26 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
androidevelopercommented, Nov 4, 2022

When npm package is built (I guess this file https://github.com/software-mansion/react-native-reanimated/blob/2.9.1/createNPMPackage.sh), it doesn’t have minSdkVersion passed and takes the default 16 specified in gradle file

0reactions
androidevelopercommented, Nov 11, 2022

Found this link where it describes how this works: https://developer.android.com/ndk/guides/application_mk#app_platform

APP_PLATFORM declares the Android API level this application is built against and corresponds to the application’s minSdkVersion.

I still think that reanimated is targeting min sdk 16 and when we rebuild we target min sdk 21 and that explains the diff

Read more comments on GitHub >

github_iconTop Results From Across the Web

gcc: Not able to create .so from object files - Stack Overflow
I am trying to create .so dynamic library from *.o files and facing below issue. This is not that simple. In practice, you...
Read more >
linux - Can't find .so in the same directory as the executable?
Here's one way to do it: $ make CFLAGS="-fPIC" LDFLAGS="-Wl,-rpath '-Wl,\$\$ORIGIN'" $ objdump ...
Read more >
3. Shared Libraries - The Linux Documentation Project
Shared Libraries. Shared libraries are libraries that are loaded by programs when they start. When a shared library is installed properly, all programs...
Read more >
GNU make
This makefile does not specify anything to be done for them—the ' .c ' and ' .h ' files are not the targets...
Read more >
Create and use your own Dynamic Link Library (C++)
Use C++ to create a Windows dynamic-link library (DLL) in Visual ... The name for the main source file is the same as...
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