I'm trying to implement elegant number button in my app, but it's library is not syncing. Here is the gradle file.
//...
// FirebaseUI for Cloud Storage
implementation 'com.firebaseui:firebase-ui-storage:3.3.1'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.4'
implementation 'com.android.support:multidex:1.0.1'
implementation 'com.github.Hitomis:CircleMenu:v1.0.2'
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
implementation 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
compile 'com.cepheuen.elegant-number-button:lib:1.0.2'
}
apply plugin: 'com.google.gms.google-services'
here is the error:
Unable to resolve dependency for ':app#releaseUnitTest/compileClasspath': Could not resolve com.cepheuen.elegant-number-button:lib:1.0.2.
Replace compile with implementation
Add
xmlns:tools="http://schemas.android.com/tools"
tools:replace="android:theme"
to your AndroidManifest.xml (inside application tag)
this work for me :)
Replace this line:
compile 'com.cepheuen.elegant-number-button:lib:1.0.2'
With this:
implementation 'com.cepheuen.elegant-number-button:lib:1.0.2'
And also don't forget to add this to your project level build.gradle file:
buildscript {
repositories {
jcenter()
}
dependencies {
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
In your project File->setting check you are working offline or online...if you are working offline you need to be work online to resolve this error..
Related
I have a modification I want to do to android settings in order for it to be compatible with older versions so I added to the dependencies
implementation "com.android.support:recyclerview-v7:$support_version"
//implementation "com.android.support:appcompat-v7:$support_version"
This produced the error
Could not get unknown property 'support_version' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
I added the following to the top of the build.gradle file also
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-android-extensions'
}
Please what am I doing wrong?
In order to progress I had to comment the two lines out so that the android can compile but I need to make it backward compatible in production.Android
Try with below dependency In App gridle File
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
Project level Gridle File
buildscript {
ext.kotlin_version = '1.4.20'
repositories {
google()
jcenter()
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
}
com.android.support is deprecated. Replace by androidx
implementation "androidx.recyclerview:recyclerview:1.2.0-beta01"
implementation "androidx.appcompat:appcompat:1.3.0-alpha02"
You are missing the "support_version" variable in your Gradle script.
Try this:
add this to your build.gradle
ext.main = ['support_version' : 'X.X.X']
and in your dependency structure, you can add.
implementation "com.android.support:recyclerview-v7:${main.support_version}"
NB: make sure you have valid version number.
I am using Firebase authentication to sign up using phone number. But any sms not being send.
I am getting this error
W/BiChannelGoogleApi: [FirebaseAuth: ] getGoogleApiForMethod()
returned Gms: com.google.firebase.auth.api.internal.zzak#d5a4a6d
My gradle file
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0-beta01'
implementation 'com.google.android.material:material:1.1.0-alpha07'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0-alpha01'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'com.google.firebase:firebase-auth:18.0.0'
implementation 'com.android.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.13-beta-3'
androidTestImplementation 'androidx.test:runner:1.3.0-alpha01'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0-alpha01'
}
I understand you have missed setting up Firebase in your application.
Follow the whole process from here
Make sure you have google-services.json file in in the module (app-level) directory of your app.
Your root-level (project-level) Gradle file (build.gradle) must have these lines.
buildscript {
repositories {
// Check that you have the following line (if not, add it):
google() // Google's Maven repository
}
dependencies {
// ...
// Add the following line:
classpath 'com.google.gms:google-services:4.2.0' // Google Services plugin
}
}
allprojects {
// ...
repositories {
// Check that you have the following line (if not, add it):
google() // Google's Maven repository
// ...
}
}
Then In your module (app-level) Gradle file (usually app/build.gradle), add a line to the bottom of the file.
apply plugin: 'com.android.application'
android {
// ...
}
// Add the following line to the bottom of the file:
apply plugin: 'com.google.gms.google-services' // Google Play services Gradle plugin
In your module (app-level) Gradle file (usually app/build.gradle), add the dependency for the core Firebase SDK:
dependencies {
// ...
implementation 'com.google.firebase:firebase-core:17.0.0'
// Getting a "Could not find" error? Make sure that you've added
// Google's Maven repository to your root-level build.gradle file
}
I am new to android development environment and I need to connect my app to firebase but I am getting this error
Failed to resolve: firebase-auth-15.0.0
This error is shown in the statement:
implementation 'com.google.firebase:firebase-auth:15.0.0' //16.0.1
I tried to change the above statement to
implementation 'com.google.firebase:firebase-auth:16.0.3'
But then firebase dependency is not setting up.
You should use firebase-auth:16.0.4 version.
implementation 'com.google.firebase:firebase-auth:16.0.4'
FYI
At first, add rules to your root-level build.gradle file, to include the google-services plugin and the Google's Maven repository:
buildscript {
// ...
dependencies {
// ...
classpath 'com.google.gms:google-services:4.1.0' // google-services plugin
}
}
allprojects {
// ...
repositories {
// ...
google() // Google's Maven repository
}
}
After that, Clean-Rebuild-Run.
Read Add Firebase to Your Android Project
Update the dependency to the following:
implementation 'com.google.firebase:firebase-auth:16.0.4'
Also add firebase-core:
implementation 'com.google.firebase:firebase-core:16.0.4'
https://firebase.google.com/support/release-notes/android
Please also update google-services plugin in top level gradle file:
classpath 'com.google.gms:google-services:4.1.0'
I'm trying to use the sdk Firebase natively on Android but when I try to initialize Firebase using:
com.google.firebase.FirebaseApp.initializeApp(utils.ad.getApplicationContext();
I receive this error
System.err: Error: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process *******. Make sure to call FirebaseApp.initializeApp(Context) first.
in my app.gradle:
dependencies {
compile 'com.google.firebase:firebase-core:11.8.0'
compile 'com.google.firebase:firebase-messaging:11.8.0'
compile "com.google.android.gms:play-services-base:11.8.0"
}
can help me?
Add rules to platforms/android/build.gradle file, to include the google-services plugin and the Google's Maven repository:
buildscript {
// ...
dependencies {
// ...
classpath 'com.google.gms:google-services:3.1.1' // google-services plugin
}
}
allprojects {
repositories {
// ...
maven {
url "https://maven.google.com" // Google's Maven repository
}
}
}
Insert firebase dependencies to App_Resources/Android/app.gradle:
dependencies {
compile 'com.google.firebase:firebase-core:11.8.0'
//compile 'com.google.firebase:firebase-messaging:11.8.0'
//compile "com.google.android.gms:play-services-base:11.8.0"
// ...
}
And at the end of App_Resources/Android/app.gradle insert:
apply plugin: 'com.google.gms.google-services'
Finally, if you hit the error:
> File google-services.json is missing. The Google Services Plugin cannot function without it.
Copy manually the google-services.jsonfile:
cp app/App_Resources/Android/google-services.json platforms/android/app/google-services.json
Meanwhile, thank you so much for your reply #attdona :)
I solved by doing more or less what you did.
The only differences are that:
To use a dynamic build.gralde I created a hook to replace the
original one with mine to compile.
Always using a hook I copied
the file google-services.json from App_Resources/Android/ to
platforms/android/app
I created a new library module to my project in Android Studio. A class in this new module accesses org.json.JSONObject.
I'm getting the error:
failed to resolve org.json:json:20141113
when trying to build the project.
Here's how my build.gradle file looks:
apply plugin: 'java'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':app')
compile files('libs/volley.jar')
compile 'org.json:json:20141113'
}
Please let me know if I'm missing anything.
Thanks.
Try adding a repository to your configuration maybe that helps.
repositories {
mavenCentral()
}
For more information see here:
User-guide: Dependency Management Basics
Test This one , Worked for me
dependencies {
implementation 'com.cedarsoftware:json-io:4.10.1'
}