Sunday, 9 May 2021

Restrictions on non-SDK interfaces with androidx.appcompat library

Due to Restrictions on non-SDK interfaces on app targeting Android 11, I have used vertex tool provided by Android Developers site to find list of non-SDK API in my app.

Here is part of list:

#15: Reflection max-target-p Landroid/animation/LayoutTransition;->cancel use(s):
       Landroidx/transition/ViewGroupUtilsApi14;->cancelLayoutTransition(Landroid/animation/LayoutTransition;)V


#67: Reflection max-target-p Landroid/view/View;->mViewFlags use(s):
       Landroidx/transition/ViewUtilsBase;->setTransitionVisibility(Landroid/view/View;I)V

#68: Reflection max-target-p Landroid/view/View;->setFrame use(s):
       Landroidx/transition/ViewUtilsBase;->fetchSetFrame()V


#72: Reflection max-target-p Landroid/view/inputmethod/InputMethodManager;->mH use(s):
       Landroidx/activity/ImmLeaksCleaner;->initializeReflectiveFields()V             


#75: Reflection max-target-p Landroid/widget/AutoCompleteTextView;->doAfterTextChanged use(s):
       Landroidx/appcompat/widget/SearchView$PreQAutoCompleteTextViewReflector;-><init>()V

#76: Reflection max-target-p Landroid/widget/AutoCompleteTextView;->doBeforeTextChanged use(s):
       Landroidx/appcompat/widget/SearchView$PreQAutoCompleteTextViewReflector;-><init>()V

#77: Reflection max-target-p Landroid/widget/AutoCompleteTextView;->ensureImeVisible use(s):
       Landroidx/appcompat/widget/SearchView$PreQAutoCompleteTextViewReflector;-><init>()V

#78: Reflection max-target-p Landroid/widget/ImageView;->mDrawMatrix use(s):
       Landroidx/transition/ImageViewUtils;->fetchDrawMatrixField()V

#79: Reflection max-target-p Landroid/widget/TextView;->getHorizontallyScrolling use(s):
       Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper$Impl;->isHorizontallyScrollable(Landroid/widget/TextView;)Z


#86: Reflection max-target-o Lcom/android/internal/view/menu/MenuBuilder;->removeItemAt use(s):
       Landroidx/core/widget/TextViewCompat$OreoCallback;->recomputeProcessTextMenuItems(Landroid/view/Menu;)V

These APIs are tagging with max-target-p or max-target-o, and coming from Android libraries.

As I want my app to target Android R, I have to handle these APIs.

Here is list of dependency that are related to androidx which is used in my app:

implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.appcompat:appcompat:1.2.0'

Is there any solution to fix or bypass those androidx api restriction?



from Restrictions on non-SDK interfaces with androidx.appcompat library

No comments:

Post a Comment