解決Android Studio編譯失敗問題
從客戶取得的Demo Project因為與本地的編譯環境版本不同,所以經常遇到編譯失敗
※Import project後
問題1. Unrecognized Android Studio (or Android Support plugin for IntelliJ IDEA) version '202.7660.26.42.7486908', please retry with version 2021.1.1 or newer.
Sol.: build.gradle(Project)降低Android Gradle Plugin Version,跟本地端一樣的版本再Sync
問題2. lambda expressions are not supported in -source 7(use -source 8 or higher to enable lambda expressions)
或是另一種, Invoke-customs are only supported starting with Android O (--min-api 26). The Dependency contains Java 8 Bytecode
Sol.: build.gradle(Module)加入compileOptions&kotlinOptions
問題3. NDK at F:\Android\Sdk\ndk-bundle did not have a source.properties file
Android/Sdk/ndk/目錄下會顯示本地端已安裝的ndk版本
最後再Rebuild Project就完成了
留言
張貼留言