今天第一次使用android studio,
莫名其妙出現 no render target selected的錯誤,沒有設計界面,
各種百度之后在 stackoverflow.com/questions/22776653/no-rendering-target-selected-using-android-studio 找到了答案,
I solved it with File
-> Invalidate Caches/Restart
.
雖然解決了還是莫名其妙,猜測原因可能是,在安裝完Android Studio后沒有先創建AVD,也沒有打開Genymotion而導致的問題,因為都用Genymotion來代替IDE自帶的模擬器,所以忽略了這一步,在完成上面兩步驟后,就解決了問題。
所以如果 File
-> Invalidate Caches/Restart 不能解決問題的話,可以嘗試先創建AVD,再重啟試試
1. You need to run the AVD Manager to add a virtual device that matches the target API version your project is set to.
2. Click Tools->Android->AVD Manager. Click on 'New', add virtual devices targeting higher API levels, e.g 18, 19, etc.
3. Then restart Android Studio, and open your project, it should find a target device to allow you access to the Design view.
還有一個問題就是API21,API18也是在
File
-> Invalidate Caches/Restart
. 后才出現的。