whenever i run build android command . my project is giving me this error.It was working fine earlier
[WARN] Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova).
TypeError: Cannot read property 'find' of null;
Description:
Steps to Reproduce:
Example repo:
1.
2.
3.
Output:
My ionic info:
@ionic/cli-plugin-cordova : 1.6.2
@ionic/cli-plugin-ionic-angular : 1.4.1
@ionic/cli-utils : 1.7.0
ionic (Ionic CLI) : 3.7.0
global packages:
Cordova CLI : 6.5.0
local packages:
@ionic/app-scripts : 2.1.3
Cordova Platforms : none
Ionic Framework : ionic-angular 3.6.0
System:
Android SDK Tools : 25.2.5
Node : v7.10.0
OS : Windows 10
npm : 5.3.0
Other Information:
Delete your node_modules folder, execute npm install. Does this fix anything?
Run npm list -g --depth=0 and post the result.
still issue.
C:UsersDELLAppDataRoamingnpm
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
`-- [email protected]
hi got the issue. i checked the git and found that all detail from my config file was missing. i don't know how it got deleted but now it is working
Which file exactly?
Was the file missing or just empty?
(This maybe should be handled better by the CLI...)
config.xml. i don't know how i got it empty. may be while changing app version manually, something goes wrong my side.
Oh, this is something the Cordova people would have to fix then. Please report it at http://issues.cordova.io that en empty config.xml triggers this error. Thanks.
@vksgautam1 @janpio The Ionic CLI also reads and writes from/to config.xml. We do expect it to have some resemblance of the config.xml from our starters (not a blank xml file), but I think the errors should be better as of CLI 3.7.
That is crazy, I just had the same problem. I'm sure that my config.xml file was correct yesterday. Its is empty now!
edit: for what I remember, that could be a update of cordova I made yesterday. Still don't explain the empty file
When I run the command ionic cordova run android --livereload --address [MY EXTERNAL IP] my config.xml file goes blank.
Once the config.xml file is blank, trying to run your app will produce the error TypeError: Cannot read property 'find' of null
yes config.xml disappeared too with livereload problem : https://github.com/ionic-team/ng-cordova/issues/1413
Same problem about Cannot read property 'findall' of null => I tried this and its working now :
ionic cordova platform rm android
ionic cordova platform add android
The issues happens when trying to build, the config.xml gets empty because it's a default procedure Cordova does, what happens is that when having low disk memory, the file gets deleted on the process and never back again. The fix would be simply pasting back whatever was on that config.xml
@vksgautam1 I had exactly the same issue. Config.xml got empty! Thanks for sharing.
@buddywa I also did the same thing. I run --livereload. Then this error started happening....
I was facing the same issue where my config.xml was getting empty, So I found that port 8100 was already in use with ionic server --lab, Hence I stop that process and rerun ionic cordova run -l -c -s again and It worked.
Has everyone whose had this issue been on Windows? It'd be helpful to have ionic info.
Same here, worked last night, but not today:
Input: "ionic cordova run android --livereload"
Output: "TypeError: Cannot read property 'find' of null"
Workaround: Copy and paste config.xml from another Ionic app
$ ionic info
cli packages: (/usr/lib/node_modules)
@ionic/cli-utils : 1.12.0
ionic (Ionic CLI) : 3.12.0
global packages:
cordova (Cordova CLI) : 7.0.1
local packages:
@ionic/app-scripts : 2.1.4
Cordova Platforms : android 6.2.3
Ionic Framework : ionic-angular 3.6.1
System:
Android SDK Tools : 25.2.4
Node : v7.7.4
npm : 4.1.2
OS : Linux 4.8
Misc:
backend : legacy
Does it just happen randomly? I tried what @abdulwahid24 did and still can't reproduce the issue.
Hello everyone. The issue still persists.
After send the command:
ionic cordova run android -l
I got an error, so after run again, i get my config.xml empty.
So after the config.xml empty the first error get poped.
Full log:
$ ionic cordova run android -l
[WARN] Detected @ionic/cli-plugin-ionic1 in your package.json.
As of CLI 3.8, it is no longer needed. You can uninstall it:
npm uninstall --save-dev --save-exact @ionic/cli-plugin-ionic1
[WARN] Detected @ionic/cli-plugin-gulp in your package.json.
As of CLI 3.8, it is no longer needed. You can uninstall it:
npm uninstall --save-dev --save-exact @ionic/cli-plugin-gulp
[WARN] Multiple network interfaces detected!
You will be prompted to select an external-facing IP for the livereload server that your device or emulator has
access to.
You may also use the --address option to skip this prompt.
? Please select which IP to use: 192.168.2.52
[INFO] Starting server (address: 0.0.0.0, port: 8101, dev server port: 53703, livereload port: 35730) - Ctrl+C to cancel
[INFO] Development server running!
Local: http://localhost:8101
External: http://192.168.2.52:8101, http://192.168.57.1:8101
events.js:160
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::53703
at Object.exports._errnoException (util.js:1018:11)
at exports._exceptionWithHostPort (util.js:1041:20)
at Server._listen2 (net.js:1262:14)
at listen (net.js:1298:10)
at net.js:1408:9
at _combinedTickCallback (internal/process/next_tick.js:83:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
After run the command again:
$ ionic cordova run android -l
TypeError: Cannot read property 'find' of null
at ConfigXml.resetContentSrc (/home/rodrigo/repositorios/mobile/ionic/pmr-mobile-2-pernod/node_modules/ionic/node_modules/@ionic/cli-utils/lib/cordova/config.js:63:34)
at RunCommand.<anonymous> (/home/rodrigo/repositorios/mobile/ionic/pmr-mobile-2-pernod/node_modules/ionic/dist/commands/cordova/base.js:151:18)
at next (native)
at fulfilled (/home/rodrigo/repositorios/mobile/ionic/pmr-mobile-2-pernod/node_modules/tslib/tslib.js:93:62)
In the first command i got a ADDR IN USE but this error could be a chain to erase the config.xml?
Ionic info output:
cli packages: (/home/rodrigo/repositorios/mobile/ionic/pmr-mobile-2-pernod/node_modules)
@ionic/cli-utils : 1.12.0
ionic (Ionic CLI) : 3.12.0
global packages:
cordova (Cordova CLI) : 6.5.0
local packages:
Cordova Platforms : none
Ionic Framework : ionic1 1.2.4
System:
Android SDK Tools : 26.0.1
Node : v6.10.2
npm : 3.10.10
OS : Linux 4.10
Thanks in advance.
Thanks @proclnas !! I found the bug... I just wasn't handling errors properly. Node is a little rough sometimes.
I've just had the same issue. And my config.xml became empty. This is sad, because there were modifications in config.xml that were not committed, yet, and all is gone. The steps that brought me to this situation are:
@ionic/cli-plugin-cordova, @ionic/cli-plugin-ionic1, @ionic/cli-plugin-gulpionic cordova run ios --device --livereloadHi everyone, how can we restore the config.xml file without backup copies?
No.
(Why aren't you using git?)
(Maybe check the platforms folder for config.xml files, maybe it is copied over there)
How can i fix this?
TypeError: Cannot read property 'find' of null
at ConfigXml.resetContentSrc (C:\Users....\AppData\Roaming\npm\node_modules\ionic\node_modules\@ionic\cli-utils\lib\cordova\config.js:63:34)
at RunCommand.
at next (native)
at fulfilled (C:\Users....\AppData\Roaming\npm\node_modules\ionic\node_modules\tslib\tslib.js:93:62)
https://github.com/ionic-team/ionic-app-scripts/releases/tag/v3.0.0
ionic build android --aot --minifyjs --minifycss
it created my config.xml blanked
I had the same problem
i've my config.xml back with git versioning only.
I had the same problem, fortunately, I found a config.xml in one of my last builds (android).
Check the following directories, if there is maybe a config.xml inside:
path/to/your/project/platforms/android/res/xml/config.xml <--path/to/your/project/platforms/android/build/intermediates/res/merged/debug/xml/config.xml <--As I run allways the ionic cordova run android --device --livereload command as sudo, like sudo ionic cordova run android --device --livereload, the config.xml's were read-only.
In case You have a iOS build, try to change the android part of the paths to iOS.
Hope the best for You guys. Never forget to backup your data.
Same happened, the output was:
TypeError: Cannot read property 'find' of null
My env:
cli packages: (/xxx/ionic-v1/node_modules)
@ionic/cli-utils : 1.9.2
ionic (Ionic CLI) : 3.9.2
global packages:
Cordova CLI : 7.0.1
Gulp CLI : CLI version 3.9.1 Local version 3.9.1
local packages:
Cordova Platforms : none
Ionic Framework : unknown
System:
Android SDK Tools : 26.1.1
Node : v6.11.4
npm : 3.10.10
OS : Linux 4.10
Had to restore config.xml from git.
@guilhermegeek Your CLI version is getting pretty old. The fix was put into 3.13.0 (3.16.0 is the latest).
This might be old, but I ran into the issue and found out what was wrong with my config.xml in case anyone runs into the same issue. In my case I defined an iOS only setting outside the ios platform block. It was working whilst i was doing iOS build but when i went to build android I got the error.
So as a quick debug delete any additional options one by one to find the culprit. From there you can figure out why its broken. In my case it was defining edit-config file="*-Info.plist" mode="merge" target="NSLocationWhenInUseUsageDescription" outside the platform name="ios" tag.
Hope this helps someone!
(P.S. im more or less on bleeding edge cordova and it is still an issue)
Most helpful comment
hi got the issue. i checked the git and found that all detail from my config file was missing. i don't know how it got deleted but now it is working