7

I am getting the following error and I believe I have everything installed for building to target android. What are steps to resolve this error. I provided the android studio sdk manager view.

* 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 1s
(node:7005) UnhandledPromiseRejectionWarning: Error: /Users/SomeUser/Documents/workspaceOld/09042018110859/Company/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':CordovaLib'.
> Failed to find target with hash string 'android-26' in: /Users/SomeUser/Library/Android/sdk

-----

* 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 1s
    at ChildProcess.whenDone (/Users/SomeUser/Documents/workspaceOld/09042018110859/Company/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
    at emitTwo (events.js:126:13)

Current information:

SomeUser-MacBook-Pro:Primerica SomeUser$ npm -v
6.4.1
SomeUser-MacBook-Pro:Primerica SomeUser$ node -v
v8.11.1
SomeUser-MacBook-Pro:Primerica SomeUser$ cordova -v
8.0.0

At the android sdk level, these directories exist:

./platforms/android-26
./system-images/android-26
./sources/android-26

enter image description here

What are they looking for here:

Failed to find target with hash string 'android-26' in: /Users/SomeUser/Library/Android/sdk

shizhen
  • 12,251
  • 9
  • 52
  • 88
Berlin Brown
  • 11,504
  • 37
  • 135
  • 203

2 Answers2

1

Find the attached link to configure the cordova in your PC

https://drive.google.com/file/d/1h6InPOJrinEJDTYWjpYDefyH-3g9IAQC/view

and make sure that

On SDK Manager, be sure to check the box on "show package descriptions"; then you should also select the "Google APIs" for the version you are willing to install.

Install it and check.

Hope this will help you. Thank you

Vijaya Varma Lanke
  • 603
  • 2
  • 7
  • 19
0

you might have to set the path in the local.properties file:

sdk.dir=/Users/SomeUser/Library/Android/sdk

and set the ANDROID_SDK_ROOT in the user profile (eg. ~/.bashrc):

export ANDROID_HOME=/Users/SomeUser/Library/Android/sdk
export ANDROID_SDK_ROOT=$ANDROID_HOME
Martin Zeitler
  • 1
  • 19
  • 155
  • 216