Android studio android annotation system api

550 Views Asked by At

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!

1

There are 1 best solutions below

0
CommonsWare On BEST ANSWER

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.