2012-02-26 4 views
6

현재 테마에서 스타일 'mapViewStyle'를 찾는 데 실패하고 난이 오류가, 은 현재 테마에서 스타일 'mapViewStyle'를 찾는 데 실패안드로이드지도 : 내 응용 프로그램에서 맵을 사용하려고

내가 생성 한 키를 제대로 사용하고 다른 곳에서 같은 문제에 대해 제안 된 모든 솔루션을 시도했습니다.

1.my target api and the one mentioned in the manifest file are the same. 
2.There is no import.R in my project 
3.I have cleaned my project. 
4.Uses-library element is a child of the application. 

이 내 xml 파일

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" > 

    <com.google.android.maps.MapView 
     android:id="@+id/mapview1" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:clickable="true" 
     android:apiKey="*****************" 
     android:enabled="true" 
     /> 

</LinearLayout> 

이며,이 내 해당 자바 파일

패키지 com.epidemicator.prototype이다;

import android.os.Bundle; 
import com.google.android.maps.MapActivity; 

public class Mapacti extends MapActivity { 

    public void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.mapview); 
    } 

    @Override 
    protected boolean isRouteDisplayed() { 
     // TODO Auto-generated method stub 
     return false; 
    } 
} 

여기에서 도와주세요 ... 감사합니다.

+0

중복 된 http://stackoverflow.com/questions/6975203/android-google-maps-failed-to-find-style-mapviewstyle-in-current-theme? – dmon

+0

dmon과 관련하여 본인이 참조하는 질문을보고 http://code.google.com/android/add-ons/google-apis/maps-overview.html#useslibrary를 확인하십시오. – dbryson

답변

6

내 대답은 늦은 질문 일지 모르지만 실제 이유를 다룰 것이므로 앞으로 동일한 문제를 검색 할 사람에게 도움이 될 수 있기를 바랍니다.

오류 이러한 유형의

, 우리는 layout을 위해 사용할 수없는 Theme 선택한

궁극적 인 이유는,

가있을 수 있습니다 위의 목록에서

1. Android Google Maps Failed to find style 'mapViewStyle' in current theme 
2. Failed to find style 'imageButtonStyle' in current theme 
3. Failed to find style 'editTextStyle' in current theme 
4. Failed to find style 'textViewStyle' in current theme 

아무것도.

이것은 다음과 같은 이유로 인해 발생할 수 있습니다,

  1. 선택한 themethemes.xml 파일에 사용할 수 없습니다.
  2. 선택한 theme은 상위 버전 sdk에 속하지만 현재 목표는 sdk입니다.

이 문제가 주로 발생하면 전체 layout 파일을 복사하여 project에 구현하려고

  1. . a. themes.xml 파일 을 복사하는 것을 잊었을 수 있습니다. b. target sdk이 낮을 수 있으며 원래 layout은 더 높은 숫자로 생성되었습니다. target sdk.

이 문제입니다에 대한 솔루션,

(열기보기Graphical Layout View에서 layout 파일 및이 당신의 themeslayout의 오른쪽 상단을 확인합니다. 가 선택되었습니다 .)

  1. 그래서 프로젝트 themestargeted sdk themes에 따라 theme 선택을위한 드롭 다운 목록을 클릭하고 사용 가능한 themes을 선택합니다. (OR)
  2. 당신은 당신이 layout xml 파일을 복사 한 소스 프로젝트에 themes.xml 파일을 복사를 요구하는 경우 theme가하는 custom 한 경우. (OR)
  3. 당신이 그것을 요구하는 경우 themesdk 소용 theme 인 경우, 다음 target 당신의 theme 선택에 따라 변경합니다.

희망 - 이것은 누군가에게 도움이 될 수 있습니다.

0

나는이 작은 맛있는 음식을 더할 것이라고 생각했다. 위의 4 번 오류가 발생했습니다. Preferences에 대한 테마가 이미 내가 만든 모든 단일 레이아웃 파일에 자동으로 적용되고 있다는 것을 깨닫는 것이 영원히 필요했습니다. 위에서 설명한대로 다른 것을 선택하면 문제가 해결됩니다. 안드로이드 스튜디오가 다른 모든 레이아웃에 자동으로 적용된 이유는 모르겠지만 그렇지 않길 바랍니다.

나는 왜 내가 만든 테마가 내 Preferences 페이지에만 backgroundColor를 적용했기 때문에 모든 것을 망가뜨 렸는지 알 수는 없지만 언젠가는 내가 할 것입니다.

관련 문제