You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running cordova prepare errors with returns "Source and destination must not be the same"
I also get the error when running cordorva build android and cordova platform add android
What is expected to happen?
cordova prepare completes successfully
What does actually happen?
any cordova android command fails with the error message
Information
I did find this closed bug: #693 and tried the suggestions, but that didn't fix my issue.
Here is the output from cordova prepare --verbose
No scripts found for hook "before_prepare".
Checking for saved platforms that haven't been added to the project
Platform API successfully found in: /Users/jonmorris/CordovaProjects/NWBBASchool/platforms/android/cordova/Api.js
Checking for saved plugins that haven't been added to the project
Generating platform-specific config.xml from defaults for android at /Users/jonmorris/CordovaProjects/NWBBASchool/platforms/android/app/src/main/res/xml/config.xml
Merging project's config.xml into platform-specific android config.xml
[Gradle Properties] Preparing Configuration
[Gradle Properties] Appending default configuration properties
[Gradle Properties] Updating Gradle property "android.useAndroidX" with the value of "false"
[Gradle Properties] Updating Gradle property "android.enableJetifier" with the value of "false"
[Gradle Properties] Appending custom configuration properties
[Gradle Properties] Detected Gradle property "android.useAndroidX" with the value of "true", Cordova's recommended value is "false"
[Gradle Properties] Detected Gradle property "android.enableJetifier" with the value of "true", Cordova's recommended value is "false"
[Gradle Properties] Updating and Saving File
Merging and updating files from [www, platforms/android/platform_www] to platforms/android/app/src/main/assets/www
copy www/platforms/ios/build/device/libCordova.a platforms/android/app/src/main/assets/www/platforms/ios/build/device/libCordova.a (updated file)
Source and destination must not be the same.
Error: Source and destination must not be the same.
at Object.checkPathsSync (/Users/jonmorris/CordovaProjects/NWBBASchool/node_modules/fs-extra/lib/util/stat.js:51:11)
at Object.copySync (/Users/jonmorris/CordovaProjects/NWBBASchool/node_modules/fs-extra/lib/copy-sync/copy-sync.js:24:38)
at updatePathWithStats (/Users/jonmorris/CordovaProjects/NWBBASchool/node_modules/cordova-common/src/FileUpdater.js:106:12)
at /Users/jonmorris/CordovaProjects/NWBBASchool/node_modules/cordova-common/src/FileUpdater.js:272:16
at Array.map ()
at Object.mergeAndUpdateDir (/Users/jonmorris/CordovaProjects/NWBBASchool/node_modules/cordova-common/src/FileUpdater.js:270:40)
at updateWww (/Users/jonmorris/CordovaProjects/NWBBASchool/platforms/android/cordova/lib/prepare.js:186:17)
at Api.module.exports.prepare (/Users/jonmorris/CordovaProjects/NWBBASchool/platforms/android/cordova/lib/prepare.js:85:28)
at Api.prepare (/Users/jonmorris/CordovaProjects/NWBBASchool/platforms/android/cordova/Api.js:126:24)
at /Users/jonmorris/.npm-global/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/prepare/platforms.js:59:28
This was a bug inside the fs-extra package if I recall correctly. If you had cordova / cordova-android installed before, it was possible it was installed at the time where the bugged version was the latest version.
When recreating/reinstalling the project (presumeably wiping package-lock and node_modules), when reinstalling NPM will fetch the latest patch which contains the fix.
Deleting node_modules & package-lock.json and then running npm install should yield the same results as well.
Bug Report
Problem
Running
cordova prepare
errors with returns "Source and destination must not be the same"I also get the error when running
cordorva build android
andcordova platform add android
What is expected to happen?
cordova prepare
completes successfullyWhat does actually happen?
any cordova android command fails with the error message
Information
I did find this closed bug: #693 and tried the suggestions, but that didn't fix my issue.
Here is the output from
cordova prepare --verbose
No scripts found for hook "before_prepare".
Checking for saved platforms that haven't been added to the project
Platform API successfully found in: /Users/jonmorris/CordovaProjects/NWBBASchool/platforms/android/cordova/Api.js
Checking for saved plugins that haven't been added to the project
Generating platform-specific config.xml from defaults for android at /Users/jonmorris/CordovaProjects/NWBBASchool/platforms/android/app/src/main/res/xml/config.xml
Merging project's config.xml into platform-specific android config.xml
[Gradle Properties] Preparing Configuration
[Gradle Properties] Appending default configuration properties
[Gradle Properties] Updating Gradle property "android.useAndroidX" with the value of "false"
[Gradle Properties] Updating Gradle property "android.enableJetifier" with the value of "false"
[Gradle Properties] Appending custom configuration properties
[Gradle Properties] Detected Gradle property "android.useAndroidX" with the value of "true", Cordova's recommended value is "false"
[Gradle Properties] Detected Gradle property "android.enableJetifier" with the value of "true", Cordova's recommended value is "false"
[Gradle Properties] Updating and Saving File
Merging and updating files from [www, platforms/android/platform_www] to platforms/android/app/src/main/assets/www
copy www/platforms/ios/build/device/libCordova.a platforms/android/app/src/main/assets/www/platforms/ios/build/device/libCordova.a (updated file)
Source and destination must not be the same.
Error: Source and destination must not be the same.
at Object.checkPathsSync (/Users/jonmorris/CordovaProjects/NWBBASchool/node_modules/fs-extra/lib/util/stat.js:51:11)
at Object.copySync (/Users/jonmorris/CordovaProjects/NWBBASchool/node_modules/fs-extra/lib/copy-sync/copy-sync.js:24:38)
at updatePathWithStats (/Users/jonmorris/CordovaProjects/NWBBASchool/node_modules/cordova-common/src/FileUpdater.js:106:12)
at /Users/jonmorris/CordovaProjects/NWBBASchool/node_modules/cordova-common/src/FileUpdater.js:272:16
at Array.map ()
at Object.mergeAndUpdateDir (/Users/jonmorris/CordovaProjects/NWBBASchool/node_modules/cordova-common/src/FileUpdater.js:270:40)
at updateWww (/Users/jonmorris/CordovaProjects/NWBBASchool/platforms/android/cordova/lib/prepare.js:186:17)
at Api.module.exports.prepare (/Users/jonmorris/CordovaProjects/NWBBASchool/platforms/android/cordova/lib/prepare.js:85:28)
at Api.prepare (/Users/jonmorris/CordovaProjects/NWBBASchool/platforms/android/cordova/Api.js:126:24)
at /Users/jonmorris/.npm-global/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/prepare/platforms.js:59:28
Command or Code
cordova prepare
cordova build android
cordova cordova platform add android
Environment, Platform, Device
cordova is installed on MacOS 11.3.1
Version information
cordova info
output:Cordova Packages:
Project Installed Platforms:
Project Installed Plugins:
Environment:
android Environment:
ERROR: Command failed with ENOENT: android list target
spawn android ENOENT
Checklist
The text was updated successfully, but these errors were encountered: