Build from source doesn't generate same .so files
See original GitHub issueDescription
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?
Steps to reproduce
- Enable gradle flag to force rebuild reanimated
reanimated = [ buildFromSource: true ] - Generate 2 apks with
buildFromSourcetrue and false. - 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:
- Created a year ago
- Comments:26 (8 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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
minSdkVersionpassed and takes the default 16 specified in gradle fileFound this link where it describes how this works: https://developer.android.com/ndk/guides/application_mk#app_platform
I still think that reanimated is targeting min sdk 16 and when we rebuild we target min sdk 21 and that explains the diff