내 목표는 실험을 통해 배우기 위해 소스 파일을 수정하면 원래 샘플 파일 이 아닌이 영향을받을 수 있도록 NotePad 샘플 프로젝트를 복제하는 것입니다. 이 목표에 대한 합리적인 설명은 @Neutrino의 this post에있는 1-2-3 탄환에서 잘 설명됩니다. 중성미자의 게시물 @를 바탕으로SDK 샘플 프로젝트를 작업 영역에 복제하는 방법은 무엇입니까?
, 나는 다음 단계를 수행 :
1 단계 : (작업 공간 디렉토리 외부)의 임시 위치에 복사 샘플 코드 :
1. Close Eclipse.
2. Copy the entire sample folder
**NotePad** from C:\android-sdk-windows\samples\android-7
to C:\Users\androideve\Documents\NotePad
2 단계에서 가져 오기
1. Start Eclipse
2. File > New > Project > Android Project [Next]
> Create project from existing **source**: C:\Users\androideve\Documents\NotePad
3. Delete project from Package Explorer (without deleting its files from disk!)
4. File > Import...
> General > Existing Projects into Workspace [Next]
> Browse: C:\Users\androideve\Documents\NotePad
> Check "Copy projects into workspace" [Finish]
5. Delete entire folder C:\Users\androideve\Documents\NotePad from disk.
이 프로젝트 생성을 초래하지만 (나는 안드로이드 N 오전 기억을 원인이 무엇에 관한 단서없이 21 오류와 함께 제공 : 복사 작업 공간 ewbie와 나는 메모장 프로그램)을 작성하지 않은 :
Description Resource Path Location Type
Error generating final archive: java.io.FileNotFoundException: C:\sb\workspace\NotesList\bin\resources.ap_ does not exist NotesList Unknown Android Packaging Problem
error: Error: String types not allowed (at 'layout_height' with value 'match_parent'). note_editor.xml /NotesList/res/layout line 17 Android AAPT Problem
error: Error: String types not allowed (at 'layout_width' with value 'match_parent'). note_editor.xml /NotesList/res/layout line 17 Android AAPT Problem
error: Error: String types not allowed (at 'layout_width' with value 'match_parent'). noteslist_item.xml /NotesList/res/layout line 17 Android AAPT Problem
R cannot be resolved to a variable NoteEditor.java /NotesList/src/com/example/android/notepad line 148 Java Problem
R cannot be resolved to a variable NoteEditor.java /NotesList/src/com/example/android/notepad line 151 Java Problem
R cannot be resolved to a variable NoteEditor.java /NotesList/src/com/example/android/notepad line 175 Java Problem
R cannot be resolved to a variable NoteEditor.java /NotesList/src/com/example/android/notepad line 177 Java Problem
R cannot be resolved to a variable NoteEditor.java /NotesList/src/com/example/android/notepad line 194 Java Problem
R cannot be resolved to a variable NoteEditor.java /NotesList/src/com/example/android/notepad line 195 Java Problem
R cannot be resolved to a variable NoteEditor.java /NotesList/src/com/example/android/notepad line 265 Java Problem
R cannot be resolved to a variable NoteEditor.java /NotesList/src/com/example/android/notepad line 269 Java Problem
R cannot be resolved to a variable NoteEditor.java /NotesList/src/com/example/android/notepad line 276 Java Problem
R cannot be resolved to a variable NotesList.java /NotesList/src/com/example/android/notepad line 83 Java Problem
R cannot be resolved to a variable NotesList.java /NotesList/src/com/example/android/notepad line 94 Java Problem
R cannot be resolved to a variable NotesList.java /NotesList/src/com/example/android/notepad line 177 Java Problem
R cannot be resolved to a variable NotesLiveFolder.java /NotesList/src/com/example/android/notepad line 48 Java Problem
R cannot be resolved to a variable NotesLiveFolder.java /NotesList/src/com/example/android/notepad line 51 Java Problem
R cannot be resolved to a variable TitleEditor.java /NotesList/src/com/example/android/notepad line 71 Java Problem
R cannot be resolved to a variable TitleEditor.java /NotesList/src/com/example/android/notepad line 80 Java Problem
R cannot be resolved to a variable TitleEditor.java /NotesList/src/com/example/android/notepad line 83 Java Problem
내가 잘못하지 않았고, 나는이 메모장 샘플 빌드의 사본을 만들고 실행하는 데 필요한 것은 무엇 무엇?
와우! 나는 안드로이드 개발 도구가 너무 일관성이 없다는 것을 깨닫지 못했다. 때로는 Ctrl + Shift + O가 문제를 해결하고 때로는 문제를 일으킨다. 어쨌든, 나는 그 두 가지를 시도했다 - 그것은 도움이되지 못했다. 귀하의 질문에 : 네, C : \ sb \ workspace는 프로젝트가 저장되는 곳입니다. 샘플에서 ** 복사 **됩니다. 그리고 +1 도움이되는 시도에 +1. –
NotesList> res> 레이아웃에 main.xml 파일이 없다는 것을 발견했습니다. 이것이 문제의 근원 일 수 있습니까? 그렇다면 어떻게 될 수 있습니까? 안드로이드 SDK와 함께 제공되는 샘플 프로젝트가 모범적일까요? –
@androideve 활동에서 결코 호출되지 않으면 main.xml이 필요하지 않습니다. node_editor.xml, noteslist_item.xml 및 title_editor.xml –