1

我配置了離子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上的工作室。

不知道我是否失去了一些步驟或什麼,昨天開始用離子。

下面是我的一些版本:

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 
+0

'離子運行android' –

回答

1

刪除平臺/ android文件夾,

ionic platform rm android 

,然後再添加機器人:

ionic platform add android 
+1

感謝你這麼很多先生 –

+0

永遠歡迎:) – skydroid