當發生錯誤訊息:java: package android.support.v4.app does not exist解決方法(IntelliJ)

在IntelliJ的環境下,若執行期間發生錯誤訊息:java: package android.support.v4.app does not exist

可嘗試到專案任意package按右鍵->Open module Settings->將各module用到的library前的Export打勾,如下圖。

 

Setting lib

 

以下是IntelliJ IDEA 13.1 Web Help對於這個Export checkbox的解釋:

If this check box is selected, a library is included in the compilation classpath of the dependent modules, as well as the classpath of the module which it is attached to.

If this option is not selected, a library is only included in the compilation classpath of a module which it is attached to. A library is always included in the runtime classpath regardless of the state of the Export check box.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *