2017-05-08 1 views
0

파란색으로 인해이 문제가 발생했습니다. 이것은 Gradle을 콘솔 출력을 빌드입니다 : 내가 (대부분 SO) 온라인 어떤 게시물을 확인했습니다'app : process : DebugResources'작업 실행에 실패했습니다.

https://i.stack.imgur.com/YxvfR.png

. 지금까지는 buildToolsVersion (25.0.0보다 낮추지 않음)을 변경했으며, Clean Builds, Restarts, 모든 XML 파일에서 문제점을 검사했습니다.

아무 것도 해결되지 않았습니다. 또한 처음 몇 가지 오류에 대해서는 아무 것도 발견하지 못했습니다 ("Resourse matches matches ..."). 그 파일을 변경하려고 시도했지만 그 줄을 지우지는 않았지만 1) "프로젝트의 일부가 아닙니다"2) 어쨌든 변경하면 또 다른 오류가 있습니다.

이전 코드로 돌아가서 작동했는데 아무래도 모두 동일한 오류가 표시됩니다.

올바른 방향으로 나를 가리킬 수 있습니까? 무엇이 잘못되었는지 이해하고 어떻게 해결할 수 있습니까?

[UPDATE]

여기 res\layout\abc_list_menu_item_layout.xml위한 코드이다 :

<?xml version="1.0" encoding="utf-8"?> 
<android.support.v7.view.menu.ListMenuItemView 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="?attr/listPreferredItemHeightSmall"> 

<!-- Icon will be inserted here. --> 

<!-- The title and summary have some gap between them, and this 'group' should be centered vertically. --> 
<RelativeLayout 
     android:layout_width="0dip" 
     android:layout_weight="1" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center_vertical" 
     android:layout_marginLeft="?attr/listPreferredItemPaddingLeft" 
     android:layout_marginRight="?attr/listPreferredItemPaddingRight" 
     android:duplicateParentState="true"> 

    <TextView 
     android:id="@+id/scale" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentTop="true" 
     android:layout_alignParentLeft="true" 
     android:textAppearance="?attr/textAppearanceListItemSmall" 
     android:singleLine="true" 
     android:duplicateParentState="true" 
     android:ellipsize="marquee" 
     android:fadingEdge="horizontal" /> 

    <TextView 
     android:id="@+id/shortcut" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_below="@id/title" 
     android:layout_alignParentLeft="true" 
     android:textAppearance="?android:attr/textAppearanceSmall" 
     android:singleLine="true" 
     android:duplicateParentState="true" /> 

</RelativeLayout> 

<!-- Checkbox, and/or radio button will be inserted here. --> 

는 그리고 res\layout\abc_popup_menu_item_layout.xml

<?xml version="1.0" encoding="utf-8"?> 
<android.support.v7.view.menu.ListMenuItemView 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="?attr/dropdownListPreferredItemHeight" 
    android:minWidth="196dip" 
    style="@style/RtlOverlay.Widget.AppCompat.PopupMenuItem"> 

<!-- Icon will be inserted here. --> 

<!-- The title and summary have some gap between them, and this 'group' should be centered vertically. --> 
<RelativeLayout 
     android:layout_width="0dip" 
     android:layout_weight="1" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center_vertical" 
     android:duplicateParentState="true" 
     style="@style/RtlOverlay.Widget.AppCompat.PopupMenuItem.InternalGroup"> 

    <TextView 
      android:id="@+id/scale" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentTop="true" 
      android:textAppearance="?attr/textAppearanceLargePopupMenu" 
      android:singleLine="true" 
      android:duplicateParentState="true" 
      android:ellipsize="marquee" 
      android:fadingEdge="horizontal" 
      style="@style/RtlOverlay.Widget.AppCompat.PopupMenuItem.Text" /> 

    <TextView 
      android:id="@+id/shortcut" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_below="@id/title" 
      android:textAppearance="?attr/textAppearanceSmallPopupMenu" 
      android:singleLine="true" 
      android:duplicateParentState="true" 
      style="@style/RtlOverlay.Widget.AppCompat.PopupMenuItem.Text" /> 

