top

Restricting Private C/C++ Symbol in Android N improves Stability

It becomes very painful and frustrating for Android users if their app fails suddenly after a platform update. To protect Android users and apps from crashes, Android N is now going to restrict which libraries app’s C/C++ code can link against at runtime. If the app uses any private symbols from platform libraries, it will be required to update it either by using public NDA (Native Development Kit) APIs or including its own copy of those libraries. As per Documentation of Android N Behavioral change, the system prevents apps from dynamically linking against non-NDK libraries, which may cause your app to crash. Some libraries are public such as NDA (Native Development Kit) and some libraries are private, and Android N only allows access to them for platform HALs, system daemons .If the android user is not sure about the libraries used in his/her app, whether it’s private or public, checking can be done immediately for warnings on N Developer Preview. During updating their apps users should have a consistent app experience and  developers shouldn’t have to waste time on making emergency app updates to handle platform changes. This has created the need of restricting private C/C++ symbol. Private symbols are not taken into consideration while Compatibility Test Suite (CTS), which is required for Android devices to pass. When Android 6.0 Marshmallow switched from OpenSSL to BoringSSL, many developers found that apps used in the devices failed to load. To separate the user from this change, a set of libraries have been identified that are being used in Google Play’s most-installed apps. These libraries are feasible and it can be supported for the short term which includes libandroid_runtime.so, libcutils.so, lib crypto.so, and libssl.so . These libraries are there in support temporarily but Google is not intending to continue it for their future Android platform release. So, users can fix the error if he/she gets a warning that the code will not work in a future release.  
Rated 4.0/5 based on 20 customer reviews
Normal Mode Dark Mode

Restricting Private C/C++ Symbol in Android N improves Stability

Paula Hernandez
What's New
08th Jul, 2016
Restricting Private C/C++ Symbol in Android N improves Stability

It becomes very painful and frustrating for Android users if their app fails suddenly after a platform update. To protect Android users and apps from crashes, Android N is now going to restrict which libraries app’s C/C++ code can link against at runtime. If the app uses any private symbols from platform libraries, it will be required to update it either by using public NDA (Native Development Kit) APIs or including its own copy of those libraries.

As per Documentation of Android N Behavioral change, the system prevents apps from dynamically linking against non-NDK libraries, which may cause your app to crash. Some libraries are public such as NDA (Native Development Kit) and some libraries are private, and Android N only allows access to them for platform HALs, system daemons .If the android user is not sure about the libraries used in his/her app, whether it’s private or public, checking can be done immediately for warnings on N Developer Preview.

During updating their apps users should have a consistent app experience and  developers shouldn’t have to waste time on making emergency app updates to handle platform changes. This has created the need of restricting private C/C++ symbol. Private symbols are not taken into consideration while Compatibility Test Suite (CTS), which is required for Android devices to pass. When Android 6.0 Marshmallow switched from OpenSSL to BoringSSL, many developers found that apps used in the devices failed to load.

To separate the user from this change, a set of libraries have been identified that are being used in Google Play’s most-installed apps. These libraries are feasible and it can be supported for the short term which includes libandroid_runtime.so, libcutils.so, lib crypto.so, and libssl.so . These libraries are there in support temporarily but Google is not intending to continue it for their future Android platform release. So, users can fix the error if he/she gets a warning that the code will not work in a future release.  

Paula

Paula Hernandez

Blog Author

Paula spent six years lecturing about Java before settling as a full-time independent Android developer. She also has strong interest in writing about Android and the Internet of Things (IoT).

Leave a Reply

Your email address will not be published. Required fields are marked *

SUBSCRIBE OUR BLOG

Follow Us On

Share on

other Blogs

20% Discount