How do I fix the version after adding Facebook Sharing SDK? - android

My application had been working fine. I want the user to share the last activity EdiText displayed text in the app on Facebook. To do so, I followed this tutorial.
https://developers.facebook.com/docs/android/getting-started/
The topic: Share and Send dialogs.
I followed the steps:
Added mavenCentral() to repositories.
Added the below line to dependencies.
compile 'com.facebook.android:facebook-share:[5,6)'
After this, I received the error :
implementation 'com.android.support:support-v7:28.0.0'
So, here I changed v7 to v4
implementation 'com.android.support:support-v4:28.0.0'
After this step's rebuilding, there were no errors.
I ran the app, but the app shows "App not responding, Close or Wait"
I tried it again, but the app looks froze then closes itself.
The below code is build.gradle : Module app
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.dumdum.newapp"
minSdkVersion 27
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 {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.facebook.android:facebook-share:[5,6)'
}
I want to remove the error here.
implementation 'com.android.support:support-v7:28.0.0'
Althought I changed it to
implementation 'com.android.support:support-v4:28.0.0'
Still, the same error exists.
The eventlog is error-free.
But when clicked on this below line, the error box is shown next to it:
implementation 'com.android.support:support-v7:28.0.0'
OR
implementation 'com.android.support:support-v4:28.0.0'
I could not add error box because Stackoverflow considering that part as spam.

Related

Unable to add layouts to an activity using Android Studio

Using Android Studio, in my activity's .xml I can't edit the layout in regards to which layout type the overall one is. The only way for me to change layouts is to copy-paste the layout code from somewhere on the internet and I've been doing it like that for the past month.
This is ridiculous. Why am I having this issue?
Drag and dropping a layout on to the activity inside of the designer does nothing.
Upon creating an empty activity of which the default layout is "ConstraintLayout", I can't do anything with that layout inside of the designer. I can only remove it by deleting the code from within the .xml view.
My build.gradle (Module: app):
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "hr.package.name.testsigninna"
minSdkVersion 23
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.android.support:recyclerview-v7:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
The problem is present in all projects I make.
I'm not sure but please check the gradle or it's version may be too old whether all the dependencies are working or not. Sync them and rebuild the project.

I can't seem to build my android application when I'm signing it

I can build the application when it's not signed but every time I try to sign Android Studio says something along the lines of
"ERROR: Failed to resolve: com.android.support.cardview-v7:27.1.1"
I've checked this and verified it exists but it doesn't seem to work, it gives other dependency issues if I try to fix it.
"My build.gradle (app)"
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "uk.org.cetma.llanellistandard"
minSdkVersion 23
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
repositories {
mavenCentral() // jcenter() works as well because it pulls from Maven
Central
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.android.support:support-v7:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.squareup.picasso:picasso:2.71828'
testImplementation 'junit:junit:4.12'
//androidTestImplementation 'com.android.support.test:runner:1.0.2'
//androidTestImplementation 'com.android.support.test.espresso:espresso-
core:3.0.2'
//Add Library
implementation 'com.android.support.cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-27.1.0'
implementation 'com.google.code.gson:gson:2.8.2'
}
I want it to sign the application so I can make sure it still works.
Below is an example of the error I get:
ERROR: Failed to resolve: com.android.support.cardview-v7:27.1.1:
Affected Modules: app
double dots are missing from your card view dependency use this -
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
try with
implementation 'com.android.support:cardview-v7:27.1.1'

How to fix the error: Resource android:style/Theme.AppCompat.light.noActionBar not found

I am in the middle of creating an app for my culminating project that is due in several days. I was creating a new activity but I initially named it something I didn't want to. I deleted the activity file and the errors occurred. The following errors are:
resource android:style/Theme.AppCompat.light.noActionBar not found.
error: failed linking references. Error occurs during the Run Tasks part of the Build. I am on Android Version 3.1.1.
All instances of R don't work as well; with a message saying cannot resolve symbol 'R'. I've looked at several other solutions but unfortunately it doesn't check out with my problem.
I've tried clean / rebuild but unfortunately, that hasn't gone well.
I have also tried invalidating caches/restart, as well as a fresh reinstall.
Here is my build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.henry.henryso"
minSdkVersion 15
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 {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//appcompat
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//Recycler View
implementation 'com.android.support:recyclerview-v7:28.0.0'
//Toolbar design support
implementation 'com.android.support:design:28.0.0'
}

Failed to resolve: com.android.support after building gradle but my app can still be installed

I have gone through all stackoverflow examples but couldn't find a solution for my problem. I tried to downgrade mz sdk vesrion and android:support but it didn't work.
I am having the following code in build.gradle. However, whenever I try to build my gradle it shows an error: Failed to resolve: com.android.support... Anyway I am able to successfully install apk to my devices and it runs perfectly. I just don't want that his dependency will cause some error in the future.
Thanks!
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.feecollector.android.feecollector"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.navigation_menu.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.0.1-alpha1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'de.hdodenhof:circleimageview:1.3.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.navigation_menu:runner:1.0.2'
androidTestImplementation 'com.android.support.navigation_menu.espresso:espresso-core:3.0.2'
implementation 'com.facebook.android:facebook-android-sdk:4.36.0'
}
You are using different versions of com.android.support.
this is your code:
implementation 'com.android.support:appcompat-v7:27.0.1-alpha1'
implementation 'com.android.support:design:27.1.1'
it should be like this:
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
You have issue with gradle local setting. You can try to Invalidate and Restart cache. Click File -> Invalidate caches.
Sometimes you might even other issues with updating to new Gradle level. For this case, remove .idea and .gradle folders from Project Room and Import it again from Idea start screen.

W/BiChannelGoogleApi: [FirebaseAuth: ] getGoogleApiForMethod() returned Gms

well my app working fine getting data from Firebase. but sometimes specially after waiting long time if I open my app again it wont read data from firebase and also it gives this warning at Logcat. until I sing in and sing out it is not working.
W/BiChannelGoogleApi: [FirebaseAuth: ] getGoogleApiForMethod() returned Gms
are there any missing lines on my gradle?
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.restroomgames.whereismydudy.where"
minSdkVersion 23
targetSdkVersion 26
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.google.android.gms:play-services-maps:11.6.2'
implementation 'com.google.firebase:firebase-auth:11.6.2'
implementation 'com.google.firebase:firebase-database:11.6.2'
implementation 'com.google.firebase:firebase-messaging:11.6.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.google.android.gms:play-services-location:11.6.2'
implementation 'com.android.support:design:26.1.0'
implementation 'com.lapism:searchview:5.0.0-alpha7'
implementation 'agency.tango.android:material-intro-screen:0.0.5'
implementation 'com.firebase:geofire-android:2.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
}
apply plugin: 'com.google.gms.google-services'
The code seems ok..
It just happened to me something similar, same warning, problems with email/password auth..
It was because I forgot to update the SHA-1 fingerprints in the project after I upgraded my computer OS..
Maybe is a problem with your API keys or SHA-1 fingerprints in your project?
No there is nothing missing in your Gradle, this problem actually has come about since the upgrade to Firebase 11.6.0 Downgrading to 11.4.2 seems to remove the warning messages.

Categories

Resources