</RelativeLayout> 

<ImageView 
     android:id="@+id/submenuarrow" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center" 
     android:layout_marginStart="8dp" 
     android:layout_marginLeft="8dp" 
     android:scaleType="center" 
     android:visibility="gone" /> 

<!-- Checkbox, and/or radio button will be inserted here. --> 

이 하나의

res\merged\debug\SAME_NAME에 대한이 두 가지의 차이점은 URI가 등록되어 있지 않다는 라인 xmlns:android="http://schemas.android.com/apk/res/android"의 오류 외에는 없습니다. 이 두 파일은 자동으로 생성되었으므로 어떤 일이 벌어지고 있는지 전혀 알지 못합니다. 마지막으로 "등록되지 않은 URI"오류를 검색했지만 제시된 모든 솔루션이 너무 다르기 때문에 여기에 적용되지 않는 프로젝트의 고유 한 것처럼 보입니다. Build Variant "release"를 사용하여 시도한 다음 다시 변경했지만 아무 일도 일어나지 않았습니다.

+0

"res/layout/abc_list_menu_item_layout.xml"파일을 게시 할 수 있습니까? 또한, 그 파일의 버전이 두 개 이상입니까? (아마도 다른 "res/layout-?"디렉토리에 있습니까?) 레이아웃이 정의되지 않은 뷰 ID를 참조하고있는 것 같습니다. – AndroidGuy

+0

@AndroidGuy 응답. 내가 이미 코드를 표시하고 내가 겪고있는 것을 조금 더 설명하는 질문을 편집했습니다. 빌드 변형 "릴리스"를 사용한 후 중복 된 것이 없습니다. 두 파일이 빌드 캐시에 있음을 확인했습니다. . 내가 무효화하고 그것을 다시 시작해야합니까? 건배! – ruiBarbs

+0

자신에게 응답 무효화/다시 시작 캐시가 작동하지 않습니다. – ruiBarbs

답변

0

이제 마침내이 기능을 사용할 수있게되었지만 왜 작동하는지 알 수 없습니다. 그래서 나는 내 레이아웃 중 하나에서이 ListView를 가졌고 다른 레이아웃에서 다른 것을 추가하고 싶었습니다. 웬일인지, 내가 초를 만들었을 때, 첫번째 ID (그들 중 하나는 '제목')를 변경했다.

두 ListViews 모두 삭제했지만 문제가 지속됩니다. 그래서 내가 '제목'ID를 가진 ListView를 가졌다는 것을 깨달았을 때 나는 첫 번째 ID로 다시하기로 결정했습니다. 이제는 모든 것이 작동합니다. 질문

커플 :

  1. 이유는 두 번째의 ListView는의 첫 번째 ID를 변경 했습니까? - 여러 가지 방법으로 보여주고 싶었 기 때문에 ListView와 별도의 어댑터에 대한 레이아웃을 만들었습니다.

  2. 왜 레이아웃과 어댑터를 삭제해도 처음에는 문제가 해결되지 않았습니까?

더하기, 나는 여전히 관련된 문제가 있습니다. 툴바에있는 3Dots를 누르면 (오버플로) 앱이 다운됩니다. ListMenuItemView에서 NullPointerException을 발생시킵니다.질문에 결함이있는 파일 중 하나에 가면 그 파일은 Cannot find the declaration of android.support.v7.view.menu.ListMenuItemView ... 무슨 일인지에 대한 아이디어가 있습니까?

0

이것은 나에게도 파란색으로 나옵니다. 왜 이런 일이 발생했는지에 대해주의를 기울이고 있지만 해결책은 빌드 캐시를 지우는 것입니다. 이 작업을 실행하려면,보기> 도구 창> 메뉴 바에서 터미널하고 다음 명령 중 하나를 사용

Windows의

: 미래의 참조 및 관련 옵션에 대한

 ./gradlew cleanBuildCache

: Mac 또는 Linux의 경우

 gradlew cleanBuildCache
을 이 링크를 확인하십시오 : Clear the build cache

관련 문제