0

I'm trying to run a blank app of ionic 4 on my android 9 device. Already followed each step on the website and running it on browser is okay. When I run it on my device here is what i get: Error when running It says I dont have gradle and android studio but here is my environment: android sdk list,my /etc/environment,and my npm, ionic, gradle and java versions Am I missing something guys?

Renasance
  • 3
  • 1

3 Answers3

0

Your question is not clear, are you facing error on local emulator or real mobile device? it seems you are trying to run on local android emulator, can you please mention that where you are facing error?

Also, please do debug or production build with the help of ionic cordova build android command and try to run on your android device, generally android studio will pops up of gradle build update, which will help to generate faster sequential android build, and which needs gradle for it.

Maulik
  • 510
  • 1
  • 7
  • 22
  • I am trying to run in on a real mobile device. I tried ionic cordova build android and it returns the same error. Here's an image of the error it gives. https://imgur.com/a/ospmqwf. Same as the error I posted above – Renasance Nov 05 '19 at 12:42
  • Can you check if this question helps to you or not? : https://stackoverflow.com/questions/43480076/ionic-2-error-could-not-find-an-installed-version-of-gradle-either-in-android Also, can you please re-run cordova build with verbose option and post entire response with error, just to make sure if any other cordova error is there or not. – Maulik Nov 05 '19 at 13:07
  • 1
    sudo add-apt-repository ppa:cwchien/gradle : sudo apt-get update : sudo apt-get install gradle | These commands helped me out. I tried what the installation page says. Like SDKman and also the manual, the SDK man after installing everything my system didnt recognize the gradle command, but with the manual it does but it still gave me that error. Anyways problem is solved! The app is now running on the device! THANKS! – Renasance Nov 09 '19 at 03:56
0

This error occurs when gradle is not properly installed. I have experienced this before. try installing gradle on your system.

For some reason the ionic project does not locate the gradle, to verify that this is the case, try opening the project on android studio and you will get the warning that no gradle wrapper was found.

Mr Strange
  • 666
  • 6
  • 4
0

IDK if some of you people have the same problem, but it's because of the Gradle. Installed it the way the website said, tried both automatically with SDK manager and also the manual downloads. Still no. So I installed it using:

sudo add-apt-repository ppa:cwchien/gradle

sudo apt-get update

sudo apt-get install gradle

Then find location where it was installed then add to path. Now I can install the app on my device

Renasance
  • 3
  • 1