Http native plugin Ionic Error Buildind


#1

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 ?


#2

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…


#3

Try this

cordova platform update android@5.0.0

Also remove your platforms folder to get a fresh one.


#4

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 !


#5

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?


#6

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


#7

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


#8

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:


#9

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


#10

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


#11

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


#12

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


#13

Somebody have an idea please :frowning: ?


#14

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


#15

Someone have an idea please ?


#16

Hello.
This solves your problem.

Before your petition.

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