My ionic project was working perfectly without error. But when I was trying to build the ionic project using the command "ionic cordova build android". I got the following error,
Cordova Android build error "Cannot read property 'length' of undefined"
To know more detail about the error I command "ionic cordova build android --verbose" then I come
to know gradlepath value is undefined. I was already installed gradle in my PC.
Then I checked the enviroment variables path value that also perfect.
I downgrade cordova cli
npm install -g cordova@6.4.0
I also removed platform folder and added using the command.
ionic cordova platform rm android
ionic cordova platform add android
after I run the build the project same error. I searched internet no solution
Solution:
Finaly I realised I was updated by Android studio 4.0.1 (windows). Previously I installed 3.0.1.
now I removed the recent one and installed the previously android studio.
Next, I closed the visual studion code and reopened it and opened my project and run build
command. The project build succeful and apk was generated in output path.
Post your comments / questions
Recent Article
- The request was aborted: Could not create SSL/TLS secure channel -Error in Asp.net
- FieldError: Cannot resolve keyword 'id' into field in Django project
- How to hide the ID field from the Django admin?
- It is impossible to add a non nullable field without specifying a default. Django error
- ImportError: cannot import name 'url' from 'django.conf.urls' - Django Error
- How to Enable Virtualization in BIOS Security Settings in Intel Processors For Android Studio?
- Dependency 'androidx.activity:activity:1.8.0' requires libraries and applications that depend on it.
- AttributeError: 'NoneType' object has no attribute 'get_text' - Python
Related Article