Cannot call some of FragmentTransaction methods. For example I want to add the BlankFragment into FragmentContainerView leads to following error.
supportFragmentManager.commit {
setReorderingAllowed(true)
add<BlankFragment>(mainBinding.fragmentContainer)
}
None of the following functions can be called with the arguments supplied.
This is my build.gradle
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
// Glide
implementation 'com.github.bumptech.glide:glide:4.12.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
// Fragment
def fragment_version = "1.3.6"
implementation "androidx.fragment:fragment-ktx:$fragment_version"
}
Thanks in advance.
