简体   繁体   中英

Execution Failed for task :app:compileDebugJavaWithJavac in Android Studio 2

Execution Failed for task:app:compileDebugJavaWithJavac in Android Studio. Encountered this failing the build. The error message pointed to a method that I refactored > renamed, but also removed all instances of the method in some classes, which also removes the import. Javadoc complained that it wasn't finding the method for which the import was removed.

symbol: method oldMethodName() location: class MyClassTest /Filepath.java:420: error: cannot find symbol oldMethodName();

I tried to answer the original question, but it wasn't accepting new answers and mine it pretty different. I encountered this issue when I refactored > renamed a method, but also removed instances of it. For some reason it wouldn't allow me to do both at the same time.

Answer: You can separate these actions into different commits or recreate an unused method of the original name only to delete it in a subsequent commit.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM