【发布时间】: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