简体   繁体   English

使用phonegap和Android Studio 0.8.2

[英]Using phonegap and Android Studio 0.8.2

There are only 3-4 articles on how to use Android Studio with Phonegap. 关于如何将Android Studio与Phonegap结合使用的文章只有3-4篇。 The problem is that these are all written for lower versions from Android Studio (<0.8) and now you can't import Phonegap projects into Android Studio without having multiple errors. 问题是这些都是为Android Studio(<0.8)的较低版本编写的,现在您不能在没有多个错误的情况下将Phonegap项目导入Android Studio。

Has anyone achieved it to import a Phonegap 3.5 project into Android Studio 0.8+ and will share his/her knowledge? 有没有人实现将Phonegap 3.5项目导入Android Studio 0.8+并共享他/她的知识?

Edit: Ok if you don't have errors then you can describe the way you do it! 编辑:好吧,如果您没有错误,那么您可以描述您的操作方式!

My steps: 我的步骤:

  1. phonegap create projectname id projectname phonegap创建项目名称id项目名称
  2. change directory into projectname 将目录更改为项目名
  3. phonegap build android phonegap构建android

-- so far no problems -到目前为止没有问题

  1. start Android Studio 启动Android Studio
  2. "import project" “导入项目”
  3. choose projectname folder 选择项目名称文件夹
  4. apply the rest steps with next and finish the import 接下来应用其余步骤并完成导入
  5. Android Studio now has imported my project Android Studio现在已导入我的项目
  6. try to test the new project by go to "Run -> Run..." 尝试通过转到“运行->运行...”来测试新项目
  7. add a new "Android Application" 添加一个新的“ Android应用程序”
  8. BUT THEN in the tab "General" you have to specify a "Module" otherwise you can't start the application 然后在“常规”选项卡中必须指定“模块”,否则无法启动应用程序

Ok and from here on I stuck. 好的,从这里开始,我坚持了下来。 I tried to do "Build -> Make Project" but this ends with multiple errors while Android Studio tries to compile the app. 我尝试执行“构建->创建项目”,但这在Android Studio尝试编译应用程序时以多个错误结束。

I think the Gradle has conflicted with ant because they will generate same files. 我认为Gradle与ant冲突,因为它们会生成相同的文件。 I delete the ant-build files then it works. 我删除了ant-build文件,然后它起作用了。 Hope it be useful. 希望它会有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM