链接
- Android(6-13)适配链接
 
版本相关
SDK版本对应名称
| Android版本 | API Level | 
|---|---|
| Android 14.0(UPSIDE_DOWN_CAKE) | 34 | 
| Android 13.0 Tiramisu(Tiramisu) | 33 | 
| Android 12L(Sv2) | 32 | 
| Android 12.0(S) | 31 | 
| Android 11.0(R) | 30 | 
| Android 10.0(Q) | 29 | 
| Android 9.0(Pie) | 28 | 
| Android 8.1(Oreo) | 27 | 
| Android 8.0(Oreo) | 26 | 
| Android 7.1.1(Nougat) | 25 | 
| Android 7.0(Nougat) | 24 | 
| Android 6.0(Marshmallow) | 23 | 
| Android 5.1(Lollipop) | 22 | 
| Android 5.0(Lollipop) | 21 | 
| Andorid 4.4W(KitKat Wear) | 20 | 
| Android 4.4(KitKat) | 19 | 
| Android 4.3(Jelly Bean) | 18 | 
| Android 4.2(Jelly Bean) | 17 | 
| Android 4.1(Jelly Bean) | 16 | 
| Android 4.0.3(IceCreamSandwich) | 15 | 
| Android 4.0(IceCreamSandwich) | 14 | 
| Android 3.2(Honeycomb) | 13 | 
| Android 3.1(Honeycomb) | 12 | 
| Android 3.0(Honeycomb) | 11 | 
| Android 2.3.3(Gingerbread) | 10 | 
| Android 2.3(Gingerbread) | 9 | 
| Android 2.2(Froyo) | 8 | 
| Android 2.1(Eclair) | 7 | 
| Android 2.0.1(ECLAIR_0_1) | 6 | 
| Android 2.0(ECLAIR) | 5 | 
| Android 1.6(DONUT) | 4 | 
| Android 1.5(CUPCAKE) | 3 | 
| Android 1.1(BASE_1_1) | 2 | 
| Android 1.0(BASE) | 1 | 
2019.8.1之后新规定,上架到应用场市场的要求targetSdkVersion大于等于26
Gradle
- 添加
mavenCentral()编译速度慢的解决方案:注释掉mavenCentral()导致云信下载不下来的解决方案 - gradle7.3.3-all升级到8.10.2-all的问题及解决
 
升级API相关问题
升级到Androidx,android.support.design.widget.CoordinatorLayout出错
1  | Caused by: android.view.InflateException: Binary XML file line #12: Binary XML file line #2: Error inflating class android.support.design.widget.CoordinatorLayout  | 
解决:
如果布局包含:
<android.support.design.widget.CoordinatorLayout
用以下内容代替:<androidx.coordinatorlayout.widget.CoordinatorLayout如果布局包含:
<android.support.design.widget.FloatingActionButton
用以下内容代替<com.google.android.material.floatingactionbutton.FloatingActionButton如果布局包含:
<android.support.design.widget.AppBarLayout
  用以下内容代替: <com.google.android.material.appbar.AppBarLayout
- 如果布局包含:
<android.support.v7.widget.Toolbar 
  用以下内容代替: <androidx.appcompat.widget.Toolbar
应用发生Crash时,会自动重启
在API21(Android5.0)以下,Crash时会直接退出应用。在API21以上,系统遵循以下原则进行重启:
- 包含Service:应用Crash时,运行着Service,系统会重新启动Service
 - 不含Service:只有一个Activity,系统直接退出,不会重启该Activity
 - 不含Service:当前栈中有两个Activity,Act1->Act2,若Act2发生Crash,系统重启Act1
 - 不含Service:当前栈中有三个Activity,Act1->Act2->Act3,若Act3发生Crash,系统重启Act2,并且Act1依然存在,即可以从重启的Act2回到Act1