Closed Domvel closed 2 years ago
Late discovered. Related to https://github.com/apache/cordova-android/issues/692 and https://github.com/apache/cordova-common/issues/64.
Hey, we are facing a similar error. Have you found a way how to fix it? Thanks a lot in advance!
For me, the issue was that I was using the <edit-config>
tag in my config.xml file that contained a <uses-permission>
tag that was already included in the manifest file.
I figured since the mode was in "merge", this wouldn't be a problem, but removing that fixed the issue. This was using 8.0.0 (might not be exactly the same problem but just in case for anyone else that stumbles along here).
cordova-android
doesn't use fs-extra
yet. Is the issue reproducible using Cordova 9?
For me, the issue was that I was using the
<edit-config>
tag in my config.xml file that contained a<uses-permission>
tag that was already included in the manifest file.
Thanks for your help, but I do not have this line in the config.xml
cordova-android
doesn't usefs-extra
yet. Is the issue reproducible using Cordova 9?
Oh, frankly, I am not a developer. Guy why started the project got sick and I am trying to fix this issue by myself.
I am using Cordoba 9 version.
Running the command that produces the error with the --verbose
flag should produce a stacktrace that lead to that error. Please provide that information, so that we can track down where the fault is. Thanks.
Im also getting this error, I'm executing the following command :
ionic cordova platform add android@8
Im also getting this error, I'm executing the following command :
ionic cordova platform add android@8
Does ionic support passing down the --verbose
flag to the cordova command?
Yes I added verbose now and I will tell you the result
This is part of the log:
copy platforms\android\platform_www\cordova.js platforms\android\app\src\main\assets\www\cordova.js (updated file)
copy platforms\android\platform_www\cordova_plugins.js platforms\android\app\src\main\assets\www\cordova_plugins.js (updated file)
copy platforms\android\platform_www\plugins\cordova-plugin-actionsheet\www\ActionSheet.js platforms\android\app\src\main\assets\www\plugins\cordova-plugin-actionsheet\www\ActionSheet.js (updated file)
copy platforms\android\platform_www\plugins\cordova-plugin-android-permissions\www\permissions.js platforms\android\app\src\main\assets\www\plugins\cordova-plugin-android-permissions\www\permissions.js (updated file)
copy platforms\android\platform_www\plugins\cordova-plugin-app-version\www\AppVersionPlugin.js platforms\android\app\src\main\assets\www\plugins\cordova-plugin-app-version\www\AppVersionPlugin.js (updated file)
copy platforms\android\platform_www\plugins\cordova-plugin-background-mode\www\background-mode.js platforms\android\app\src\main\assets\www\plugins\cordova-plugin-background-mode\www\background-mode.js (updated file)
copy platforms\android\platform_www\plugins\cordova-plugin-device\www\device.js platforms\android\app\src\main\assets\www\plugins\cordova-plugin-device\www\device.js (updated file)
copy platforms\android\platform_www\plugins\cordova-plugin-dialogs\www\android\notification.js platforms\android\app\src\main\assets\www\plugins\cordova-plugin-dialogs\www\android\notification.js (updated file)
copy platforms\android\platform_www\plugins\cordova-plugin-dialogs\www\notification.js platforms\android\app\src\main\assets\www\plugins\cordova-plugin-dialogs\www\notification.js (updated file)
copy platforms\android\platform_www\plugins\cordova-plugin-ezbiosdk\www\EzBioSDKPlugin.js platforms\android\app\src\main\assets\www\plugins\cordova-plugin-ezbiosdk\www\EzBioSDKPlugin.js (updated file)
copy platforms\android\platform_www\plugins\cordova-plugin-eztokensdk\www\EzTokenSDKPlugin.js platforms\android\app\src\main\assets\www\plugins\cordova-plugin-eztokensdk\www\EzTokenSDKPlugin.js (updated file)
copy platforms\android\platform_www\plugins\cordova-plugin-geolocation\www\PositionError.js platforms\android\app\src\main\assets\www\plugins\cordova-plugin-geolocation\www\PositionError.js (updated file)
(node:11892) UnhandledPromiseRejectionWarning: Error: Source and destination must not be the same.
at Object.checkPathsSync (D:\Peter\<project>\<project-path>\node_modules\fs-extra\lib\util\stat.js:92:11)
(node:11892) UnhandledPromiseRejectionWarning: Error: Source and destination must not be the same. at Object.checkPathsSync (D:\Peter\
\ \node_modules\fs-extra\lib\util\stat.js:92:11)
Is this the entire stacktrace? Seems strange there is only one item in the trace.
No but didnt wanna add it because this is a company's project, not mine personal. But here is the rest:
(node:11892) UnhandledPromiseRejectionWarning: Error: Source and destination must not be the same.
at Object.checkPathsSync (D:\Peter\<project>\<project>\node_modules\fs-extra\lib\util\stat.js:92:11)
at Object.copySync (D:\Peter\<project>\<project>\node_modules\fs-extra\lib\copy-sync\copy-sync.js:24:38)
at updatePathWithStats (D:\Peter\<project>\<project>\node_modules\cordova-common\src\FileUpdater.js:103:24)
at D:\Peter\<project>\<project>\node_modules\cordova-common\src\FileUpdater.js:298:19
at Array.forEach (<anonymous>)
at Object.mergeAndUpdateDir (D:\Peter\<project>\<project>\node_modules\cordova-common\src\FileUpdater.js:296:33)
at updateWww (D:\Peter\<project>\<project>\platforms\android\cordova\lib\prepare.js:161:17)
at Api.module.exports.prepare (D:\Peter\<project>\<project>\platforms\android\cordova\lib\prepare.js:60:19)
at Api.prepare (D:\Peter\<project>\<project>\platforms\android\cordova\Api.js:175:45)
at C:\Users\Peter\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\prepare.js:106:36
It worked, I removed the plugin cordova-plugin-android-permissions
.
Great. But now I need to figure out why it is not working with cordova-plugin-android-permissions
.
I dont wanna stay till night here :p Do you know any other cordova plugin for android permissions?
Thank you, I think this is enough information to at least investigate where the error is coming from.
I dont wanna stay till night here :p Do you know any other cordova plugin for android permissions?
I use https://github.com/dpa99c/cordova-diagnostic-plugin personally.
It worked with cordova-android-permission
, I added the following in the config.xml
:
<config-file parent="/*" target="AndroidManifest.xml">
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
</config-file>
Then added the plugin again, then I added the android platform and it worked.
Now for the build.
Im not sure what the problem is, but it seems its all related to this plugin and <config-file>
as @cambooo commented before
Btw the build succeeded
Now I got this error again when building, even though I didnt change anything
I just received this error at work, it was trying to copy a file that was a symlink.
Modifying the following line:
To add the options parameter:
{
"dereference": true
}
Fixed the problem for me.
The deference
option does:
dereference
: dereference symlinks, default is false.
Hey, I was having same error "Source and destination must not be the same" My error was solved by Following Command
cordova clean android
I got the same error.
ionic cordova run android --release --verbose
I am closing out this ticket as we beleive it has been resolved since.
Since then, I have not be able to reproduced it anymore.
If anyone is still see this issue, please try and reinstall with the latest versions of:
cordova
CLIcordova-android
PlatformReinstall Cordova w/ Latest Version
npm uninstall -g cordova
npm install -g cordova@latest
Reinstall Platform w/ Latest Version (in the project directory)
cordova platform remove android
cordova platform add android@10.0.1
If problem persists please make a new ticket with updated information, such as:
stacktrace
cordova info
printout
Bug Report
Problem
Since
cordova-android
8.0.0 we have build problems. In most of cases we got the error "An error occurred while running subprocess cordova." and the last line "Source and destination must not be the same". Sometimes, the build is ok. - We always check out the git repository of the app. (hard clean)What is expected to happen?
Build successfully.
What does actually happen?
Build failed.
Information
This error is not 100% reprocable. But about 80%. I just updated Cordova-Android. I expecting the node plugin fa-extra. Maybe Cordova-Android uses this with wrong attributes?
Command or Code
ionic cordova build android --release --prod --generateSourceMap false
But alsoionic cordova build
orcordova build
.Environment, Platform, Device / Version information
Log