Closed CarolineSan closed 1 year ago
I tried to do these changes but none of them worked, I even could not build my app anymore. Same by undoing these changes...
So I end up to uninstall cordova android 8.1.0 and re-installed it, and it is working now ^^ Even no need to make any change in config.xml / AndroidManifest.xml.
I suppose the key is to install Fileopener2 before installing the platform.
uninstall cordova android
You mean uninstall the Android Platform?
Is this it?
ionic cordova rm platform android
uninstall cordova android
You mean uninstall the Android Platform?
Is this it?
ionic cordova rm platform android
Yes, exactly, and then cordova platform add android@8.1.0
uninstall cordova android
You mean uninstall the Android Platform? Is this it?
ionic cordova rm platform android
Yes, exactly, and then
cordova platform add android@8.1.0
I did it and still got the same error :(
@pierresh wich version of Ionic you were using when solved this issue?
Hello,
Here is my ionic info
Ionic:
ionic (Ionic CLI) : 4.12.0
Ionic Framework : ionic-angular 3.9.8
@ionic/app-scripts : 3.2.3
Cordova:
cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 8.1.0, browser 5.0.3, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 1.2.1, (and 24 other plugins)
System:
ios-deploy : 1.9.2
NodeJS : v10.16.0 (/usr/local/bin/node)
npm : 6.9.0
OS : macOS Mojave
Xcode : Xcode 11.2.1 Build version 11B500
By the way, I did not make any change in config.xml / AndroidManifest.xml, I advise you to remove those you describe in your first message.
我也遇到了这个问题,我是android@8.1.0,2.2.1有问题,我删除了2.2.1,添加2.2.0就可以了。cordova plugin rm cordova-plugin-file-opener2,cordova plugin add cordova-plugin-file-opener2@2.2.0。
@CarolineSan add this to your config.xml
<platform name="android">
...
<config-file parent="/manifest/application" target="AndroidManifest.xml">
<provider android:authorities="${applicationId}.opener.provider" android:exported="false" android:grantUriPermissions="true" android:name="io.github.pwlin.cordova.plugins.fileopener2.FileProvider">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/opener_paths" />
</provider>
</config-file>
...
</platform>
now it's working for me.. I'am not sure why the plugin it's not doing this anymore.
@CarolineSan add this to your config.xml
<platform name="android"> ... <config-file parent="/manifest/application" target="AndroidManifest.xml"> <provider android:authorities="${applicationId}.opener.provider" android:exported="false" android:grantUriPermissions="true" android:name="io.github.pwlin.cordova.plugins.fileopener2.FileProvider"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/opener_paths" /> </provider> </config-file> ... </platform>
now it's working for me.. I'am not sure why the plugin it's not doing this anymore.
Thanks!! It worked! I had to downgrade the version too
The plugin should do this automatically and there is no need to add this manually.
Ionic version: 3.9.5 Angular 5
I am trying to open a PDF file in my Ionic application and get the following error:
So I followed the answers from this issue: https://github.com/pwlin/cordova-plugin-file-opener2/issues/215
I added this code to my AndroidManifest.xml:
And then I was getting the following error when I try to build:
So I took the code from AndroidManifest and put it in my config.xml like this:
And I managed to build it but it was no use and I still have the same error when trying to open a file.
This is my code: