各个版本的androidstudio之间互相导项目要注意的问题

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了各个版本的androidstudio之间互相导项目要注意的问题相关的知识,希望对你有一定的参考价值。

参考技术A 我们在打开项目时,如果studio出现了如下的问题

Error:Unable to find method 'com.android.build.gradle.tasks.factory.AndroidJavaCompile.setDependencyCacheDir(Ljava/io/File;)V'.Possible causes for this unexpected error include:

Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network)

The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem. Stop Gradle build processes (requires restart)

Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

那就是我们的gradle的版本出现问题,在不同版本的studio上gradle对应了不同,我们需要修改我们的当前studio对应的版本,其实这个版本跟随Android Studio的版本走的,比如我的studio版本是2.3 版本,那么使用的是gradle-3.3-all版本,如果是2.2版本则是gradle-3.2-all。

一般我们本机都会有对应得gradle版本,gradle的目录一般都是在

在dists中就是我们所有的gradle版本了。我们找到我们需要的版本后,然后在我们的项目中修改我们需要的版本

在我们项目的gradle的目录下打开图中选中的文件,

修改图中对应的版本号即可。

一般我们在导入别人的项目或者两个版本不同的studio中都会遇到这些问题,gradle与studio的版本对应问题,我们需要做如上的修改即可。

android studio怎么生成app

参考技术A 用android studio做app方法/步骤:

1.打开软件,在菜单中选择file-》new project打开创建向导。

2.配置项目,确定各个名称和存放项目存放路径;
Application name:项目名称
Company Domain:公司域名
Package name:app打包名称
project location:存放路径
最好将名称中的examples去掉。

3.接下来设定兼容的安卓的最小版本,这依情况而定,我这里设定为安卓2.3版本。

4.如果不确定各个版本的区别,可以点击“help me choose”,在打开的窗口中介绍了各个安卓版本的功能。

5.确定后最小兼容版本后,选择项目的活动类型,这里有很多现成的模板可以使用,对于初学者选择默认的Blank Activity即可。

6.接下来设定活动名称,界面布局的名称,以及界面标题,最后点击finish完成项目的创建。

7.创建完后,在项目名-》app-》src-》main-》res-》layout下双击xml文件就是打开活动界面设计窗口了。

注意事项:注意根据情况合理选择安卓的最小兼容版本.本回答被提问者采纳

以上是关于各个版本的androidstudio之间互相导项目要注意的问题的主要内容,如果未能解决你的问题,请参考以下文章

android studio怎么生成app

Tomcat学习笔记

CString之间为啥不能互相赋值

用android studio怎么做app

AndroidStudio文件夹结构视图讲解

Unity与Android Studio互相调用