Reputation: 1
I am trying to learn android development from Udacity but having some problems importing project. In the task there is a half ready project is given as a resource to start with which is about creating language translating app code. But when I am trying to compile the project it comes up with following errors:
Error:(18, -1) android-apt-compiler: [main] C:\Users\Rushi\Downloads\ud839_Miwok-Starter-code\ud839_Miwok-Starter-code\app\src\main\res\values\styles.xml:18: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
Error:(19, -1) android-apt-compiler: [main] C:\Users\Rushi\Downloads\ud839_Miwok-Starter-code\ud839_Miwok-Starter-code\app\src\main\res\values\styles.xml:19: error: Error: No resource found that matches the given name: attr 'colorPrimary'.
Error:(20, -1) android-apt-compiler: [main] C:\Users\Rushi\Downloads\ud839_Miwok-Starter-code\ud839_Miwok-Starter-code\app\src\main\res\values\styles.xml:20: error: Error: No resource found that matches the given name: attr 'colorPrimaryDark'.
I thought that It lacks any kind of packages or something so tried to update the Android Studio to the latest version but it didn't work.
I have checked that the attribute colorPrimaryDark and colorPrimary references to the correct resource which they do.
Upvotes: 0
Views: 134
Reputation: 7661
You'll need to either increase the compileSdkVersion
or buildToolsVersion
in your app/build.gradle
file.
Or you have to use higher version numbers for external dependencies libraries like the AppCompat or support-v7. For example, changing compile 'com.android.support:appcompat-v7:21.0.0'
to compile 'com.android.support:appcompat-v7:25.0.0'
.
Note that Theme.AppCompat
comes from the support library.
Source: AppCompat v7 r21 returning error in values.xml?
Upvotes: 0
Reputation: 198
Add to your app's build.gradle:
compile 'com.android.support:appcompat-v7:25.1.0'
and also try this: Build->Rebuild Project
, File->Invalidate Caches/Restart
.
If the problem doesn't go away, please, post your build.gradle
and colors.xml
files.
Upvotes: 0