I'm attempting to generate a signed APK and receiving the following error:
Error:(59, 44) AppCompatButton.setSupportBackgroundTintList can only be called from within the same library group (groupId=com.android.support)
Since the last time I've done so, AppCompatButton.setSupportBackgroundTintList
has been annotated with @RestrictTo(LIBRARY_GROUP)
.
When trying to generate the APK, lint flags this as an error. I've read this question and its answers, however, suppressing the lint analysis still does not allow me to generate an APK, generating the same error as above.
So, I changed the call to conform with the new preferred way of making compat calls: ViewCompat.setBackgroundTintList(view, tintList)
. Unfortunately, this change still does not allow me to generate a signed APK, generating the same error as above.
Android Studio version 3.1
Build tools version 27.0.3
Gradle wrapper version gradle-4.5.1-all
Android gradle build tools version 3.1.0
What am I missing?
Edit
Well, this is weird and pretty embarrassing. Apparently, when I updated Android Studio and imported my settings, it allowed itself to continue displaying a now deprecated Messages window. This window wasn't receiving messages being generated by the build output. After investigating further, I found that Messages output is now in the new Build window. After checking that output, it seems my problem was something else entirely.
The solution for @RestrictTo(LIBRARY_GROUP) continues to be using the appropriate compat call.