ionic pro package failure:无法安装android SDK Platform 26 [英] ionic pro package failure: Failed to install android SDK Platform 26

查看:1882
本文介绍了ionic pro package failure:无法安装android SDK Platform 26的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am using the new Ionic Pro. I have migrated my previously working ionic app to the new Pro services. I am now able to successfully push my code to my ionic pro git repo and I can see the build log on the dashboard. The build completes successfully. Once that is done, I navigate to the Package tab for said build. I configure my package to compile platform=Android version=Release Security Profile=Android Release security profile.

此时的输出日志将通过安装过程并获取以下控制台输出。

The output log at this point moves through the installation process and gets the following console output.

 BUILD SUCCESSFUL

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

The build process then appears to start a Gradle Daemon and ultimately ends up with this output

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 

build_dczd6dp0q9phbzjp0lgrh3ndj.run(/ usr / src / app / platforms / android / build .gradle:142)
文件/home/gitlab-runner/.android/repositories.cfg无法加载。
在/ opt / android-
sdk / licenses中检查包Android SDK平台26的许可证
接受Android SDK平台包26的许可证。
准备安装Android SDK Platform 26。
警告:无法读取或创建安装属性文件。

build_dczd6dp0q9phbzjp0lgrh3ndj.run(/usr/src/app/platforms/android/build.gradle:142) File /home/gitlab-runner/.android/repositories.cfg could not be loaded. Checking the license for package Android SDK Platform 26 in /opt/android- sdk/licenses License for package Android SDK Platform 26 accepted. Preparing "Install Android SDK Platform 26". Warning: Failed to read or create install properties file.

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

我不清楚这个错误的含义或我如何使用ionic pro解决它。该版本适用于我本地。

I am not clear as to what this error means or how I can resolve it using ionic pro. The build works for me locally.

以下是我的离子信息

    @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


推荐答案

TLDR

以下是一个临时解决方案:

The following is a temporary solution:

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

Change the cordova-android dependency in your package.json file at the project root to

"cordova-android": "~6.2.3"

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

and then push to ionic master. Note - Changing the android engine in config.xml does not seem to fix the issue

问题

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

The issue here is that the cordova-android 6.3.x uses Android-26. Ionic Pro Package appears to not yet have Android 26 available in their package service. The temporary solution therefore is to downgrade cordova-android to 6.2.3 which uses Android-26. Most likely the following files are configured as follows:

config.xml

config.xml

<engine name="android" spec="^6.2.3" />

package.json

package.json

"cordova-android": "^6.2.3",

^在两个配置中指定使用最新的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

The ^ in both configs specifies to use the latest 6.X.X version of the plugin, in this case 6.3.X. Changing the ^ to a ~ specifies using the latest 6.2.X. Making the change in the config.xml does not solve the issue as I believe that this is an Ionic Pro Package build issue where Ionic Pro Package references the Cordova-android version specified in config.js to launch determine which android sdk version to use. This is the reason that the cordova-android version needs to be changed in the package.json for the time being to downgrade the android sdk version to 25 until Ionic Pro has updated their service to support android sdk 26

这篇关于ionic pro package failure:无法安装android SDK Platform 26的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