I cant import the Facebook library - android

I´m following the next tutorial to use Facebook on my app, them, In the step five I write the line: compile 'com.facebook.android:facebook-android-sdk:4.0.0' but nothing happends and I can import the library in the step 6.
This is my build.grandle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "21.1.2"
repositories {
mavenCentral()
}
defaultConfig {
applicationId "com.mookup.singup2"
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.facebook.android:facebook-android-sdk:4.0.0'
}
And in my MainAplication, I have this:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
FacebookSdk.sdkInitialize(getApplicationContext());
}
I saw the dependencies and they say "compile", but I can´t import the facebook library.
Dependencies

Related

What should be the gradle dependencies for compileSDK versio 28 in android studio 3.2.1

Here is the gradle code. It is unable to sync everytime. I'm really stuck here. Please help me. Thank you in advance.
The error is Failed to resolve: and then all the lines between the dependencies { }
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "global.alyssum.charcha"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'androidx.appcompat:appcompat:1.0.0-alpha1'
compile 'androidx.constraintlayout:constraintlayout:1.1.2'
compile 'com.google.android.material:material:1.0.0-alpha1'
testCompile 'junit:junit:4.12'
androidTestCompile 'androidx.test:runner:1.1.0-alpha3'
androidTestCompile 'androidx.test.espresso:espresso-core:3.1.0-alpha3'
}
The Top-level build file:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
The module level build file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "global.alyssum.charcha"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
staging {
signingConfig signingConfigs.debug
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.android.material:material:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

Room Persistence inside of Lib

I am looking for a good way to import Room Persistence inside of my Lib to export .aar . I have the following issue that .aar cannot handle dependencies.
When I export my arr and import into another project as lib, it seems as it has no scope to room.
my lib Gradle file :
apply plugin: 'com.android.library'
apply plugin: 'maven'
archivesBaseName = '*****'
android {
compileSdkVersion 26
buildToolsVersion "25.0.3"
defaultConfig {
minSdkVersion 16
targetSdkVersion 22
versionCode 5
versionName "1.1.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// Write out the current schema of Room
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
configurations {
deployerJars
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'android.arch.persistence.room:runtime:1.1.0-beta3'
annotationProcessor 'android.arch.persistence.room:compiler:1.1.0-beta3'
}
Thanks.

how does the gradle dependencies work, i can not find any function relate with it in the gradle source code

how does the gradle dependencies work, i can not find any function relate with it in the gradle source code.
please help me , I googled this but found nothing...
dependencies {
}
gradle dependencies work from build.gradle(Module:app)
buildscript {
repositories {
....
}
dependencies {
...........
}
}
apply plugin: 'com.android.application'
apply plugin: '..'
repositories {
.....
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "your pkg name"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
}
//Here you can add your dependencies
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.google.android.gms:play-services-ads:8.4.0'
compile 'com.google.android.gms:play-services-identity:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
........
}

Cannot resolve com.amazonaws:aws-android-sdk-lambda:2.2.+

I am developing android app backend with amazon cognito and lambda.
My Code:
package digits.digitsapp;
import com.amazonaws.mobileconnectors.lambdainvoker.LambdaFunction;
public interface MyInterface {
#LambdaFunction
String digitsLogin(PhoneInfo phoneInfo);
#LambdaFunction(functionName = "digitsLogin")
void noDigitsLogin(PhoneInfo phoneInfo);
}
app(build.gradle) :
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.testing"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.amazonaws:aws-android-sdk-core:2.+'
compile 'com.amazonaws:aws-android-sdk-cognito:2.+'
compile 'com.amazonaws:aws-android-sdk-s3:2.+'
compile 'com.amazonaws:aws-android-sdk-ddb:2.+'
compile 'com.amazonaws:aws-android-sdk-lambda:2.2.+'
}
My problem is Error:(39, 13) Failed to resolve: com.amazonaws:aws-android-sdk-lambda:2.2.+
when i add lambda sdk then i sync gradle then error comes.
please tell me what to do

Import remote library from Maven

I'm trying to add both Showcaseview by amlcurran and Android-DirectoryChooser by passy to my android app from MavenCentral, but I keep getting this error for both libraries:
Error:net.rdrei.android.dirchooser:library:2.0
This is my Project Gradle:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9.+'
}
}
allprojects {
repositories {
mavenCentral()
}
}
This is the inner one:
apply plugin: 'android'
android {
lintOptions {
checkReleaseBuilds false
}
compileSdkVersion 19
buildToolsVersion "19.0.3"
defaultConfig {
minSdkVersion 8
targetSdkVersion 19
versionCode 6
versionName "1.2.2"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0#aar'
compile 'org.jaudiotagger:jaudiotagger:2.0.1#jar'
compile 'com.android.support:support-v4:19.1.0'
compile 'net.rdrei.android.dirchooser:library:2.0#aar'
compile fileTree(dir: 'libs', include: ['*.jar'])
}
How can I fix it?
The problem is that you are not specifying the repository URL. Check my answer here:
https://stackoverflow.com/a/23879736/570612

Categories

Resources