【问题标题】:ionic: can't launch android emulator from terminal离子:无法从终端启动android模拟器
【发布时间】:2017-05-14 17:30:08
【问题描述】:

我已经配置了 ionic android 开发环境。我可以在 Android Studio 2.2.2 中打开我的 android 项目并在模拟器中启动该应用程序,一切正常。

但是如果我去我的终端并去我的离子项目。并像这样构建或模拟 android:

ionic build android
ionic emulate android

我收到一个错误:

Error: /Users/alex_fimm_dev/Desktop/Projects/ionic/myApp2/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugApk'.
   > A problem occurred configuring project ':CordovaLib'.
      > Could not resolve all dependencies for configuration ':CordovaLib:classpath'.
         > Could not find com.android.tools.build:gradle:2.2.2.
           Searched in the following locations:
               https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.2/gradle-2.2.2.pom
               https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.2/gradle-2.2.2.jar
           Required by:
               android:CordovaLib:unspecified

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

该项目再次在 Android Studio 上运行良好。

不确定我是否遗漏了某些步骤或其他内容,昨天开始使用 ionic。

这是我的一些版本:

Java(TM) SE Runtime Environment (build 1.8.0_112-b16)
Android 7.1.1 API 25
Android SDK Tools 25.2.4
Android Platform-Tools 25.0.3
Cordova 6.4.0
node 7.3.0
npm  4.0.5
os x yosemite 10.10.2

【问题讨论】:

  • ionic run android

标签: cordova android-studio ionic-framework android-sdk-tools


【解决方案1】:

删除平台/android 文件夹

ionic platform rm android

并再次添加 Android:

ionic platform add android

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-01-30
    • 2012-09-29
    • 2016-08-09
    • 2012-04-13
    相关资源
    最近更新 更多