Appcompatactivity.Oncreate Can Only Be Called from Within the Same Library Group

AppCompatActivity.onCreate can only be called from within the same library group

As Felipe already pointed out in his comment this is a bug in the pre-release version of the tools.

You can workaround it for now, until Google release a fix, by adding the following into your project module's build.gradle file:

android {
lintOptions {
disable 'RestrictedApi'
}
}

It's worth noting that this may hide true errors in your project as it suppresses all errors of that type, so the better option would be to downgrade the version of Android Studio and the tools used in the project.

ComponentActivity can only be called from within the same library group prefix

You've imported the wrong ComponentActivity. Make sure you are importing androidx.activity.ComponentActivity

WorkManager: ResolvableFuture can only be called from within the same library group prefix

You shouldn't be using ResolvableFuture at all, much less the internal version used by WorkManager.

Instead, you should be using the AndroidX Concurrent library:

androidx.concurrent:concurrent-futures:1.0.0 provides CallbackToFutureAdapter class, a minimalistic utility that allows to wrap callback based code and return instances of ListenableFuture

You'll note in the 1.0.0-beta01 release notes that even the AndroidX Concurrent Library has removed ResolveableFuture from its public API.

The Javadoc for CallbackToFutureAdapter has a full example of what this looks like:

public ListenableFuture<Result> startWork() {
return CallbackToFutureAdapter.getFuture(completer -> {
// Your method can call set() or setException() on the
// Completer to signal completion
startSomeAsyncStuff(completer);

// This value is used only for debug purposes: it will be used
// in toString() of returned future or error cases.
return "startSomeAsyncStuff";
});
}

So you'd use CallbackToFutureAdapter.Completer in place of a ResolvableFuture in your startSomeAsyncStuff method.

SelectionTracker.startRange can only be called from within the same library group (groupId=androidx.recyclerview)

Many methods in SelectionTracker are marked as

@hide
@RestrictTo(LIBRARY_GROUP)

including range methods. This means that they are for internal use. At least for now.

(SOLVED) getUid can only be called from within the same library group (groupId=com.google.firebase)

Solution: I didn't notice there were 2 user variables (Class variable and method variable), I was using the method variable instead the auth variable.

Warning: NavController.setNavigatorProvider can only be called from within the same library group (groupId=androidx.navigation)

You might avoid warning using the below code:

navController.navigatorProvider.addNavigator(navigator)


Related Topics



Leave a reply



Submit