Android Studio에서 Android 용 라이브러리를 만들고 있습니다. 이 라이브러리를 테스트하고 디버깅하기 위해 라이브러리 모듈 (내 코드)과 앱 모듈 (테스트 용)의 두 모듈로 프로젝트를 만들었습니다.
이것들을 만드는 것은 꽤 쉬웠습니다. 나는 단지 클릭 File > New... > Project
하고 지시 를 따랐다. 그 후 코드를 작성하고 빌드를 누르고 생성 된 앱에서 결과를 관찰 할 수있었습니다.
몇 달 후 모든 것이 배포 될 준비가되었습니다. 정기적으로 내 코드를 커밋하고 중앙 저장소로 푸시했기 때문에 회사의 다른 개발자가 저장소를 복제하여 Android Studio에서 열려고했습니다. 그는 완전히 다른 견해를 만났습니다.
이것이 내가 보는 것입니다.
저장소를 복제하고 열면 다음과 같이 표시됩니다.
두 번째보기를 볼 때 프로젝트를 빌드 할 방법이없고 빌드 구성도없고 변형도 없으며 gradle 스크립트가 실행되지 않는 것 같습니다.
대신에 나는 단지 복제의 경우, cp -r
내 전체 프로젝트 디렉토리 열기를 것을 안드로이드 Studio에서, 그것은 완벽하게 열립니다. 따라서 문제 .gitignore
는 프로젝트를 빌드하는 데 필요한 중요한 구성 파일을 숨기는 데있는 것 같습니다 .
은 .gitignore
안드로이드 스튜디오에 의해 자동으로 내 생성되었다. 다음과 같이 보입니다.
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
Everything there should be files generated by the build tools or local workspace configuration files, not project-level files necessary to compile. But I'm not very familiar with Android, its build steps, or the 800,000 things Android Studio is implicitly and secretly doing behind my back. Just opening the project in Android Studio causes 12 or so files to get modified on disk, so I know that it's doing a lot of things behind my back.
I can share any details about my configuration or project setup as necessary. I've spent a few hours on this already and can't figure out for the life of me how to get this project to build.
그것은 아마도 아니지만 적절한 솔루션 (결국, 안드로이드 스튜디오가 만든 .gitignore
나를 위해), 나는 제거하는 것을 발견 /.idea/modules.xml
으로부터 .gitignore
이 파일을 체크하는 것은 내 모든 문제를 해결했습니다. 갑자기 Android Studio를 시작했을 때 모든 것이 감지되고 일부 Gradle 스크립트가 실행되어 프로젝트를 빌드 할 수있었습니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다