Java.lang.ClassNotFoundException: Could not find class error "android.support.v4.content.FileProvider" in native Adone AIR extension

Perhaps my question sounds like it was asked 100 times earlier, but believe me, I read every answer for 100 such questions, and not one of them solved my problem. Therefore, the purpose of my own extension is to share documents in the application cache folder (doc, pdf, etc.) with third-party applications (Quick Office, Adobe Reader, etc.). I found that FileProvider and intent should solve my problem.

My application description file contains:

<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> 

In Eclipse, in the project properties -> Java Build Path -> Order and Export selected: Android and Android personal libraries. android-support-v4.jar is inside the libs project folder.

Excerpt from the FREFunction code:

 package com.test.OpenWithDefaultApp.functions; ..... import android.content.Intent; import android.net.Uri; import android.support.v4.content.FileProvider; ..... Uri contentUri = FileProvider.getUriForFile(context.getActivity(), "com.test.OpemWithDefaultApp.fileprovider", file); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(contentUri, fileType); ..... context.getActivity().startActivity(intent); ..... 

I use

 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 

Internal structure of expansion:

 +android -libs/android-support-v4.jar -res/xml/file_paths -library.swf -openwithdefaultapp.jar +default -library.swf -extension.xml 

But I am stuck in an error:

 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]] 

Any help would be greatly appreciated. Thanks

+6
source share
1 answer

android:authorities="com.test.fileprovider" and "com.test.OpemWithDefaultApp.fileprovider" , both of these names must be the same

0
source

Source: https://habr.com/ru/post/973774/


All Articles