donglua / PhotoPicker

[DEPRECATED] Image Picker like Wechat
https://play.google.com/store/apps/details?id=me.iwf.PhotoPickerDemo
Apache License 2.0
2.83k stars 683 forks source link

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

Open yuzhongxingke opened 6 years ago

yuzhongxingke commented 6 years ago

你好,测试发现在小米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)

Android-xiaole commented 6 years ago

我也出现了同样的问题

TopTime1 commented 6 years ago

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

yanghong16 commented 5 years ago

+1

yanghong16 commented 5 years ago

我在这里找到了解决方案,关键错误信息: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

aiphoto112 commented 1 year ago

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"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" /> 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.