当前位置: 动力学知识库 > 问答 > 编程问答 >

Android Studio, Sample Code - Not working

问题描述:

There is sample code on the developer site that i wish to run.

When I import as a new Android Studio project, I'm not given any ability to run the code (disabled buttons).

I attempted to copy the source files over into the shell of a new project, but i than got errors that didn't make sense. reference to duplicate declarations in source files that had nothing relating inside them.

Is there an idiots guide on how to properly use android studio, or is it just this difficult?

网友答案:

In order to correctly import the project, you should follow the Samples guide as found in the developer docs.

To import a downloaded project:

  • Unpack the downloaded project package.

  • In Android Studio, chose File > Import Project and select the root folder of the unpacked project.

  • Android Studio may ask you to choose the type of project you are importing.

  • If this is the case, make sure to choose Import project from external model and select the Gradle option.

Alternatively, if the Gradle option does not work, I would attempt to use the Eclipse option.

网友答案:

Open .gradle file when you import the project, not the folder of the proyect.

分享给朋友:
您可能感兴趣的文章:
随机阅读: