I've been working on ionic project. The project uses various plugins including file transfer plugin.
Problem
When I install and run the app, it fails to download resources like image and audio from the api. When I debugged following error was shown:
{
"code": 3,
"source": "https://api.example.com/uploads/audio/011576657039579041.mp3",
"target": "file:///data/user/0/com.myapp.snork/files/audio/011576657039579041.mp3",
"http_status": null,
"body": null,
"exception": "java.security.cert.CertPathValidatorException: Trust anchor for certification path not found."
}
I tested it on Android 6, 7 and 8, with no luck. it works in iOS. Can anybody tell me what might be gone wrong??
What I have tried?
- Removing and adding android platform again
- Removing and adding file transfer plugin again.
My working Environment
- @ionic/cli-utils : 1.19.2
- ionic (Ionic CLI) : 3.20.0
- @ionic/app-scripts : 1.3.8
- Cordova Platforms : android 7.0.0 ios 4.3.1
- Ionic Framework : ionic-angular 3.7.1
- Android SDK Tools : 26.1.1
UPDATE
The source URL - https://api.example.com/uploads/audio/011576657039579041.mp3 can be accessible directly via browser, so there is nothing wrong in source URL.
Is it due to https ??
<access origin="cdvfile://*" />
to your config.xml file. – Kirubel<access origin="*" />
isn't this enough? – WatsMyName