如何安装“Android支持库”?将Gluon Mobile应用程序部署到Android? [英] How can I install "Android Support Library" to deploy a Gluon Mobile application to Android?

查看:286
本文介绍了如何安装“Android支持库”?将Gluon Mobile应用程序部署到Android?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Gluon Mobile框架开发Android应用程序。

I would like to develop an Android app using the Gluon Mobile framework.

我在Netbeans IDE中安装了Gluon插件,创建了一个示例项目并成功构建。

I installed the Gluon plugin in my Netbeans IDE, created a sample project and built it successfully.

现在我想将该应用部署到Android设备上。我指的是联机文档[1]: HTTP://docs.gluonhq .com / charm / 4.2.0 / #_ getting_started

Now I would like to deploy the app to an Android device. I'm referring to the online documentation [1]: http://docs.gluonhq.com/charm/4.2.0/#_getting_started

在[1]的2.1.3.Android部分中,我下载了Android Studio 2.2 .3并从Android SDK Manager安装了构建工具版本23.0.1和API 21的SDK平台。

As in [1], section "2.1.3. Android", I downloaded Android Studio 2.2.3 and installed the build-tools version 23.0.1 and the SDK Platform for API 21 from the Android SDK Manager.

但是我无法看到/安装 Android支持库来自Extras菜单(是的,我标记为已过时框)。

However I can't see/install the "Android Support Library" from the Extras menu (Yes, I marked the "Obsolete" box).

毫不奇怪,我收到以下错误消息,当我使用正确点击我的Netbeans项目 - >任务 - > android - > android:

Not surprisingly, I get the following error message, when I use "right click on my Netbeans-Project -> Tasks -> android -> android":


失败:构建失败并出现异常。

FAILURE: Build failed with an exception.


  • 出了什么问题:
    在最新检查期间无法捕获任务'mergeClassesIntoJar'的输入文件的快照。
    java.io.FileNotFoundException:C:\Users ... \AppData\Local\Android\sdk\extras\android\support\multidex\library\libs\机器人支撑-multidex.jar(DAS系统卡恩巢穴angegebenen PFAD nicht芬登)

实际上,由于未安装Android支持库,因此文件android-support-multidex.jar不可用。

Indeed, the file "android-support-multidex.jar" is not available since the "Android Support Library" is not installed.

如何安装Android支持库 ?

How can I install the "Android Support Library"?

非常感谢任何帮助!

推荐答案

它有有人问这里这里,但由于答案在不同的背景下,mayb这里有一个摘要是值得的。

It has been asked here and here, but since the answers are in different contexts, maybe it's worthy having a summary here.

在版本1.2.0之前,jfxmobile插件一直在使用过时的Android支持库。

Up until version 1.2.0, the jfxmobile plugin has been working with the obsolete Android Support Library.

现在这个库不仅已过时,而且无法再下载。

Now this library is not only obsolete but not available any more for download.

当前版本是1.3.2,它包含了在没有该库的情况下工作所需的更改,并使用 multidex-1.0.1.aar 库而不是。

The current version of the jfxmobile plugin is 1.3.2, and it includes the required changes to work without that library, and use the multidex-1.0.1.aar library instead.

要使其正常工作,请按以下步骤操作:

To make it work, just follow these steps:


  • 打开Android SDK Manager并确保已安装 Extras / Google Repository 额外/ Android支持存储库

确保您拥有此库: ANDROID_HOME / extras /android/m2repository/com/android/support/multidex/1.0.1/multidex-1.0.1.aar

现在开启您的项目:


  • 更新项目的 build.gradle 文件使用jfxmobile插件当前1.3.2版本

  • Update the build.gradle file of your project to use the jfxmobile plugin current 1.3.2 version

如果添加android配置android SDK路径,则应将其移至属性文件。为此,只需在 C:\ Users \< user> \ .gradle \gradle.properties 下创建一个属性文件,然后添加 ANDROID_HOME 变量: ANDROID_HOME = C:/< path.to.Android> / sdk 。如果已添加,请从android块中删除 androidSdk

If you add to the android configuration the android SDK path, you should move it to a properties file. For that, just create a properties file under C:\Users\<user>\.gradle\gradle.properties, and add the ANDROID_HOME variable: ANDROID_HOME=C:/<path.to.Android>/sdk. And remove the androidSdk from the android block if it was added.

保存并重新加载项目,以便新配置发生(在项目选项卡上,项目的根目录,右键单击,重新加载项目)。

Save and reload your project so the new configuration takes place (On the projects tab, root of the project, right click, Reload Project).

编辑

如果您使用的是Windows,请确保Android SDK安装在gradle具有足够权限来创建文件夹和提取的位置下.aar文件。

If you are on Windows, make sure that Android SDK is installed under a location where gradle will have enough permissions to create folders and extract the .aar file.

这篇关于如何安装“Android支持库”?将Gluon Mobile应用程序部署到Android?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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