我正在使用aFileChooser库,每次选择选择文件时,即使我已将其添加到构建路径和Manifest,我也会收到类找不到错误。这是mu Manifest中的最新消息:
<activity
android:name="com.ipaulpro.afilechooser.FileChooserActivity"
android:icon="@drawable/ic_chooser"
android:enabled="@bool/use_activity"
android:exported="true"
android:label="@string/choose_file" >
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.OPENABLE" />
<data android:mimeType="*/*" />
</intent-filter>
</activity>
继承我的logcat:
08-14 16:05:07.469: E/AndroidRuntime(538): FATAL EXCEPTION: main
08-14 16:05:07.469: E/AndroidRuntime(538): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.dogger20011.mcpemodlocater/com.ipaulpro.afilechooser.FileChooserActivity}: java.lang.ClassNotFoundException: com.ipaulpro.afilechooser.FileChooserActivity
08-14 16:05:07.469: E/AndroidRuntime(538): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1880)
08-14 16:05:07.469: E/AndroidRuntime(538): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
08-14 16:05:07.469: E/AndroidRuntime(538): at android.app.ActivityThread.access$600(ActivityThread.java:123)
08-14 16:05:07.469: E/AndroidRuntime(538): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
08-14 16:05:07.469: E/AndroidRuntime(538): at android.os.Handler.dispatchMessage(Handler.java:99)
08-14 16:05:07.469: E/AndroidRuntime(538): at android.os.Looper.loop(Looper.java:137)
08-14 16:05:07.469: E/AndroidRuntime(538): at android.app.ActivityThread.main(ActivityThread.java:4424)
08-14 16:05:07.469: E/AndroidRuntime(538): at java.lang.reflect.Method.invokeNative(Native Method)
08-14 16:05:07.469: E/AndroidRuntime(538): at java.lang.reflect.Method.invoke(Method.java:511)
08-14 16:05:07.469: E/AndroidRuntime(538): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
08-14 16:05:07.469: E/AndroidRuntime(538): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
08-14 16:05:07.469: E/AndroidRuntime(538): at dalvik.system.NativeStart.main(Native Method)
08-14 16:05:07.469: E/AndroidRuntime(538): Caused by: java.lang.ClassNotFoundException: com.ipaulpro.afilechooser.FileChooserActivity
08-14 16:05:07.469: E/AndroidRuntime(538): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
08-14 16:05:07.469: E/AndroidRuntime(538): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
08-14 16:05:07.469: E/AndroidRuntime(538): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
08-14 16:05:07.469: E/AndroidRuntime(538): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
08-14 16:05:07.469: E/AndroidRuntime(538): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)
08-14 16:05:07.469: E/AndroidRuntime(538): ... 11 more
答案 0 :(得分:0)
确保您已正确导入库 然后确保您的实际项目未被选为库
检查班级名称和文件名称 确保正确提及您的Android清单包名称
或
<activity
android:name="com.nononsenseapps.filepicker.FilePickerActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@style/FilePickerTheme">
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>