英语不好真的影响敲代码的快感吗?Andriod Studio新建项目踩了一个大坑,是否勾选 use legacy android.support libraries真的坑

Andriod Studio新建项目踩了一个大坑,是否勾选 use legacy android.support libraries

这年头,都说学计算机不一定需要英语好,但是英语不好却一定影响敲代码的快乐感
这一次新建安卓项目就因为英语不好,没有看明白,导致踩了个大坑

报错信息:

This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry.
The following AndroidX dependencies are detected: androidx.lifecycle:lifecycle-process:2.2.0, androidx.core:core:1.1.0, androidx.versionedparcelable:versionedparcelable:1.1.0, androidx.fragment:fragment:1.2.0, androidx.lifecycle:lifecycle-common:2.2.0, androidx.lifecycle:lifecycle-viewmodel:2.2.0, androidx.customview:customview:1.0.0, androidx.lifecycle:lifecycle-livedata:2.2.0, androidx.loader:loader:1.0.0, androidx.activity:activity:1.1.0, androidx.lifecycle:lifecycle-extensions:2.2.0, androidx.collection:collection:1.1.0, androidx.viewpager:viewpager:1.0.0, androidx.arch.core:core-runtime:2.1.0, androidx.lifecycle:lifecycle-livedata-core:2.2.0, androidx.arch.core:core-common:2.1.0, androidx.savedstate:savedstate:1.0.0, androidx.lifecycle:lifecycle-viewmodel-savedstate:1.0.0, androidx.lifecycle:lifecycle-runtime:2.2.0, androidx.annotation:annotation:1.1.0, androidx.lifecycle:lifecycle-service:2.2.0
Affected Modules: app

在这里插入图片描述
下面解释一下创建过程以及我是怎么踩雷

敲代码要快乐,真的一定要手速快,还要英语好

  1. 首先第一步肯定是选择建立的项目类型
    在这里插入图片描述
  2. 为什么不能勾选它, use legacy android.support libraries我原本以为它的意思是使用一些安卓支持的类库,但是我忽略了legacy(遗产)说明这是以前的类库,如果使用了它就相当于我们是创建的以前那些项目,但是现在大家都用的新技术,我在B站上学习的也是新的技术。这个勾选了在最初的时候不会出现问题,但是在将来添加一些gradle依赖的时候就会出现弊端,就会发现使用不上,或者你需要使用androidx的依赖,但是它老是报错,而且还看不明白
    在这里插入图片描述
    3.搞定就finish,后续问题将在其他文章里再写
    附上一张如果勾选了后续出现问题的图
    在这里插入图片描述
    这个原因就是因为使用了旧库,但是你要导入新的依赖,就会报错。

欢迎有志小伙伴共同交流
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_43792791/article/details/108015711