xseignard / cordovarduino

Cordova/Phonegap plugin for USB host serial communication from an Android device.
MIT License
166 stars 110 forks source link

Build failed with cordova 8.0.0 #93

Closed maxxir closed 5 years ago

maxxir commented 6 years ago

Hello! Trying create simple project with cordovarduino:

cordova create cordovarduino_01 com.cordova.arduino01 CordovArduino_01
cd cordovarduino_01
cordova platform add android
cordova plugin add cordovarduino
cordova build android --verbose

When compile catch this error:

No scripts found for hook "before_build".
No scripts found for hook "before_prepare".
Checking config.xml and package.json for saved platforms that haven't been added to the project
Config.xml and package.json platforms are the same. No pkg.json modification.
Package.json and config.xml platforms are different. Updating config.xml with most current list of platforms.
PlatformApi successfully found for platform android
Checking config.xml for saved plugins that haven't been added to the project
Checking for any plugins added to the project that have not been installed in android platform
No differences found between plugins added to project and installed in android platform. Continuing...
Generating platform-specific config.xml from defaults for android at E:\Android_cordova\cordovarduino_01\platforms\android\res\xml\config.xml
cp: copyFileSync: could not write to dest file (code=ENOENT):E:\Android_cordova\cordovarduino_01\platforms\android\res\xml\config.xml

Merging project's config.xml into platform-specific android config.xml
Parsing E:\Android_cordova\cordovarduino_01\platforms\android\res\xml\config.xml failed
(node:5428) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: ENOENT: no such file or directory, open 'E:\Android_cordova\
cordovarduino_01\platforms\android\res\xml\config.xml'
(node:5428) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the
 Node.js process with a non-zero exit code.

My Cordova project info:

#cordova info
Collecting Data...

Node version: v8.9.4

Cordova version: 8.0.0

Config.xml file:

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.cordova.arduino01" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>CordovArduino_01</name>
    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>
    <author email="dev@cordova.apache.org" href="http://cordova.io">
        Apache Cordova Team
    </author>
    <content src="index.html" />
    <plugin name="cordova-plugin-whitelist" spec="1" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="android">
        <allow-intent href="market:*" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
    </platform>
    <plugin name="fr.drangies.cordova.serial" spec="~0.0.7" />
    <engine name="android" spec="^7.0.0" />
</widget>

Plugins:

cordova-plugin-whitelist,fr.drangies.cordova.serial
allankiezel commented 6 years ago

@maxxir Same here. Have you figured this out?

maxxir commented 6 years ago

Downgrade android platform helped me:

cordova create cordovarduino_01 com.cordova.arduino01 CordovArduino_01 cd cordovarduino_01 cordova platform add android@6.4.0 cordova plugin add cordovarduino cordova build android --verbose

ankit18singh commented 6 years ago

I'm having the same issue. Any other workaround apart from downgrading cordova-android?

tkem commented 6 years ago

You might want to have a look at #101 which seems to fix some issues with cordova-android v7.1.0. I was getting different errors, though...

Tinalst commented 6 years ago

@maxxir downgrade to version 6.4.0 works for me~

TomDemulierChevret commented 5 years ago

I confirm that pull request #101 from @tkem does fix the build issue for cordova 8.1.2 and cordova-android 7.1.1.

xseignard commented 5 years ago

merged in 0.0.10

tkem commented 5 years ago

@xseignard: Thank you! Works like a charm now!