Android Studio Package rename and error “Activity class does not exist”

最近被一個問題困擾很久:

When using Android Studio, it gives me this error when I changed the package name 

from “org.company.old” to “org.company.new”:

Android studio still shows message like:remote path: /data/local/tmp/org.company.old

原因:

The error was in IntelliJ IDEA after all. When you create a project, the Configuration checks Launch feature automatically and prints the name of default class. 

When you change the name of package, refactoring does not change the configuration string which still points to the old class name. 

That is why there was not compile-time error, but runtime error.

It would be great if they could fix this issue in this awesome IDE as these kind of errors are very hard to track down (this one took 4 months to realize where the error was).

最後找到的解決方法

It is a bug in Android Studio. To fix it 

1.Close Studio.

2.Remove .idea/workspace.xml

3.Launch Studio.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章