Can't Find Theme.AppCompat.Light for New Android ActionBar Support

后端 未结 30 1842
误落风尘
误落风尘 2020-11-22 09:22

I am trying to implement the new ActionBar support library that was released by Google a couple days ago. In the past, I have successfully implemented ActionBarSherlock wit

相关标签:
30条回答
  • 2020-11-22 10:15

    I made a really silly mistake for this. When I was getting same error every time i could not figure out what was wrong. then it clicked me that once I have closed all the projects in my work space and that was the time since all the problems started. SO just check whether your "appcompat_v7" is not closed. If it is then open the project by double click and then clean and build your project again. In my case the errors were gone. Happy coding!

    0 讨论(0)
  • 2020-11-22 10:16

    I did the following in Eclipse with the Android Support Library (APL) project and the Main Project (MP):

    1. Ensured both APL and MP had the same minSdkVersion and targetSdkVersion.

    2. Added APL as a build dependency for MP:

      1. Going into "Properties > Java Build Path" of MP, and then

      2. Selecting the "Projects" tab and adding APL.

    3. In the properties of MP, under "Android", added a reference to APL under library.

    1 and 2 got the references to Java classes working fine...however I still saw the error in the manifest.xml for MP when trying to reference @style/Theme.AppCompat.Light from APL. This only went away when I performed step 3.

    0 讨论(0)
  • 2020-11-22 10:16

    I had same problem and waste my 4-5 hours for solution. My problem solved with;

    1. From SDK manager delete packages "Android Support Library" and " Android Support Repository".
    2. Reinstall "Android Support Library" and " Android Support Repository"
    3. Remove "android-support-v7-appcompat" or "appcompat_v7 what else you have in your project.
    4. Import android-support-v7-appcompat from "adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat"
    5. Select your project and from file choose properties and find Java Build Path and then from "Project" tab delete what else there and then Add. and you must see "android-support-v7-appcompat" , select and add it to Project tab.
    6. Check your project.properties file below your Project files, you will see like this; target=android-21 android.library.reference.1=../android-support-v7-appcompat then check AndroidManifest.xml file if target is 21 or what else you choosed. Also check for library reference same as your library that choosed before.

    Hope you will find your solution.

    0 讨论(0)
  • 2020-11-22 10:17

    For Android Studio or IntelliJ, all you need to do is update your dependencies in gradle.build. I used the following:

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.android.support:appcompat-v7:21.0.2'
    }
    
    0 讨论(0)
  • 2020-11-22 10:18

    in eclipse right click on your project-> select build path and then select configure build path. from the window select the jar file that you want and refresh your project

    0 讨论(0)
  • 2020-11-22 10:20

    In my case the problem occurred since I wanted to use a SDK that doesnt include the required library. When I increased the min. SDK level the problem dissappeared. Of course directly including the library's itself, should remove the error as well.

    0 讨论(0)
提交回复
热议问题