question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error Messages: {Source and destination must not be the same} cannot build using cordova-android@11.0.0

See original GitHub issue

Bug Report

Problem

App stop building, message: Source and destination must not be the same

What is expected to happen?

The build should success without any errors.

What does actually happen?

I try to build the app from scratch without update command, only use cordova platform add https://github.com/apache/cordova-android.git#11.0.0

Try to build on Windows 11 command line (CMD).

When try to run cordova platform add adnroid, the following meesage appear: “Source and destination must not be the same”

Information

Command or Code

C:\Users\user\Desktop\testApp>cordova platform add https://github.com/apache/cordova-android.git#11.0.0 --verbose No scripts found for hook "before_platform_add". Using cordova-fetch for https://github.com/apache/cordova-android.git#11.0.0 fetch: Installing https://github.com/apache/cordova-android.git#11.0.0 to C:\Users\user\Desktop\testApp Running command: npm install https://github.com/apache/cordova-android.git#11.0.0 --save-dev Command finished with error code 0: npm install,https://github.com/apache/cordova-android.git#11.0.0,--save-dev Removing "cordova-" prefix from cordova-android Adding android project... Loaded API for android project C:\Users\user\Desktop\testApp\node_modules\cordova-android Creating Cordova project for the Android platform: Path: platforms\android Package: com.testApp Name: testApp.com Activity: MainActivity Android Target SDK: android-32 Android Compile SDK: 32 Copying android template project to platforms\android Subproject Path: CordovaLib Subproject Path: app Android project created with cordova-android@11.0.0 Loaded API for android project C:\Users\user\Desktop\testApp\platforms\android\cordova\Api.js Generating platform-specific config.xml from defaults for android at C:\Users\user\Desktop\testApp\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] File missing, creating file with Cordova defaults. [Gradle Properties] Appending default configuration properties [Gradle Properties] Appending configuration item: org.gradle.jvmargs=-Xmx2048m [Gradle Properties] Appending configuration item: android.useAndroidX=true [Gradle Properties] Appending configuration item: android.enableJetifier=true [Gradle Properties] Appending custom configuration properties [Gradle Properties] Updating and Saving File Merging and updating files from [www, platforms\android\platform_www] to platforms\android\app\src\main\assets\www mkdir platforms\android\app\src\main\assets\www\assets mkdir platforms\android\app\src\main\assets\www\assets\css copy www\assets\css\fontawesome-all.min.css platforms\android\app\src\main\assets\www\assets\css\fontawesome-all.min.css (new file) copy www\assets\css\main.css platforms\android\app\src\main\assets\www\assets\css\main.css (new file) mkdir platforms\android\app\src\main\assets\www\assets\google-fonts copy www\assets\google-fonts\KFOlCnqEu92Fr1MmWUlfABc4EsA.woff2 platforms\android\app\src\main\assets\www\assets\google-fonts\KFOlCnqEu92Fr1MmWUlfABc4EsA.woff2 (new file) copy www\assets\google-fonts\KFOlCnqEu92Fr1MmWUlfBBc4.woff2 platforms\android\app\src\main\assets\www\assets\google-fonts\KFOlCnqEu92Fr1MmWUlfBBc4.woff2 (new file) copy www\assets\google-fonts\KFOlCnqEu92Fr1MmWUlfBxc4EsA.woff2 platforms\android\app\src\main\assets\www\assets\google-fonts\KFOlCnqEu92Fr1MmWUlfBxc4EsA.woff2 (new file) copy www\assets\google-fonts\KFOlCnqEu92Fr1MmWUlfCBc4EsA.woff2 platforms\android\app\src\main\assets\www\assets\google-fonts\KFOlCnqEu92Fr1MmWUlfCBc4EsA.woff2 (new file) copy www\assets\google-fonts\KFOlCnqEu92Fr1MmWUlfCRc4EsA.woff2 platforms\android\app\src\main\assets\www\assets\google-fonts\KFOlCnqEu92Fr1MmWUlfCRc4EsA.woff2 (new file) copy www\assets\google-fonts\KFOlCnqEu92Fr1MmWUlfChc4EsA.woff2 platforms\android\app\src\main\assets\www\assets\google-fonts\KFOlCnqEu92Fr1MmWUlfChc4EsA.woff2 (new file) copy www\assets\google-fonts\KFOlCnqEu92Fr1MmWUlfCxc4EsA.woff2 platforms\android\app\src\main\assets\www\assets\google-fonts\KFOlCnqEu92Fr1MmWUlfCxc4EsA.woff2 (new file) copy www\assets\google-fonts\KFOmCnqEu92Fr1Mu4WxKOzY.woff2 platforms\android\app\src\main\assets\www\assets\google-fonts\KFOmCnqEu92Fr1Mu4WxKOzY.woff2 (new file) copy www\assets\google-fonts\KFOmCnqEu92Fr1Mu4mxK.woff2 platforms\android\app\src\main\assets\www\assets\google-fonts\KFOmCnqEu92Fr1Mu4mxK.woff2 (new file) copy www\assets\google-fonts\KFOmCnqEu92Fr1Mu5mxKOzY.woff2 platforms\android\app\src\main\assets\www\assets\google-fonts\KFOmCnqEu92Fr1Mu5mxKOzY.woff2 (new file) copy www\assets\google-fonts\KFOmCnqEu92Fr1Mu72xKOzY.woff2 platforms\android\app\src\main\assets\www\assets\google-fonts\KFOmCnqEu92Fr1Mu72xKOzY.woff2 (new file) copy www\assets\google-fonts\KFOmCnqEu92Fr1Mu7GxKOzY.woff2 platforms\android\app\src\main\assets\www\assets\google-fonts\KFOmCnqEu92Fr1Mu7GxKOzY.woff2 (new file) copy www\assets\google-fonts\KFOmCnqEu92Fr1Mu7WxKOzY.woff2 platforms\android\app\src\main\assets\www\assets\google-fonts\KFOmCnqEu92Fr1Mu7WxKOzY.woff2 (new file) copy www\assets\google-fonts\KFOmCnqEu92Fr1Mu7mxKOzY.woff2 platforms\android\app\src\main\assets\www\assets\google-fonts\KFOmCnqEu92Fr1Mu7mxKOzY.woff2 (new file) copy www\assets\google-fonts\roboto400700.css platforms\android\app\src\main\assets\www\assets\google-fonts\roboto400700.css (new file) mkdir platforms\android\app\src\main\assets\www\assets\js copy www\assets\js\main.js platforms\android\app\src\main\assets\www\assets\js\main.js (new file) mkdir platforms\android\app\src\main\assets\www\assets\sass mkdir platforms\android\app\src\main\assets\www\assets\sass\base copy www\assets\sass\base\_bg.scss platforms\android\app\src\main\assets\www\assets\sass\base\_bg.scss (new file) copy www\assets\sass\base\_page.scss platforms\android\app\src\main\assets\www\assets\sass\base\_page.scss (new file) copy www\assets\sass\base\_reset.scss platforms\android\app\src\main\assets\www\assets\sass\base\_reset.scss (new file) copy www\assets\sass\base\_typography.scss platforms\android\app\src\main\assets\www\assets\sass\base\_typography.scss (new file) mkdir platforms\android\app\src\main\assets\www\assets\sass\components copy www\assets\sass\components\_button.scss platforms\android\app\src\main\assets\www\assets\sass\components\_button.scss (new file) copy www\assets\sass\components\_form.scss platforms\android\app\src\main\assets\www\assets\sass\components\_form.scss (new file) copy www\assets\sass\components\_icon.scss platforms\android\app\src\main\assets\www\assets\sass\components\_icon.scss (new file) copy www\assets\sass\components\_icons.scss platforms\android\app\src\main\assets\www\assets\sass\components\_icons.scss (new file) copy www\assets\sass\components\_list.scss platforms\android\app\src\main\assets\www\assets\sass\components\_list.scss (new file) copy www\assets\sass\components\_section.scss platforms\android\app\src\main\assets\www\assets\sass\components\_section.scss (new file) mkdir platforms\android\app\src\main\assets\www\assets\sass\layout copy www\assets\sass\layout\_footer.scss platforms\android\app\src\main\assets\www\assets\sass\layout\_footer.scss (new file) copy www\assets\sass\layout\_header.scss platforms\android\app\src\main\assets\www\assets\sass\layout\_header.scss (new file) copy www\assets\sass\layout\_signup-form.scss platforms\android\app\src\main\assets\www\assets\sass\layout\_signup-form.scss (new file) mkdir platforms\android\app\src\main\assets\www\assets\sass\libs copy www\assets\sass\libs\_breakpoints.scss platforms\android\app\src\main\assets\www\assets\sass\libs\_breakpoints.scss (new file) copy www\assets\sass\libs\_functions.scss platforms\android\app\src\main\assets\www\assets\sass\libs\_functions.scss (new file) copy www\assets\sass\libs\_mixins.scss platforms\android\app\src\main\assets\www\assets\sass\libs\_mixins.scss (new file) copy www\assets\sass\libs\_vars.scss platforms\android\app\src\main\assets\www\assets\sass\libs\_vars.scss (new file) copy www\assets\sass\libs\_vendor.scss platforms\android\app\src\main\assets\www\assets\sass\libs\_vendor.scss (new file) copy www\assets\sass\main.scss platforms\android\app\src\main\assets\www\assets\sass\main.scss (new file) mkdir platforms\android\app\src\main\assets\www\assets\testApp-font mkdir platforms\android\app\src\main\assets\www\assets\testApp-font\fonts copy www\assets\testApp-font\fonts\icomoon.eot platforms\android\app\src\main\assets\www\assets\testApp-font\fonts\icomoon.eot (new file) copy www\assets\testApp-font\fonts\icomoon.svg platforms\android\app\src\main\assets\www\assets\testApp-font\fonts\icomoon.svg (new file) copy www\assets\testApp-font\fonts\icomoon.ttf platforms\android\app\src\main\assets\www\assets\testApp-font\fonts\icomoon.ttf (new file) copy www\assets\testApp-font\fonts\icomoon.woff platforms\android\app\src\main\assets\www\assets\testApp-font\fonts\icomoon.woff (new file) copy www\assets\testApp-font\testApp-style.css platforms\android\app\src\main\assets\www\assets\testApp-font\testApp-style.css (new file) mkdir platforms\android\app\src\main\assets\www\assets\webfonts copy www\assets\webfonts\fa-brands-400.eot platforms\android\app\src\main\assets\www\assets\webfonts\fa-brands-400.eot (new file) copy www\assets\webfonts\fa-brands-400.svg platforms\android\app\src\main\assets\www\assets\webfonts\fa-brands-400.svg (new file) copy www\assets\webfonts\fa-brands-400.ttf platforms\android\app\src\main\assets\www\assets\webfonts\fa-brands-400.ttf (new file) copy www\assets\webfonts\fa-brands-400.woff platforms\android\app\src\main\assets\www\assets\webfonts\fa-brands-400.woff (new file) copy www\assets\webfonts\fa-brands-400.woff2 platforms\android\app\src\main\assets\www\assets\webfonts\fa-brands-400.woff2 (new file) copy www\assets\webfonts\fa-regular-400.eot platforms\android\app\src\main\assets\www\assets\webfonts\fa-regular-400.eot (new file) copy www\assets\webfonts\fa-regular-400.svg platforms\android\app\src\main\assets\www\assets\webfonts\fa-regular-400.svg (new file) copy www\assets\webfonts\fa-regular-400.ttf platforms\android\app\src\main\assets\www\assets\webfonts\fa-regular-400.ttf (new file) copy www\assets\webfonts\fa-regular-400.woff platforms\android\app\src\main\assets\www\assets\webfonts\fa-regular-400.woff (new file) copy www\assets\webfonts\fa-regular-400.woff2 platforms\android\app\src\main\assets\www\assets\webfonts\fa-regular-400.woff2 (new file) copy www\assets\webfonts\fa-solid-900.eot platforms\android\app\src\main\assets\www\assets\webfonts\fa-solid-900.eot (new file) copy www\assets\webfonts\fa-solid-900.svg platforms\android\app\src\main\assets\www\assets\webfonts\fa-solid-900.svg (new file) copy www\assets\webfonts\fa-solid-900.ttf platforms\android\app\src\main\assets\www\assets\webfonts\fa-solid-900.ttf (new file) copy www\assets\webfonts\fa-solid-900.woff platforms\android\app\src\main\assets\www\assets\webfonts\fa-solid-900.woff (new file) copy www\assets\webfonts\fa-solid-900.woff2 platforms\android\app\src\main\assets\www\assets\webfonts\fa-solid-900.woff2 (new file) copy platforms\android\platform_www\cordova.js platforms\android\app\src\main\assets\www\cordova.js (updated file) copy www\css\index.css platforms\android\app\src\main\assets\www\css\index.css (updated file) mkdir platforms\android\app\src\main\assets\www\images copy www\images\bg01.jpg platforms\android\app\src\main\assets\www\images\bg01.jpg (new file) copy www\images\bg02.jpg platforms\android\app\src\main\assets\www\images\bg02.jpg (new file) copy www\images\bg03.jpg platforms\android\app\src\main\assets\www\images\bg03.jpg (new file) copy www\images\bg04.jpg platforms\android\app\src\main\assets\www\images\bg04.jpg (new file) mkdir platforms\android\app\src\main\assets\www\images\loader copy www\images\loader\dots.svg platforms\android\app\src\main\assets\www\images\loader\dots.svg (new file) copy www\images\loader\flight.svg platforms\android\app\src\main\assets\www\images\loader\flight.svg (new file) delete platforms\android\app\src\main\assets\www\img\cordova.png (no source) copy www\img\logo.png platforms\android\app\src\main\assets\www\img\logo.png (updated file) copy www\index.html platforms\android\app\src\main\assets\www\index.html (updated file) copy www\js\index.js platforms\android\app\src\main\assets\www\js\index.js (updated file) copy www\js\jquery.min.js platforms\android\app\src\main\assets\www\js\jquery.min.js (new file) Wrote out android application name "testApp.com" to C:\Users\user\Desktop\testApp\platforms\android\app\src\main\res\values\strings.xml Wrote out Android application SplashScreen Color to C:\Users\user\Desktop\testApp\platforms\android\app\src\main\res\values\colors.xml The "AndroidWindowSplashScreenBrandingImage" is undefined. Cordova's default will be used. Wrote out Android application SplashScreen Icon Color to C:\Users\user\Desktop\testApp\platforms\android\app\src\main\res\values\colors.xml Wrote out Android application themes to C:\Users\user\Desktop\testApp\platforms\android\app\src\main\res\values\themes.xml copy C:/Users/user/Desktop/testApp/platforms/android/app/src/main/java/com/testApp/MainActivity.java to C:\Users\user\Desktop\testApp\platforms\android\app\src\main\java\com\testApp\MainActivity.java Source and destination must not be the same. Error: Source and destination must not be the same. at Object.checkPathsSync (C:\Users\user\Desktop\testApp\node_modules\fs-extra\lib\util\stat.js:78:13) at Object.copySync (C:\Users\user\Desktop\testApp\node_modules\fs-extra\lib\copy\copy-sync.js:27:38) at updateProjectAccordingTo (C:\Users\user\Desktop\testApp\node_modules\cordova-android\lib\prepare.js:314:12) at C:\Users\user\Desktop\testApp\node_modules\cordova-android\lib\prepare.js:67:21 at async Promise.all (index 0)

