I cant run my project in android studio or on a device

#1

Hi, i want to open my project in a android emulator or device. but when i write " ionic cordova run android" i take this error:

What went wrong:

A problem occurred evaluating project ‘:CordovaLib’.

> No installed build tools found. Install the Android build tools version 19.1.0 or higher.

*** Try:**

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

*** Get more help at https://help.gradle.org**

BUILD FAILED in 0s

/Users/bugra/Desktop/ionic denemeler/sayfa/platforms/android/gradlew: Command failed with exit code 1 Error output:

FAILURE: Build failed with an exception.

How can i solve the problem? thx.

#2

Hello,
check if you have proper build tools installed, Take a look to sdk manager.

Best regards, anna-liebt

#3

i have installed necessary build tools which is 28.0.3 version. and i tools are updated. android version is Android 9.0 Pie. but still not working.

#4

What went wrong:
A problem occurred configuring root project ‘android’.

Could not resolve all files for configuration ‘:classpath’.
Could not find manifest-merger.jar (com.android.tools.build:manifest-merger:26.0.0).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/manifest-merger/26.0.0/manifest-merger-26.0.0.jar
Could not find ddmlib.jar (com.android.tools.ddms:ddmlib:26.0.0).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/ddms/ddmlib/26.0.0/ddmlib-26.0.0.jar
Could not find dvlib.jar (com.android.tools:dvlib:26.0.0).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/dvlib/26.0.0/dvlib-26.0.0.jar
Could not find common.jar (com.android.tools:common:26.0.0).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/common/26.0.0/common-26.0.0.jar

i have this error now.

#5

@flotilla did you found a solution on that? have the same problem right now…

#6

no, i couldnt find the solution.

#7

which android version are you using in your project?
=> ionic cordova platform list

#8
> cordova platform ls
Installed platforms:
  android 7.0.0
Available platforms: 
  browser ~5.0.1
  ios ~4.5.4
  osx ~4.0.1
  windows ~5.0.0
  www ^3.12.0

I kind of found the solution, I had to update the build.gradle -files - this section:

...
    repositories {
        mavenCentral();
        maven { url "https://maven.google.com" }
        jcenter()
    }
...

I’ve read somewhere that the order is important, because the above message said that it didn’t found the dependency manifest-merger ( and it does not exists with the given version from above ). But the question is, is this a problem of ionic, or cordova - and is this already fixed in another version?
-> we can’t always change the generated files if a new co-worker clones the repository of our project.

thanks in advance!

#9

Usually you don’t need to do anything about the order manually.
I assume in this case something went wrong while installing the android platform to your project.
What you could do, just to see if this helps, is to remove the android platform and add it again.
I use ionic 4 and had never this problem.
=> ionic cordova platform add android@latest

and as you can see here:
https://cordova.apache.org/docs/en/latest/guide/platforms/android/

Your android version ist 7.x.x which ist for API level up to 27 and not 28