java.lang.ClassNotFoundException:没有';“找不到类”;android.support.v4.content.FileProvider“;Adone AIR本机扩展中出错
也许我的问题听起来像是被问了100次,但相信我,我已经阅读了这100个类似问题的每个答案,没有一个解决了我的问题。所以,我的本机扩展的目的是与第三方应用程序(Quick Office、Adobe Reader等)共享我的应用程序缓存文件夹(doc、pdf等)中的文档。我发现FileProvider和Intents应该可以解决我的问题 我的应用程序说明文件包含:java.lang.ClassNotFoundException:没有';“找不到类”;android.support.v4.content.FileProvider“;Adone AIR本机扩展中出错,android,apache-flex,air,air-native-extension,Android,Apache Flex,Air,Air Native Extension,也许我的问题听起来像是被问了100次,但相信我,我已经阅读了这100个类似问题的每个答案,没有一个解决了我的问题。所以,我的本机扩展的目的是与第三方应用程序(Quick Office、Adobe Reader等)共享我的应用程序缓存文件夹(doc、pdf等)中的文档。我发现FileProvider和Intents应该可以解决我的问题 我的应用程序说明文件包含: <application android:enabled="true" android:launc
<application android:enabled="true"
android:launchMode="singleInstance">
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.test.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
</application>
我正在使用
Eclipse Luna 4.4.0
Eclipse Android Plugin 23.0.3
Android SDK Tools 23.0.2
Android SDK Platform-tools 20
Android SDK Build-tools 20
Android SDK from 14 upto 20
Android Support Library 20
Google Play services 19
本机扩展结构:
+android
-libs/android-support-v4.jar
-res/xml/file_paths
-library.swf
-openwithdefaultapp.jar
+default
-library.swf
-extension.xml
但我被错误缠住了:
java.lang.RuntimeException: Unable to get provider android.support.v4.content.FileProvider: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.content.FileProvider" on path: DexPathList[[zip file "/data/app/air.testFileProvider-2.apk"],nativeLibraryDirectories=[/data/app-lib/air.testFileProvider-2, /vendor/lib, /system/lib]]
任何帮助都将不胜感激。
感谢android:authorities=“com.test.fileprovider”和“com.test.OpemWithDefaultApp.fileprovider”
,这两个名称在AndroidManifest.xml中应该是相同的
改变
<provider android:name="android.support.v4.content.FileProvider"
你看过或看过吗?这听起来像是同一个根本问题。谢谢布莱恩!yozhik的回答解决了我的问题。我唯一不喜欢的是我的罐子的新尺寸(700kb而不是10kb),但至少它能工作!谢谢这个问题发生在您的上,因为生成的AndroidManifest.xml
包含您的jar文件没有依赖项的标记(即.*android.support.v4.content.FileProvider**)。@IgorGanapolsky,如何解决这个问题?@IgorGanapolsky,谢谢Igor,最后,我通过清理我的构建文件夹并再次编译解决了这个问题。
<provider android:name="android.support.v4.content.FileProvider"
<provider android:name="androidx.core.content.FileProvider"