Http native plugin Ionic Error Buildind

Hi !

When I try to build for android with Http native plugin I have an error : Execution failed for task ‘:compileDebugJavaWithJavac’., but when I build for Ios everything is ok…

Did you know this problem please ?

BUILD FAILED

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Total time: 1.981 secs
Error: cmd: Command failed with exit code 1 Error output:
C:\Users\vince\Desktop\SuperEdt\platforms\android\src\com\synconset\cordovahttp\CordovaHttpDownload.java:18: error: package org.apache.cordova.file does not exist
import org.apache.cordova.file.FileUtils;
^
C:\Users\vince\Desktop\SuperEdt\platforms\android\src\com\synconset\cordovahttp\CordovaHttpDownload.java:49: error: cannot find symbol
JSONObject fileEntry = FileUtils.getFilePlugin().getEntryForFile(file);
^
symbol: variable FileUtils
location: class CordovaHttpDownload
Note: C:\Users\vince\Desktop\SuperEdt\platforms\android\src\org\apache\cordova\splashscreen\SplashScreen.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:compileDebugJavaWithJavac’.

Compilation

This is the complete error…

Try this

cordova platform update android@5.0.0

Also remove your platforms folder to get a fresh one.

I will try but the before I have a question : currently, I’m on “cordova-android”: “^6.2.3”, so why I need a past version please ? And thanks for your answer !

I don’t know.
As you can see in your log the script cant find that plugin, try to reinstall it or remove the platforms folder and try to build again.

C:\Users\vince\Desktop\SuperEdt\platforms\android\src\com\synconset\cordovahttp\CordovaHttpDownload.java:18: error: package org.apache.cordova.file does not exist

Is your first time building an app? Did you setup well your android sdk environment?

Before I installed Http native plugin Ionic, I didn’t have any bug but since I have it, my build failed

do a “platform remove” of android, and then a “platform add” and rebuild your project again

Yes, I just did it but I have the same issue. I really don’t understand why I have this problem with http native plugin :frowning:

Remove the plugins folder too (and platforms) and try again.

If isnt working do a clean start removing your node_modules and doing a npm install

I did it but I have again the same issue ! It’s really weird, I’m sorry…

Did you delete platforms, plugins and node_modules? npm i and build again?
Thats weird, I don’t know what’s causing your problem

I did ionic cordova platform remove android. After i deleted platform and node_modules folder. After i tap npm install and ionic cordova platform add android

Somebody have an idea please :frowning: ?

I solve this with upgrade cordova android to 6.5.0 but I dont understand why Ionic didn’t install last version…?

Someone have an idea please ?

Hello.
This solves your problem.

Before your petition.

this.http.setSSLCertMode(‘nocheck’).then((resp: any) => {
console.log(resp);
}, (error) => {
console.log(error);
});