ionic pro package failure:无法安装android SDK Platform 26

Jas*_*e17 2 ionic-framework ionic2 ionic3

我正在使用新的Ionic Pro.我已将以前工作的离子应用程序迁移到新的Pro服务中.我现在能够成功地将我的代码推送到我的离子pro git repo,我可以在仪表板上看到构建日志.构建成功完成.完成后,我导航到所述构建的"包"选项卡.我配置我的包以编译platform = Android version = Release Security Profile = Android Release安全配置文件.

此时的输出日志将在安装过程中移动,并获得以下控制台输出.

 BUILD SUCCESSFUL
Run Code Online (Sandbox Code Playgroud)

然后,构建过程似乎启动Gradle Daemon并最终以此输出结束

The Task.leftShift(Closure) method has been deprecated and is scheduled to 
be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at 
Run Code Online (Sandbox Code Playgroud)

无法加载文件/home/gitlab-runner/.android/repositories.cfg.在/ opt/android-sdk/licenses中检查包Android SDK平台26的许可证接受包Android SDK平台26的许可证.准备"安装Android SDK Platform 26".警告:无法读取或创建安装属性文件.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Failed to install the following SDK components:
  [Android SDK Platform 26]
  The SDK directory (/opt/android-sdk) is not writeable,
  please update the directory permissions.

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

BUILD FAILED

Total time: 33.48 secs
Error: /usr/src/app/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'.
> Failed to install the following SDK components:
  [Android SDK Platform 26]
  The SDK directory (/opt/android-sdk) is not writeable,
  please update the directory permissions.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --
debug option to get more log output.
Failed to upload apk to storage please retry your build.
Running after script...
$ clean-up
Cleaning up files...
Successful clean up
ERROR: Job failed: exit status 1
Run Code Online (Sandbox Code Playgroud)

我不清楚这个错误意味着什么,或者我如何使用ionic pro解决它.该版本在本地适用于我.

以下是我的离子信息

    @ionic/cli-utils  : 1.10.2
    ionic (Ionic CLI) : 3.10.3

global packages:

    Cordova CLI : 7.0.1

local packages:

    @ionic/app-scripts : 2.1.4
    Cordova Platforms  : android 6.2.3 ios
    Ionic Framework    : ionic-angular 2.3.0

System:

    Node : v7.5.0
    npm  : 4.1.2
    OS   : Windows 10
Run Code Online (Sandbox Code Playgroud)

Jas*_*e17 5

TLDR

以下是临时解决方案:

将项目根目录下的package.json文件中的cordova-android依赖项更改为

"cordova-android": "~6.2.3"
Run Code Online (Sandbox Code Playgroud)

然后推到离子主机.注 - 在config.xml中更改android引擎似乎无法解决问题

问题

这里的问题是cordova-android 6.3.x使用的是Android-26.Ionic Pro Package似乎尚未在其软件包服务中提供Android 26.因此临时解决方案是将cordova-android降级到使用Android-26的6.2.3.很可能以下文件配置如下:

config.xml中

<engine name="android" spec="^6.2.3" />
Run Code Online (Sandbox Code Playgroud)

的package.json

"cordova-android": "^6.2.3",
Run Code Online (Sandbox Code Playgroud)

两个配置中的^指定使用最新的6.XX版本的插件,在本例中为6.3.X. 将^更改为a~使用最新的6.2.X指定.在config.xml中进行更改并不能解决问题,因为我认为这是一个Ionic Pro Package构建问题,其中Ionic Pro Package引用config.js中指定的Cordova-android版本来确定要使用哪个android sdk版本.这就是为什么需要在package.json中更改cordova-android版本,暂时将android sdk版本降级到25,直到Ionic Pro更新了他们的服务以支持android sdk 26