-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Closed
Labels
BugPlatform: AndroidAndroid applications.Android applications.Ran CommandsOne of our bots successfully processed a command.One of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Description
Run react-native app on android P emulator will throw out a caution of non-sdk
usage.
The link is https://developer.android.com/preview/restrictions-non-sdk-interfaces
And a bunch of react-native native android code use refection or other non-sdk that will cause
the app not working on Android P.
A example piece of code is in ReactTextInputManager.java
private void setCursorColor(ReactEditText view, @Nullable Integer color) {
// Evil method that uses reflection because there is no public API to changes
// the cursor color programmatically.
// Based on http://stackoverflow.com/questions/25996032/how-to-change-programatically-edittext-cursor-color-in-android.
try {
// Get the original cursor drawable resource.
Field cursorDrawableResField = TextView.class.getDeclaredField("mCursorDrawableRes");
cursorDrawableResField.setAccessible(true);
int drawableResId = cursorDrawableResField.getInt(view);
// T
Use reflection TextView.class.getDeclaredField("mCursorDrawableRes")
florismettey
Metadata
Metadata
Assignees
Labels
BugPlatform: AndroidAndroid applications.Android applications.Ran CommandsOne of our bots successfully processed a command.One of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.