Programming

리소스가 없습니다-Theme.AppCompat.Light.DarkActionBar

procodes 2020. 6. 22. 21:12
반응형

리소스가 없습니다-Theme.AppCompat.Light.DarkActionBar


ActionBar Style Generator를 사용하여 앱에 사용하려고했지만

오류 : 항목의 부모를 검색하는 동안 오류가 발생했습니다 : 주어진 이름 '@ style / Theme.AppCompat.Light.DarkActionBar'와 일치하는 리소스를 찾을 수 없습니다.

내가 사용하고 안드로이드 지원을-V7-appcompat.jar libs와 폴더 안에 LIB

내 목표는 내 앱을 2.3 이상으로 호환하는 것입니다.


AppCompat도서관 프로젝트입니다. 안드로이드 프로젝트에서 라이브러리 프로젝트를 참조해야합니다.

자원이있는 라이브러리 추가 주제를 확인하십시오 .


Eclipse를 사용 reference library하는 경우 다음 단계와 같이 프로젝트에 를 추가 하십시오.

  1. Project Explorer보기 에서 프로젝트를 마우스 오른쪽 단추로 클릭하십시오 .
  2. 를 클릭하십시오 Properties.
  3. 클릭 AndroidProperties창을여십시오.
  4. 에서 Library그룹을 클릭합니다Add...
    • 아래 이미지를 참조하십시오.
  5. 라이브러리를 선택하십시오. 를 클릭하십시오 OK .
  6. OK속성 창에서 버튼을 다시 클릭하십시오 .

프로젝트 속성 창의 "추가"버튼, 안드로이드 섹션, 라이브러리 그룹.


Android Studio사용 하는 경우 종속성을 추가하십시오.

dependencies {
     implementation 'com.android.support:appcompat-v7:25.0.1'
}

app/build.gradle. 그리고 그것은 작동합니다


VS2015를 사용하는 모든 사람 에게이 오류가 발생하여 라이브러리를 프로젝트에 추가하지 않은 것으로 나타났습니다 ...

Install-Package Xamarin.Android.Support.v7.AppCompat

Eclipse를 사용하는 경우 리소스를 사용하려는 경우 android-support-v7-appcompat.jar을 libs 폴더에 복사하면 작동하지 않습니다.

" 자원이있는 라이브러리 추가 "에 대한 단계부터 수행하십시오 .


간단한 해결책-이 파일 (/res/values/styles.xml)의 내용을 텍스트로 바꾸십시오.

<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
    <!-- Customize your theme here. -->
</style>


In my case, I took an android project from one computer to another and had this problem. What worked for me was a combination of some of the answers I've seen:

  • Remove the copy of the appcompat library that was in the libs folder of the workspace
  • Install sdk 21
  • Change the project properties to use that sdk build 여기에 이미지 설명을 입력하십시오
  • Set up and start an emulator compatible with sdks 21
  • Update the Run Configuration to prompt for device to run on & choose Run

Mine ran fine after these steps.


Using Visual Studio 2015 (Windows7) + Xamarin had this error and after trying multiple things (installing packages, download android_m2repository_r10.zip...) ended removing the full Xamarin folder inside

C:\Users\<my user>\AppData\Local

After that, Rebuild the application in VS and errors disappeared.


make sure there is a v7 directory in your sdk, I thought having the 'Android Support Library' (in Extras) was sufficient. Turns out I was missing the 'Local Maven repository for Support Libraries (extras;android;m2repository)' Studio found that actually and fixed the gradle dependencies. using gradle to build then worked. $ cat app/build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "pat.example.com.gdbdemo"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
     compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.2.1'
}

dependencies {

    compile 'com.android.support:appcompat-v7:23.0.0'

}

This worked for me... in Android Studio...


  1. Update your SDK in the manager and be sure to include Android support library in extra's
  2. Go to SDK in file explorer (Finder on mac) track down the extra's folder (..\sdk\extras\android\support\v7\appcompat\res\values on Windows). Somewhere in there is a themes.xml and themes_base.xml. Copy both of these files.
  3. In your project paste the files into 'values' directory

If you are using the Android.mk to build then use the USE_AAPT2, which link in the built resource from the AAR.

Add below line in Android.mk file:

LOCAL_USE_AAPT2 := true


In Eclipse: When importing a support library as a project library following the instructions at Adding Support Libraries, don't forget to check the option "Copy proyects into workspace"!


I had this same problem. None of the solutions listed here helped my situation. As it turns out, I was importing the parent folder for a project into Android Studio 1.5, rather than the project folder itself. This threw Gradel into a tizzy. Solution was to import the project folder instead.


dependencies {

implementation 'com.android.support:appcompat-v7:28.0.0'

}

compile has been replaced by implementation, don't know why.


MAC for Visual Studio를 사용하는 경우 프로젝트> Nutget 패키지 복원을 클릭하여 문제를 해결하십시오.

참고 URL : https://stackoverflow.com/questions/21900853/no-resource-found-theme-appcompat-light-darkactionbar

반응형