Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Messages: [Source and destination must not be the same.] in cordova-android@8.0.0 #692

Closed
3 tasks
Riyaz0001 opened this issue Mar 17, 2019 · 10 comments
Closed
3 tasks

Comments

@Riyaz0001
Copy link

Bug Report

Problem

Error Messages: [Source and destination must not be the same.] in cordova-android@8.0.0

What is expected to happen?

cordova platform add android@8.0.0

What does actually happen?

Information

Command or Code

Environment, Platform, Device

Version information

Checklist

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

dpogue commented Mar 17, 2019

Are you on Windows? This sounds like the same problem as https://github.com/apache/cordova-common/issues/64

@apiaget
Copy link

apiaget commented Mar 17, 2019

Hello all !

I may add that I am encountering this issue too. For me the only workaround was to run the following commands once or twice…

cordova platform rm android
cordova platform add android@8.0.0

When, with the same project, I was on cordova-android@7.1.1, I never encountered this problem. But I decided to upgrade a few days ago and this bug arise.

Regarding the environment, I am on windows 10. Here is the complete environment info:

Cordova:
cordova (cli):      8.1.2 (cordova-lib@8.1.1)
platforms:          "cordova-android": "8.0.0"
fs-extra:           3.0.1
System:
Android SDK Tools:  28.0.3
NodeJS:             10.13.0
npm:                6.8.0
OS:                 Windows 10 v1809

For me, the fs-extra defect referred in the apache/cordova-common#64 issue could well be the source of this bug !

@dpogue
Copy link
Member

dpogue commented Mar 18, 2019

I'm going to close this issue in favour of keeping the discussion in one spot at https://github.com/apache/cordova-common/issues/64. Unfortunately, our ability to solve this problem is largely limited by NodeJS and fs-extra.

@Domvel
Copy link

Domvel commented Mar 18, 2019

@apiaget Your "workaround" to reinstall the android platform is for sure a random and temporary behavior and not a solution. Because this error does not always occur. In my case I always build from a blank (git tracked file only) state. Without node_modules and no platforms folder. A hard-clean. In my case the build fails in most of tries. I don't even know the core of this problem. I hope for a upcoming solution and fast workaround. Currently I can't build the app.

@Domvel
Copy link

Domvel commented Mar 18, 2019

@dpogue This seems to be happen since Cordova-Android 8.0.0. What changed in relation to fs-extra? Maybe Cordova-Android should use older - working - version? In fact, the build nearly always fails. It's a very critical bug. ... What do you think about it? I have not quite understood the problem yet. I'm looking for a workaround. Until jprichardson/node-fs-extra#657 / jprichardson/node-fs-extra#626 is / are fixed.
I just wondering: I this a Cordova-Android 8.0.0 only issue? If yes, what changed? What could be fixed / workaround?

@dpogue
Copy link
Member

dpogue commented Mar 18, 2019

What changed in relation to fs-extra?

As part of the major version bump to several underlying libraries (cordova-common, cordova-lib, cordova-fetch, etc.) we migrated a bunch of code from shelljs to use fs-extra instead. This significantly improved the reliability of tests and resolved several weird bugs that people had been seeing for years. Unfortunately, this issue didn't show up in any of our test suites (which we do run on Windows).

So it's not a change at the cordova-android level, it's in the cordova-common library which is used by all the platforms and the Cordova tooling.

This issue appears to only affect people using Windows, which is probably why it's only getting reported on the Android repo and not iOS.

@Domvel
Copy link

Domvel commented Mar 18, 2019

Thanks.
Just a conclusion of the current situation:
If I understand it correctly. There is a number / bigint issue. Maybe the state.ino (inode) of fs want returns a greater number as the safe integer of JavaScript (53bit). But NodeJS also supports bigint in latest version (10.x) and would probably fix the problem.
Weird that this is only in Windows. Maybe the other OS (linux, darwin) does not have such big numbers for the inode. Idk.

In fact, with this problem I can't build my app. It's a K.O.
Workarounds:
a) Revert to Cordova-Android 7.x.
b) Use another OS (e.g. Linux) to build. No guarantee, but it seems to be a Windows only issue.
c) Fork extra-fs and fix it. (recommended) but I need it now. Long way until merge and discussions. Also new Cordova version.
d) Revert Cordova and replace fs-extra. (It's a solution, nothing else. 😃 )
e) Any idea to keep Cordova-Android 8.0.0. I could overwrite the compiled JavaScript of fs-extra to remove the ino-validation. Quick and dirty. Or work with my own fork.

Be free to join the discussion:
jprichardson/node-fs-extra#657

@Riyaz0001
Copy link
Author

Riyaz0001 commented Mar 26, 2019

Are you on Windows? This sounds like the same problem as apache/cordova-common#64

Yes.

@shijunti19
Copy link

Should be fixed in v8.0.1

@idiglove
Copy link

Should be fixed in v8.0.1

^8.1.0 worked for me though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants