I know this question was already posted, but I couldn't resolve my problem in any way. I'm developing an app with the Ionic Framework: I added the Android platform and built the apk flawlessly. Then I added the diagnostic plugin, and built again, but this time the action failed and gave me this error:
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
- What went wrong:
A problem occurred configuring root project 'android'.
You have not accepted the license agreements of the following SDK components: [Android Support Repository]. Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
Since before installing the plugin the apk was built ok, I think the problem could lie there, but I don't know how to solve it.
Also, in my code I added this to check if GPS is enabled or not:
this.diagnostic.isLocationEnabled().then((state)=>{
if(state){
this.displayGPSError("Enabled")
} else{
this.displayGPSError("Not enabled")
}
})
If I run the app with this piece of code in the browser, I get the following error:
Uncaught (in promise): cordova_not_available
Then, if I comment the piece of code, no error is shown on browser (but the apk building still doesn't work).