Error retrieving parent for item:No resource found

2020-07-22 18:24发布

问题:

Google has now Android Lollipop, I opened my sdk manager and decided to update couple of packages... It is furstrating me from 2 days. Can't find theme

I have also tried this: Failed to rename directory

Unsuccessful. I tried to download a new sdk from Google and install from scratch, did not work again. Here is the error.

D:\~\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.

 D:\~\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.

D:\~\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.


  [1]: https://stackoverflow.com/questions/8839255/failed-to-rename-directory-tools-to-temp-toolpackage-old01-in-c-android-sdk-win

I will be very thankful if someone help me try running my eclipse Juno. I can also say that some of my old apps are working with lower version, but when I create a new one... error:

import android.support.v7.app.ActionBarActivity; It is not reading the android.suppor.v7

then if I reference it to my android app I have a ! sign and lots of mistakes like:

   D:\Android Studio\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\themes_base.xml:193: error: Error: No resource found that matches the given name: attr 'android:colorControlNormal'.
 D:\Android Studio\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\themes_base.xml:190: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'.
 D:\Android Studio\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\themes_base.xml:191: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.

回答1:

For me with the latest (21.0.2) version of Android Support Library the solution was to change the build target for appcompat_v7 project to API 21 (Android 5.0), clean and rebuild.



回答2:

I solved the problem changing in gradle

compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.android.support:support-v4:21.0.0'

to

compile 'com.android.support:appcompat-v7:19.0.0'
compile 'com.android.support:support-v4:19.0.0'

and compile / target sdk to 19



回答3:

Did you try updating the target SDK to 21 and building the project?



回答4:

Got the same problem... Perhaps one solution is to download an old sdk and not updating it.