gpt4 book ai didi

android - 将 ionic 框架添加到现有的 android studio 应用程序

转载 作者:太空狗 更新时间:2023-10-29 13:17:37 24 4
gpt4 key购买 nike

我正在使用 android studio 为 ODROID XU4 板开发一个项目。由于项目的性质,我正在使用 android studio 制作 native 应用程序,以便使用开发板的一些硬件功能,如以太网、GPIO 等,并且因为无意为任何其他开发此功能平台。

现在的问题是客户想要一个漂亮的 ionic 界面。我一直在测试我在 google、ionic 论坛、stack overflow 和许多其他网站上找到的大多数方法,但都没有成功。

最近我得到的是创建一个 ionic 应用程序,添加 android 平台并将其导入 android studio。

我的第一个问题是:1- 这是正确的方法吗?

我的工作流程是:

ionic start myapp 
ionic platform add android
ionic build android

然后我用 android studio 导入 myapp 文件夹。首先,我收到一个 android studio 错误:

 19:40:40 Migrate Project to Gradle?
This project does not use the Gradle build system. We recommend that you migrate to using the Gradle build system.
More Information about migrating to Gradle
Don't show this message again.
19:40:41 Update Property Files
The structure of following Android modules was changed:
android
CordovaLib
Would you like to update related project.properties files?
Only once
Always for these modules
Never for these modules
19:40:44 Update Property Files
The structure of following Android modules was changed:
android
Would you like to update related project.properties files?
Only once
Always for these modules
Never for these modules
19:40:45 IndexNotReadyException: Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation
19:48:09 Error Report: Submitted

现在是时候将项目迁移到 gradle 了:

这是主要问题,我不知道将新的 gradle 文件放在哪里或如何继续。 enter image description here

谢谢。

最佳答案

首先:您的方向是正确的。这是正确的做法。但是,我认为您的问题是因为您将错误的文件夹导入到 Android Studio。

请在您的 myApp/platforms 文件夹中导入由 ionic (cordova) 生成的文件夹“android”。

cordova 的最新版本正在使用 Gradle 构建系统。因此,如果使用最新版本的 cordova 生成,则 gradle 构建配置文件已经存在于该“android”文件夹中。

通过导入 myapp 文件夹(如您所做),这些文件不会出现在您的 Android Studio 项目中。因此您会看到错误:This project does not use the Gradle build system.

关于android - 将 ionic 框架添加到现有的 android studio 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33068892/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com