分类 Android 下的文章

Android 14 SDK API level 34

Android 13 SDK API level 33

Android 12L SDK API level 32

Android 12 SDK API level 31

Android 11 SDK API level 30

Android 10 SDK API level 29

Android 9 SDK API level 28

Android 8.1 SDK API level 27

Android 8.0 SDK API level 26

Android 7.1.1 SDK API level 25

Android 7.0 SDK API level 24

Android 6.0 SDK API level 23

Android 5.1 SDK API level 22

Android 5.0 SDK API level 21

Android 4.4w SDK API level 20

Android 4.4 SDK API level 19

Android 4.3 SDK API level 18

Android 4.2 SDK API level 17

Android 4.1 SDK API level 16

Android 4.0.3 SDK API level 15

Android 4.0 SDK API level 14

Android 3.2 SDK API level 13

Android 3.1 SDK API level 12

Android 3.0 SDK API level 11

Android 2.3.3 SDK API level 10

Android 2.3 SDK API level 9

Android 2.2 SDK API level 8

Android 2.1 SDK API level 7

Android 2.0.1 SDK API level 6

Android 2.0 SDK API level 5

Android 1.6 SDK API level 4

Android 1.5 SDK API level 3

Android 1.1 SDK API level 2

Android 1.0 SDK API level 1

最近為了處理 Google Play 升級問題, 遇到了奇怪的情況, 記錄下來, GP 要求 app 需要升級 android 版本跟支付庫版本

應用程式必須指定 Android 14 (API 級別 34) 以上版本
應用程式必須使用 Google Play 帳款服務程式庫 6.0.1 以上版本

升級上沒多想就把 unity 的版本選擇了
35871-2q1hox2wlp8.png

運行 As 最後執行 Make Project 出現錯誤
1: Task failed with an exception.

  • What went wrong:
    Execution failed for task ':launcher:processDebugResources'.

    A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
    AAPT2 aapt2-4.0.1-6197926-windows Daemon #0: Unexpected error during link, attempting to stop daemon.
    This should not happen under normal circumstances, please file an issue if it does.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    2: Task failed with an exception.

  • What went wrong:
    Execution failed for task ':unityLibrary:processDebugAndroidTestResources'.

    A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
    AAPT2 aapt2-4.0.1-6197926-windows Daemon #1: Unexpected error during link, attempting to stop daemon.
    This should not happen under normal circumstances, please file an issue if it does.

對比了空項目確認不是 FB 跟 GooglePlayGames 庫問題, 比對兩個 AS 項目後來發現 compileSdkVersion 使用 34 就是會出錯, 後來把 compileSDKVersion 改 33 就好了
compileSdkVersion 33

測試編譯cocos2.3.3項目

gradle plugin version: 3.2.0

gradle version : 4.6

Sync Gradle 完成後顯示 gradle 4.6 不受 java11支持了
30796-w2riuoraff.png

查詢下 gradle 跟 gradle plugin 對應版本
17950-tuk2nvjdru8.png

gradle 選擇 7.2 , gradle plugin 選擇 7.1, 從 build.gradle 修改 gradle plugin 版本
63890-mjm9alvave7.png

選擇 File -> Project Structure, Gradle 版本選擇7.2
50183-so76jbeso8c.png

再執行 Sync Gradle 出錯,
A problem occurred evaluating project ':game'.

Plugin with id 'com.android.feature' not found.
22732-ft46qkhull.png

https://stackoverflow.com/questions/65452088/android-studio-plugin-with-id-com-android-feature-not-found

查詢得知 com.android.feature 在3.6.0後面就不再支持

由於編譯機器使用 java 17, 開啟老版本 as 會出現錯誤