@slavaobninsk hi, thanks for the link.
I tried adding in pdfreader AndroidManifest located in Plugins/Android/PDFReader/AndroidManifest.xml the following:
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.company.appname.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
but still throws the same error.
I also tried adding it in the main AndroidManifest which is located in Plugins/Android/AndroidManifest.xml but then it doesn't build the app at all.
Any other ideas?
Thanks.
this is how is used: StartCoroutine(PDFReader.OpenDocLocal("Opel_AR_Marker_60x45"));
the doc is in StreamingAssets
and it fails ind Nexus9, Galaxy S6 all having Android 7.x
Instead in another Galaxy S6 with Android 6.x is ok
Tried in a new project, where I added PDFReader with Unity v5.6.1 and also updated android sdk to v26, device Nexus 9 Android v7.1.1.
With no changes, it throws the same error.
Tried modifying AndroidManifest by adding:
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.c.pn.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
But it doesn't build and fails to recognize resources:
stderr[
AndroidManifest.xml:7: error: Error: No resource found that matches the given name (at 'resource' with value '@xml/provider_paths').
]
@slavaobninsk
Can you please provide the apk you built in the video, so I can test your version, thanks.
Hi there.
I've also got the Android 7 problem. Currently, the most recent version of PDFReader is installed.
On Android 6 and lower it all works perfectly. On iOS the same.
I have this part in my Manifest:
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.SlavaObninsk.Test.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
It works to build a project but it's giving me the following error:
AndroidJavaException: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.XmlResourceParser android.content.pm.ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference
java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.XmlResourceParser android.content.pm.ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference
at android.support.v4.content.FileProvider.parsePathStrategy(FileProvider.java:561)
at android.support.v4.content.FileProvider.getPathStrategy(FileProvider.java:535)
at android.support.v4.content.FileProvider.getUriForFile(FileProvider.java:377)
at com.SlavaObninsk.pdfreader.Logic.OpenDocLocal(Logic.java:60)
at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
at com.unity3d.player.UnityPlayer.c(Unknown Source)
at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source)
at android.os.MessageQueue.next(Message
@slavaobninsk What can I do?
Hi there!
We are using PDFReader for a while now, but we are currently facing a problem since upgrading to Unity 2018.3
But the main problem is the following:
Everytime when I try to open a PDF file, the console says:
/my.bundle.name I/PDFReader: Activity error = No Activity found to handle Intent { act=android.intent.action.VIEW dat=file:///storage/emulated/0/Android/data/my.bundle.name/files/pdf/Wz_lkjh_Zertifikat_Wembley.pdf typ=application/pdf flg=0x4000000 }
I controlled if the file exists and yes: The file exists and I can open it via AcrobatReader without any problems. The path is correct so far. What could be the problem here?