guolindev / PermissionX

An open source Android library that makes handling runtime permissions extremely easy.
Apache License 2.0
3.52k stars 405 forks source link

java.lang.NoSuchMethodError: No virtual method registerForActivityResult #136

Closed 330676687 closed 3 years ago

330676687 commented 3 years ago
 java.lang.NoSuchMethodError: No virtual method registerForActivityResult(Landroidx/activity/result/contract/ActivityResultContract;Landroidx/activity/result/ActivityResultCallback;)Landroidx/activity/result/ActivityResultLauncher; in class Lcom/permissionx/guolindev/request/InvisibleFragment; or its super classes (declaration of 'com.permissionx.guolindev.request.InvisibleFragment' appears in /data/app/~~UYmQjgUWBEQo4rpNQrnk_A==/com.z.tzrl-iuo1uB_LXrFxDMUIadKrIw==/base.apk!classes17.dex)
        at com.permissionx.guolindev.request.InvisibleFragment.<init>(InvisibleFragment.kt:51)
        at com.permissionx.guolindev.request.PermissionBuilder.getInvisibleFragment(PermissionBuilder.kt:565)
        at com.permissionx.guolindev.request.PermissionBuilder.requestNow(PermissionBuilder.kt:402)
        at com.permissionx.guolindev.request.RequestNormalPermissions.request(RequestNormalPermissions.kt:53)
        at com.permissionx.guolindev.request.RequestChain.runTask$permissionx_release(RequestChain.kt:51)
        at com.permissionx.guolindev.request.PermissionBuilder.request(PermissionBuilder.kt:262)
        at com.z.tzrl.ui.jobdetail.JobDetailFragment.toLocation(JobDetailFragment.kt:912)
        at com.z.tzrl.ui.jobdetail.JobDetailFragment.setData(JobDetailFragment.kt:672)
        at com.z.tzrl.ui.jobdetail.JobDetailFragment.onViewCreated$lambda-23$lambda-18(JobDetailFragment.kt:209)
        at com.z.tzrl.ui.jobdetail.JobDetailFragment.$r8$lambda$JTTgU50wdNH5_Kc6X0_nUQb8Wj0(Unknown Source:0)
        at com.z.tzrl.ui.jobdetail.JobDetailFragment$$ExternalSyntheticLambda9.onChanged(Unknown Source:6)
        at androidx.lifecycle.LiveData.considerNotify(LiveData.java:133)
        at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:151)
        at androidx.lifecycle.LiveData.setValue(LiveData.java:309)
        at androidx.lifecycle.MutableLiveData.setValue(MutableLiveData.java:50)
        at com.z.tzrl.ui.jobdetail.JobDetailViewModel$loadData$1.invokeSuspend(JobDetailViewModel.kt:44)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:257)
        at android.app.ActivityThread.main(ActivityThread.java:8215)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:626)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1032)

更新到1.6.0后出现

tanzhihao1qaz commented 1 year ago

请问怎么解决的?