2014-12-26 9 views
2

Android Studio/Gradle로 이전 된 Eclipse 프로젝트가 있습니다. "순수한"Gradle 프로젝트로 만들고 싶기 때문에 새로운 Android Studio 프로젝트를 만들고 거기에 필요한 파일을 옮겼습니다. 확인할 수 없습니다 "찾을 수 없습니다 내가 ActionBarSherlock의에게 R 파일을 가져온 모든 클래스에서 내 프로젝트 전반에 걸쳐,프로젝트를 Android Studio로 옮긴 후 Sherlock 테마를 찾을 수 없습니다.

Error:Error retrieving parent for item: No resource found that matches the given name 'Theme.Sherlock.Light.DarkActionBar'. 

Error:Error retrieving parent for item: No resource found that matches the given name 'Widget.Sherlock.Light.ActionBar.Solid.Inverse'. 

Error:Execution failed for task ':app:processDebugResources'. 
> com.android.ide.common.internal.LoggedErrorException: Failed to run command: 
C:\Users\Christina\sdk\build-tools\21.1.2\aapt.exe package -f --no-crunch -I C:\Users\Christina\sdk\platforms\android-21\android.jar -M C:\Users\Christina\AndroidStudioProjects\TheCatApp\app\build\intermediates\manifests\full\debug\AndroidManifest.xml -S C:\Users\Christina\AndroidStudioProjects\TheCatApp\app\build\intermediates\res\debug -A C:\Users\Christina\AndroidStudioProjects\TheCatApp\app\build\intermediates\assets\debug -m -J C:\Users\Christina\AndroidStudioProjects\TheCatApp\app\build\generated\source\r\debug -F C:\Users\Christina\AndroidStudioProjects\TheCatApp\app\build\intermediates\res\resources-debug.ap_ --debug-mode --custom-package com.example.thecatapp -0 apk --output-text-symbols C:\Users\Christina\AndroidStudioProjects\TheCatApp\app\build\intermediates\symbols\debug 
Error Code: 
1 
Output: 
C:\Users\Christina\AndroidStudioProjects\TheCatApp\app\build\intermediates\res\debug\values\values.xml:1190: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Sherlock.Light.DarkActionBar'. 
C:\Users\Christina\AndroidStudioProjects\TheCatApp\app\build\intermediates\res\debug\values\values.xml:1256: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.Sherlock.Light.ActionBar.Solid.Inverse'. 

또한 : 나는 themes.xml 파일에 다음과 같은 오류를 얻을 응용 프로그램을 빌드 할 때 그 이후 기호 'R' ". 이 파일을이 새로운 프로젝트로 옮기기 전에이 모든 것이 잘 작동했습니다.

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.android.support:appcompat-v7:21.0.3' 
    compile 'com.android.support:support-v4:18.0.+' 
    compile 'com.actionbarsherlock:actionbarsherlock:[email protected]' 
} 

나는 또한 선언 할 것을 시도했다 : 내 응용 프로그램에서 build.gradle에서

<resources> 

<style name="Theme.Styled" parent="Theme.Sherlock.Light.DarkActionBar"> 
    <item name="actionBarStyle">@style/Widget.Styled.ActionBar</item> 
    <item name="android:actionBarStyle">@style/Widget.Styled.ActionBar</item> 
</style> 

<style name="Widget.Styled.ActionBar" parent="Widget.Sherlock.Light.ActionBar.Solid.Inverse"> 
</style> 

</resources> 

이 종속성이 같이하는 방법입니다

이것은 themes.xml이 같은 모습입니다 의존성을 여기에 대신 libs 폴더에 넣어. 같은 결과.

내가이 행을 제거하면 오류가 사라 " 'com.android.support:appcompat-v7:21.0.3'컴파일"하지만 난 내 장치에서 응용 프로그램을 실행하려고하면이 오류 얻을 :

enter image description here

제발 도와주세요, 무슨 문제입니까? 내가 뭘 놓치고 있니?

답변

0

나는 이제 내 질문에 대한 답을 알고있다.

문제는 셜록 테마 나 누락 된 R 파일과 관련이 없습니다.

문제는 내가 파일 트리로 가져온 일부 라이브러리가 build.gradle 파일의 dependencies 태그에 추가 한 라이브러리와 다소 유사하다는 것입니다.

"Gradle 실행을 완료하지 못했습니다. Cause :"오류 메시지가 나타나고 Gradle Console 로그에서 자세한 정보를 찾을 수 있습니다.

선호하는 방법은 라이브러리를 수동으로 추가하지 않고 (예 : "compile 'com.android.support:appcompat-v7:21.0.3'9"와 같이) 종속성 아래에 lib- 폴더.