Build error - ../version.txt (No such file or directory)
ohjongin opened this issue · comments
Jongin Oh commented
Error:(2) A problem occurred evaluating project ':realm'.
/home/ohjongin/Projects/android-resource-tracker/../version.txt (No such file or directory)
Jongin Oh commented
배포되는 압축 파일에는 프로젝트 외부에 version.txt 파일이 있어서 빌드가 되었지만, 새로 생성한 프로젝트에는 해당 파일이 없어서 빌드 에러가 발생.
Before
Project path가 /home/ohjongin/sample-project 라면 배포되는 압축 파일에는 /home/ohjongin에 version.txt가 존재함
String realmVersion = new File("${rootDir}/../version.txt").text
After
아래 처럼 path를 변경해서 /home/ohjongin/sample-project에 version.txt 파일을 추가해서 해결
String realmVersion = new File("${rootDir}/version.txt").text