Reputation: 73
I'm a complete beginner at creating mobile apps. I created an Ionic mobile app for Android using Windows and Visual Studio 2017. It works when I use the ionic serve command and try the app in the browser.
But when I try to import the project into Android Studio 2.3.3, I get an error message, that it can't build my app: "Gradle sync failed: Failed to find target with hash string 'android-26' in: ...\AppData\Local\Android\Sdk Gradle sync completed. Gradle build finished with 1 error(s)."
I also get another error message after importing the project into Android Studio, when I try to run the "ionic cordova run android" command in cmd: "An error occured while running cordova run android. FAILURE: Build failed with an exception. Where: ...\cordova.gradle line 64
What went wrong: A problem occured evaluating root project 'android'. No installed build tools found. Install the Android build tools version 19.1.0 or higher."
I imported the files into Android Studio choosing Import project (Eclipse,...). I chose this folder when importing: node_modules\cordova-android\spec\fixtures\android_project. I'm not sure this is the right folder to choose.
I can see the simulated android phone , I can click on everything, but my app doesn't show up on it. I checked the Android build tools, 25.0.3 and 26.0.2 are installed. Thank you for the help in advance! I'm really stuck :S
Upvotes: 0
Views: 709
Reputation: 570
You are choosing Wrong Folder.
To open your ionic generated app. You need to open the following folder in the path:
Your_ionic_project/platforms/android
Upvotes: 1
Reputation: 570
Check whether you have set your system PATH variable pointing to android platform tools.
Something like :
C:\Users\Lokkeshwaran J\AppData\Local\Android\Sdk\platform-tools
Upvotes: 0