How can I use appcompat-v7:19.1 in Android Studio - android

Android Studio 1.3 generate a build.gradle
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
}
but I want use com.android.support:appcompat-v7:19.1, when I type this, it tips Failed to resolve: com.android.support:appcompat-v7:19.1
How can I use appcompat-v7 with lower version ?

Add the dependency to {project}/build.gradle
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.1.+'
}
Click the Sync Project with Gradle Files button.
I hope it helps you.
For more info please visit:
https://developer.android.com/tools/support-library/features.html

Try using:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.1.+'
}
Also ensure that you have those libraries installed.

Related

Project dependencies in Android.mk

I want to build my app while flashing custom ROM on the device. I'm trying to find proper way to include project dependencies in the Android.mk. My dependencies look like this:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
wearApp project(':wear')
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.google.android.gms:play-services:6.5.87'
compile 'com.android.support:design:22.2.0'
compile 'com.android.support:cardview-v7:21.0.+'
compile 'com.timehop.stickyheadersrecyclerview:library:0.4.2#aar'
How to put it into the makefile? As static libraries? Or maybe as extra packages? Waiting for your help!

ParseFacebookUtils not recognised on android studio

I added Parse-1.9.1.jar to my libs folder and compiled it in my build.gradle file in my app folder. But when i try to initialise parseFacebookUtil, it is not recognised. I dont know why.Below is my build.gradlr. Please help me find out what am missing, thanks
dependencies {
compile fileTree(dir: 'libs', include: 'ParseCrashReporting-*.jar')
compile 'com.android.support:appcompat-v7:22.+'
compile fileTree('src/main/libs')
compile 'com.parse.bolts:bolts-android:1.+'
compile fileTree(dir: 'libs', include: 'Parse-*.jar')
compile files('libs/commons-io-2.4.jar')
compile files('libs/picasso-2.4.0.jar')
compile 'com.jakewharton:butterknife:6.1.0'
compile 'com.facebook.android:facebook-android-sdk:4.0.1'
compile files('libs/Parse-1.9.1.jar')
compile files('libs/ParseFacebookUtilsV4-1.9.1.jar')
}
Where you have
compile files('libs/ParseFacebookUtilsV4-1.9.1.jar')
Try
compile fileTree(dir: 'libs', include: 'ParseFacebookUtilsV4-*.jar')
instead. Dunno why it would work, but I had the same problem and that solved it for me. If that doesn't help, does the gradle sync/build properly without the ParseFacebook.... line?

How to fix duplicate libraries - more than one library with package name 'android.support.v7.appcompat'

Gradle build error - more than one library with package name android.support.v7.appcompat. This project has Chrome Cast in it, so is using android-support-v7-appcompat and CastCompanionLibary-android-master. Project structure is the following:
BaseGameUtils
CastCompanionLibrary-android-master
VideoBrowserActivity
android-support-v7-appcompat
android-support-v7-mediarouter
google-play-services_lib
Really tough error because the compiler doesn't give much information other than 'more than one library with package name 'android.support.v7.appcompat'. Understand why you don't want to be using different versions of the same library, but why doesn't the compiler reveal what versions are being used, and where they are being called from?
Trying to add leaderboard similar to type-a-number challenge (github example project)
There are a total of (7) build.gradle files. One for the top level and one for each of the packages listed above. Top level gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
}
BaseGameUtils:
dependencies {
compile 'com.android.support:appcompat-v7:20.0.+'
compile 'com.android.support:support-v4:20.0.+'
compile 'com.google.android.gms:play-services-games:6.5+'
compile 'com.google.android.gms:play-services-plus:6.5+'
compile 'com.google.android.gms:play-services-appstate:6.5+'
}
CastCompanionLibrary-android-master
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile 'com.android.support:appcompat-v7:20.0.+'
compile project(':android-support-v7-mediarouter')
compile 'com.google.android.gms:play-services-cast:6.5+'
compile project(':BaseGameUtils')
}
VideoBrowserActivity
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile project(':CastCompanionLibrary-android-master')
}
android-support-v7-appcompat
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}
android-support-v7-mediarouter
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile project(':android-support-v7-appcompat')
}
google-play-services_lib
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}
Any help is appreciated on this.
Just go through you project's libs folder not from the Android Studio but from you windows explorer/finder (for windows)/(for mac). And search for android.support.v7.appcompat. Any evidence found related to Apcompat (whether it is v4 or v7) is recommended to be deleted.
Hopefully your problem will be solved.
In your libs folder dont miss any sub directory that has libs folder.
Follow the Steps
1) Remove This repository:
implementation 'com.android.support:appcompat-v7:28.0.0'
2) Add This Repository
implementation 'com.android.support:support-v4:21.0.3'
compile group: 'com.android.support', name: 'appcompat-v7', version: '26.0.1'
3) That's It You Are Ready To Go

Error:Failed to find: com.google.code.gson:gson:2.3

I'm trying to add Gson library into my gradle, but it isn't finding the library. I've tried almost all the versions and nothing works.
My dependencies is following:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
// Volley
compile 'com.mcxiaoke.volley:library:1.0.6#aar'
// Gson
compile 'com.google.code.gson:gson:2.3'
}
Any solution, please?
Try this and sync the project and be sure internet is connected.
compile 'com.google.code.gson:gson:2.3.1'

Adding google analitycs to an android (gradle) project

My /build.gradle file:
....
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:21.0.0-rc1'
compile 'com.google.apis:google-api-services-analytics:v3-rev99-1.19.0'
}
And a source file:
import com.google.analytics.tracking.android.EasyTracker
where analitics is highlighted in red. Why isn't it found?
Try with the following instead:
compile 'com.google.android.gms:play-services:5.0.77'
Assuming you are trying to use V4. See
https://developers.google.com/analytics/devguides/collection/android/v4/
Follow Before you begin section.

Categories

Resources