Android Studio : Error: Could not initialize class com.android.ide.common.util.ReadWriteProcessLock
สำหรับใครที่อัพเกรด Android Studio to Version 2.4 บางทีอาจพบปัญหา initialize class ไม่ได้ จะขึ้นข้อความดังนี้
Error:Could not initialize class com.android.ide.common.util.ReadWriteProcessLock |
แล้วทำให้รันแอปปลิเคชันไม่ได้ด้วย ปัญหานี้ไม่ใช่ว่าแอพฯเรามีบักหรอกครับ แต่เป็นปัญหาภายในของ Android Studio เอง ซึ่งวิธีการการแก้ไขทำได้โดยการ restart Gradle daemon โดยไปที่เมนู
File -> Invalidate Caches / Restart… |
พอ Android Studio running ขึ้นมาใหม่แล้วลองรันแอพฯดูว่าทำงานได้หรือเปล่า
นอกจากนี้ลองค้นใน google พบว่า หากจะใช้คำสั่งก็ทำได้โดย
enter the following command in the IDE’s Terminal window: ./gradlew –stop |