C:\Users\user\Desktop\testApp>

Environment, Platform, Device

Version information

cordova-ndroid 11.0.0 Node 16.15.1 Cli 11.0.0 Java JDK 11 Windows 11

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
erisucommented, Jul 4, 2022

Thank you for your quick test and confirmation. @AndrWeisR

As @breautek pointed out in a previous comment:

cordova-android@11 is already in the voting stage at this time of writing so I’m going to add this to a 11.0.1 milestone.

The voting stage generally lasts 48 hours and requires a 2+1 approval vote to be successful.

It has already been open for over 48 hours and has enough votes to be considered successful.

Since the release itself was not completed and I have not officially closed the vote, I need to decide if I should terminate or continue with the release.

If I continue with the release, I will push the fix for a quick patch release as Norman suggested. But again all releases, even a restart of a terminated release, require the same voting requirements of 48 hours minimum w/ 2+1 approval.

1reaction
erisucommented, Jul 4, 2022

@AndrWeisR Could you try this in your project? as a test to confirm if this works for you…

In node_modules/cordova-android/lib/prepare.js

On line 306, you should see this:

const destFile = java_files[0];

Change it to this:

const destFile = path.normalize(java_files[0]);

This should correct the path segment separator to the platform-specific path segment separator…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Source and destination must not be the same. #693 - GitHub
I just updated Cordova-Android. I expecting the node plugin fa-extra. Maybe Cordova-Android uses this with wrong attributes? Command or Code.
Read more >
error on ionic cordova android build "Source and destination ...
At first, manually remove this: node_modules folder. package-lock.json file. platform > android folder. enter image description here.
Read more >
Android Platform Guide - Apache Cordova
Android Platform Guide. This guide shows how to set up your SDK environment to deploy Cordova apps for Android devices, and how to...
Read more >
syslog-ng Open Source Edition 3.23 - Administration Guide
Solution: Enable flow-control in the log path. If flow-control is disabled, syslog-ng will drop messages if the destination queues are full. Note that...
Read more >
Cordova Android 11 Build Error - Ionic Forum
Hello, I have upgraded cordova-android of my ionic 6 project from 10.1.2 to 11.0.0 using below commands as shown in this cordova's official ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found