今天被這個問題弄得很煩,找到原因想說來記錄一下,希望有人也能因此得到幫助。

Today I got into trouble with it so I post this article. Hope somebody might get help by this.



本來程式是用 Android Studio 2.3 在跑,跑得好好的。一陣子沒跑程式,我用另一台 PC 執行相同的程式卻在程式跑起來後直接 Crash。錯誤訊息是:

My app is run on Android Studio 2.3 as well.
A period of time passed, I run the same code with another PC and it crashs after running. The error message is:




FATAL EXCEPTION: main
Process: com.***.ap.*****, PID: 12795
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.***.ap.*****/com.***.ap.main.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.***.ap.main.MainActivity" on path: DexPathList....


查了老半天,查不出來,換了一台手機結果卻能跑起來了?!

I can't find the reason for crashing until changing the mobile. It runs well on another mobile phone!! 

 

才發現這台 PC 執行的環境是 Android Studio 3.0.1,它只支援 Android API > 20 的手機。原本那台測試機是 Android 4.4.2,所以不支援。

Then I found the PC is using Android Studio 3.0.1 and it is only support Android API > 20. The first mobile phone's OS is Android 4.4.2, so it is not supported.


希望能幫到大家。
Hope you get help by this article.
arrow
arrow
    全站熱搜

    姚小新 發表在 痞客邦 留言(0) 人氣()