升級Android Studio 2.3 之後,無法 build app 到手機裡。
重開機很多次,也 “Revoke USB debugging authorizations” 也有 Turn On “Install via USB” 都無效。
手動執行 adb 指令去安裝APP, 傳回的結果是:
adb install-multiple -r /Users/chunyuyao/Documents/R8/AndroidStudioProjects/dropboxlike/app/build/intermediates/split-apk/debug/slices/slice_0.apk /Users/chunyuyao/Documents/R8/AndroidStudioProjects/dropboxlike/app/build/intermediates/split-apk/debug/slices/slice_9.apk /Users/chunyuyao/Documents/R8/AndroidStudioProjects/dropboxlike/app/build/intermediates/split-apk/debug/slices/slice_3.apk /Users/chunyuyao/Documents/R8/AndroidStudioProjects/dropboxlike/app/build/intermediates/split-apk/debug/slices/slice_4.apk /Users/chunyuyao/Documents/R8/AndroidStudioProjects/dropboxlike/app/build/intermediates/split-apk/debug/slices/slice_7.apk /Users/chunyuyao/Documents/R8/AndroidStudioProjects/dropboxlike/app/build/intermediates/split-apk/debug/slices/slice_5.apk /Users/chunyuyao/Documents/R8/AndroidStudioProjects/dropboxlike/app/build/intermediates/split-apk/debug/slices/slice_6.apk /Users/chunyuyao/Documents/R8/AndroidStudioProjects/dropboxlike/app/build/intermediates/split-apk/debug/slices/slice_2.apk /Users/chunyuyao/Documents/R8/AndroidStudioProjects/dropboxlike/app/build/intermediates/split-apk/debug/slices/slice_8.apk /Users/chunyuyao/Documents/R8/AndroidStudioProjects/dropboxlike/app/build/intermediates/split-apk/debug/slices/slice_1.apk /Users/chunyuyao/Documents/R8/AndroidStudioProjects/dropboxlike/app/build/intermediates/split-apk/debug/dep/dependencies.apk /Users/chunyuyao/Documents/R8/AndroidStudioProjects/dropboxlike/app/build/outputs/apk/app-debug.apk
Failed to create session
Failure [UNSUPPORTED]
結論是:
This issue was happening on my phone which is a Xiaomi Phones running on Miui 8. After turning off Miui Optimizations on Developer Settings, restarting the phone a recompiling the application it worked.
資料來源:
split apk installation fails with “[UNSUPPORTED]” when using adb install-multiple
https://code.google.com/p/android/issues/detail?id=233579&sort=-id&colspec=ID