I’m having an issue running cordova run android
in my Ionic project. I’ve uninstalled and reinstalled Cordova, Ionic, Gradle, and Android Studio, yet I still get this following error.
FAILURE : Build failed with an exception.
Where :
Script ‘path/platforms/android/cordova-android-play-services-gradle-release/app-cordova-android-play-services-gradle-release.gradle’ line: 11
What went wrong : A problem occurred evaluating script.
Could not read script ‘path/platforms/android/app/cordova-android-play-services-gradle-release/properties.gradle’ as it does not exist.
Question: How can I get this error to go away and my project to run successfully?
cli packages: (path/node_modules)
@ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
@ionic/app-scripts : 3.1.7
Cordova Platforms : android 7.0.0
Ionic Framework : ionic-angular 3.9.2
System:
ios-deploy : 1.9.2
Node : v8.9.1
npm : 5.5.1
OS : macOS Sierra
Xcode : Xcode 9.2 Build version 9C40b
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro
That looks ok. You get that error when you type ionic cordova run android
in your project command line?
Yep, still getting the same error
I don’t know. There was a recent structure change though. Check here, might help. Good luck!
Cordova just released version 7.0.0 of cordova-android:
https://cordova.apache.org/announcements/2017/12/04/cordova-android-7.0.0.html
This version switches the Android project from the ancient structure to a modern one where the app code actually lives in app - so Android Studio and Android tooling is a lot more happy with it.
It is not installed by default yet, so you have to switch manually:
ionic cordova platform remove android
ionic cordova platform add android@7.0.0
The path changes …
1 Like
What plugins are you using?
You might try to replace cordova-android 7.0.0 with 6.4.0 and try if it works.
Fixed it, I deleted the cordova-android-play-services-gradle…etc plugin and it works now.