Android studio android annotation system api

Issue

I havent built an app in android using this library before android.annotation.SystemApi, but my project now requires it.
Is there something wrong in my import statement that prevents me from using SystemApi?
there are a few other annotation libraries that i need to use and they all throw the following error:

error: cannot find symbol
import android.annotation.SystemApi;
^
symbol: class SystemApi
location: package android.annotation

I appreciate any help i can get!

Solution

There is no SystemApi annotation in the Android SDK. It is part of the framework, and it is marked as @hide, meaning it is stripped from the Android SDK.

but my project now requires it

If you are creating an Android app, you should not need @SystemApi, and you cannot use it. It is for creating extensions to the Android framework, if you are building your own custom edition of Android using the AOSP.

Answered By – CommonsWare

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published