This happens when i extend from an abstract base fragment like so:
public abstract class BaseFragment<T extends BasePresenter, E extends BaseModel> extends Fragment {
....
}
, but the app still build without any errors. below is my build.gradle
config:
android {
compileSdkVersion 27
buildToolsVersion '26.0.2'
defaultConfig
{
multiDexEnabled true
minSdkVersion 21
targetSdkVersion 27
}
}
Add following line to gradle
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
Solution 1:
LifecycleOwner : A class that has an Android lifecycle. These events can be used by custom components to handle lifecycle changes without implementing any code inside the Activity or the Fragment.
To access LifecycleOwner class add following dependency in your app build.gradle file.
implementation "android.arch.lifecycle:extensions:1.1.1"
Solution 2:
Add following support compat dependency in your app build.gradle file.
implementation 'com.android.support:support-compat:27.1.1'
I had this same issue , adding this to the apps build.gradle might fix the issue
annotationProcessor "android.arch.lifecycle:common-java8:1.1.1"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With