PhotoPicker icon indicating copy to clipboard operation
PhotoPicker copied to clipboard

Didn't find class "me.iwf.photopicker.utils.PhotoFileProvider"

Open yuzhongxingke opened this issue 6 years ago • 5 comments

你好,测试发现在小米note LTE手机上报这个错误,其他手机没有错误,请问这个如何解决呢?谢谢啦!

04-02 13:30:35.202 E/AndroidRuntime(16367): java.lang.RuntimeException: Unable to get provider me.iwf.photopicker.utils.PhotoFileProvider: java.lang.ClassNotFoundException: Didn't find class "me.iwf.photopicker.utils.PhotoFileProvider" on path: DexPathList[[zip file "/data/app/com.fb.crm-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.fb.crm-1, /vendor/lib, /system/lib]] 04-02 13:30:35.202 E/AndroidRuntime(16367): at android.app.ActivityThread.installProvider(ActivityThread.java:4843) 04-02 13:30:35.202 E/AndroidRuntime(16367): at android.app.ActivityThread.installContentProviders(ActivityThread.java:4435) 04-02 13:30:35.202 E/AndroidRuntime(16367): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4375) 04-02 13:30:35.202 E/AndroidRuntime(16367): at android.app.ActivityThread.access$1600(ActivityThread.java:141) 04-02 13:30:35.202 E/AndroidRuntime(16367): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1273) 04-02 13:30:35.202 E/AndroidRuntime(16367): at android.os.Handler.dispatchMessage(Handler.java:102) 04-02 13:30:35.202 E/AndroidRuntime(16367): at android.os.Looper.loop(Looper.java:136) 04-02 13:30:35.202 E/AndroidRuntime(16367): at android.app.ActivityThread.main(ActivityThread.java:5072) 04-02 13:30:35.202 E/AndroidRuntime(16367): at java.lang.reflect.Method.invokeNative(Native Method) 04-02 13:30:35.202 E/AndroidRuntime(16367): at java.lang.reflect.Method.invoke(Method.java:515) 04-02 13:30:35.202 E/AndroidRuntime(16367): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 04-02 13:30:35.202 E/AndroidRuntime(16367): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609) 04-02 13:30:35.202 E/AndroidRuntime(16367): at dalvik.system.NativeStart.main(Native Method)

yuzhongxingke avatar Apr 03 '18 01:04 yuzhongxingke

我也出现了同样的问题

Android-xiaole avatar May 16 '18 09:05 Android-xiaole

请问怎么解决啊,我也遇到了

TopTime1 avatar Jun 29 '18 05:06 TopTime1

+1

yanghong16 avatar Aug 24 '18 06:08 yanghong16

我在这里找到了解决方案,关键错误信息:DexPathList

https://stackoverflow.com/questions/46304196/unable-to-get-provider-android-arch-lifecycle-lifecycleruntimetrojanprovider-ja

1 - in app gradle, inside defaultConfig enable multidex

defaultConfig{ .... multiDexEnabled true } 2 - to support multidex in other versions, add this dependency to your app gradle

compile 'com.android.support:multidex:1.0.1' 3 - if you have a class that extends Application, make it extend MultiDexApplication

if you don't, add this to your manifest file inside application tag

android:name="android.support.multidex.MultiDexApplication" that's it. worked for me

yanghong16 avatar Aug 24 '18 06:08 yanghong16

This error message usually occurs when the PhotoFileProvider class is missing or not properly declared in the AndroidManifest.xml file.

To fix this issue, try the following steps:

Make sure that the PhotoFileProvider class is included in your project's dependencies. If you are using a third-party library that uses this class, make sure that you have added the library to your project correctly.

Check your AndroidManifest.xml file and make sure that the PhotoFileProvider is properly declared. The declaration should look like this: <provider android:name="me.iwf.photopicker.utils.PhotoFileProvider" android:authorities="${applicationId}.photopicker.fileprovider" android:exported="false" android:grantUriPermissions="true"> Note: the android:authorities attribute value should be set to ${applicationId}.photopicker.fileprovider.

If the issue persists, try cleaning and rebuilding your project, and make sure that all necessary dependencies and resources are properly included in your project.

By following these steps, you should be able to resolve the "Didn't find class "me.iwf.photopicker.utils.PhotoFileProvider"" error.

aiphoto112 avatar Mar 13 '23 08:03 aiphoto112