No resource found that matches the given name android studio - android

I don't have support library in my gradle, nor i used it anywhere in my app
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// testCompile 'junit:junit:4.12'
// compile 'com.android.support:appcompat-v7:23.3.0'
so why is it not letting me build? and generating this values.xml for no reason? i have tried restarting android studio already
Error:(7) Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.

uncomment this line
compile 'com.android.support:appcompat-v7:23.3.0'
It used in our project keep refernce to android internal stuff to support pervious version with new features.

Because when you create an new Project, it creates a new Theme under
res > value > styles.xml
that inherits from Theme.AppCompat.Light.DarkActionBar.
So, basically, you need to leave that import in your gradle file, or just remove your theme from the style.xmlfile and from yor Manifest.xml too

Related

Could not find method compile() for arguments [file collection] on object

This image shows the project structure and the error
I'm following this tutorial to build a sample app using Kudan.
Here I got an error (Shown in the screenshot) after step 5 (means after Adding kudanar.jar and cardboard.jar as file dependencies )
I'm not sure I see why you need a new module for cardboard. You can just place the cardboard.jar into app/libs, and in the app/build.gradle, you can compile that JAR file as well as any others with this one line
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])

ContextThemeWrapper not working

Error:(11, 40) error: package android.support.v7.internal.view does not exist
Error:(30, 25) error: cannot find symbol class ContextThemeWrapper
I get that error even though in my gradle I have this included. What is the solution? not a strange error? I cannot run my app because of this error and its annoying. I have no jar in my libs folder as well.
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
}
There is a change in appcompat-v7:23.1.1, some elements inside package android.support.v7.internal.view were moved to android.support.v7.view. Changing your imports may solve the problem.
For more info check this answer
Or simply rollback appcompat-v7 to 23.0.1 in your build.gradle
Hope it helps!!

Including AAR lib compile error: no resource identifier found

I'm trying to make my own "lib" with Android Studio. I have generated aar file and included it to my test project. In my build.gradle I've added:
repositories {
flatDir {
dirs 'libs'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile(name:'mysdk_name', ext:'aar')
}
And in manifest of my test project I've added tools:replace="android:theme".
I can use classes from imported aar, but when I compile my project I'm getting errors:
Error:(14) No resource identifier found for attribute 'fillColor' in package 'my_package_name'
Error:(14) No resource identifier found for attribute 'pageColor' in package 'my_package_name'
And so on. Here is my code from .aar project where errors appears:
<com.viewpagerindicator.CirclePageIndicator
android:id="#+id/tutorial_images_indicator"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_margin="#dimen/dimen_8"
app:fillColor="#color/tutorial_pager_fill_color"
app:pageColor="#color/tutorial_pager_page_color"
app:radius="#dimen/dimen_4"
app:strokeWidth="0dp"/>
What should I do to fix these errors?
Edit: That attibutes defined in external module that my main app uses. I thought Android Studio will automaticly add that module to generated .aar, but I can't find that attrs inside .aar. So my question is how to include more than one module to .aar ?
So finally I think I figured it out. My problem was that my .aar doesn't include resources from external modules.
I've used android-fat-aar script to solve this problem.

Updating play-services gives repeated resources error

I want to use the new Google Cloud Messaging's InstanceID from Google Play Services, and for that I need to update my play-services library.
This is my dependencies from build.dragle from the current version:
dependencies {
compile 'com.google.android.gms:play-services:6.1.+'
compile 'com.android.support:support-v4:23.1.+'
compile project(':slidingMenuLibrary')
compile 'joda-time:joda-time:2.6'
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0#aar'
compile files('libs/GraphView-3.1.1.jar')
compile files('libs/ksoap2-android-assembly-3.3.0-jar-with-dependencies.jar')
compile files('libs/libphonenumber-7.0.1.jar')
compile files('libs/opencsv-2.4.jar')
compile files('libs/ormlite-android-4.46.jar')
compile files('libs/ormlite-core-4.46.jar')
compile files('libs/ormlite-jdbc-4.46.jar')
}
And heres is build.dragle from slidingMenuLibrary:
dependencies {
compile 'com.android.support:support-v4:23.1.+'
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0#aar'
}
I updated my Google Play Services on Android SDK Manager to the last version. But when I change compile 'com.google.android.gms:play-services:6.1.+' to compile 'com.google.android.gms:play-services:8.1.0', Android Studio give a list of errors:
Error:(1) Attribute "titleTextStyle" has already been defined
C:\Users\Rui\AndroidStudioProjects\tk-main- repository\tkAndroid\src\main\res\values\colors.xml
Error:(1) Attribute "subtitleTextStyle" has already been defined
Error:(1) Attribute "divider" has already been defined
Error:(1) Attribute "background" has already been defined
Error:(1) Attribute "backgroundSplit" has already been defined
...
When I change back to play-services:6.1.+', all errors disappear.
I know that I have repeated attributes, but I can't understand where can I change them, or what to do to solve this...
any sugestions?
It is no longer recommended to use the full play-services dependency. Rather you should use the individual dependency that you require.
For GCM use:
compile 'com.google.android.gms:play-services-gcm:8.1.0'
See Table 1 in this document for the full list.

Error:(1) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material'

Error:(1) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material'.
The above error pops up everywhere when I add a Google Maps Activity to a basic Parse.com Note App.
Set your compile and target version to 19 and your min SDK to whatever version you need.
Next you have to adjust your imports to the version that is compatible with the SDKs that you have chosen to compile for. For example if you want to use the v7 support library on sdk 19 you must import it like this: compile compile 'com.android.support:appcompat-v7:20.+'
The Google Map Activity updated the build.gradle file. The following dependencies fixed the issue:
dependencies {
compile 'com.android.support:support-v4:19.1.0'
compile files('libs/Parse-1.5.1.jar')
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.1.0'
compile 'com.google.android.gms:play-services:7.3.0'
}

Categories

Resources