Android - Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available

Android - Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available

遇到一個問題,直接建置在手機上,是沒問題的,當將apk丟到雲端硬碟,再由雲端硬碟下載,卻發生了錯誤。

以為答案是,以下這個解,但不是,不是multidex的問題
https://freakycoder.com/android-notes-56-how-to-fix-exception-java-lang-runtimeexception-b9f57ace5500

後來又找到
https://stackoverflow.com/questions/41986851/caused-by-java-lang-noclassdeffounderror-class-not-found-using-the-boot-class

跑去關掉

File -> Settings -> Build, Execution, Deployment -> Instant Run

就解決問題了。