My build.gradle file
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:22.2.1'
compile 'com.google.firebase:firebase-core:9.4.0'
compile "com.google.firebase:firebase-auth:9.4.0"
compile 'com.google.firebase:firebase-crash:9.4.0'
}
apply plugin: 'com.google.gms.google-services'
This is how i am initializing FireBase Crash:
FirebaseCrash.report(new Exception("My first Android non-fatal error"));
but I am getting this from Logcat:
Failed to initialize crash reporting
com.google.firebase.crash.internal.zzg$zza: com.google.android.gms.internal.zzsb$zza:
No acceptable module found. Local version is 0 and remote version is 0.
Crash reporting won't initialize if you don't have updated Google Play Services on your device or you haven't it installed at all.
I agree with #user6749691 that the failure is most likely caused by Google Play Services being old or not present. The issue is discussed here.
You can confirm that your installed Play Services is sufficient to support Firebase by adding this method and calling it when your app initializes:
private void showGooglePlayServicesStatus() {
GoogleApiAvailability apiAvail = GoogleApiAvailability.getInstance();
int errorCode = apiAvail.isGooglePlayServicesAvailable(this);
String msg = "Play Services: " + apiAvail.getErrorString(errorCode);
Log.d(TAG, msg);
Toast.makeText(this, msg, Toast.LENGTH_LONG).show();
}
Check for typos, that can be a reason too.
compile 'com.google.firebase:firebase-ads:11.0.2'
compile 'com.google.firebase:firebase-core:11.0.2'
compile 'com.google.firebase:firebase-messaging:11.0.2'
compile 'com.google.firebase:firebase-crash:11.0.1'
Silly mistake, hard to spot, but for e.g. I had x.x.1, instead of x.x.2, and all Firebase / Google Play Service libs should use the same version.
Related
mAuth!!.createUserWithEmailAndPassword(email,password)
.addOnCompleteListener(this){ task ->
if (task.isSuccessful){
Toast.makeText(applicationContext,"Successful login",Toast.LENGTH_LONG).show()
var currentUser =mAuth!!.currentUser
//save in database
if(currentUser!=null) {
myRef.child("Users").child(SplitString(currentUser.email.toString())).child("Request").setValue(currentUser.uid)
}
LoadMain()
}else
{
Toast.makeText(applicationContext,"fail login",Toast.LENGTH_LONG).show()
}
}
I get "developer warning for package 'com.example.package' Failed to post notification on channel 'null' See log for more details"
In the log
DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
GooglePlayServicesUtil: Google Play services out of date. Requires 11020000 but found 10932470
Notification: Use of stream types is deprecated for operations other than volume control
Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
I have
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:26.0.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-core:11.2.0'
compile 'com.google.firebase:firebase-auth:11.2.0'
compile 'com.google.firebase:firebase-database:11.2.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.0'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.0'
}
in build.gradle
I've been lookin at this https://developer.android.com/guide/topics/ui/notifiers/notifications.html#ManageChannels, but I don't know how to work on this
your version of play services is old.
use latest google play services in gradle:
dependencies {
compile 'com.google.android.gms:play-services:11.2.0'
}
For Oreo Copatability you must use channels and group them to run on Oreo (android O) otherwise your notifications will be dropped.
Use this link to Learn more about channels in Android O link
medium link
Read about android O changes here
After having started using Firebase for event logging in my android app I keep getting these error messages when I fire up my app:
E/System: java.lang.IllegalStateException: The database '/...folder here.../google_app_measurement_local.db' is not open.
at android.database.sqlite.SQLiteDatabase.throwIfNotOpenLocked(SQLiteDatabase.java:2169)
at android.database.sqlite.SQLiteDatabase.createSession(SQLiteDatabase.java:365)
at android.database.sqlite.SQLiteDatabase$1.initialValue(SQLiteDatabase.java:84)
at android.database.sqlite.SQLiteDatabase$1.initialValue(SQLiteDatabase.java:83)
at java.lang.ThreadLocal$Values.getAfterMiss(ThreadLocal.java:430)
at java.lang.ThreadLocal.get(ThreadLocal.java:65)
at android.database.sqlite.SQLiteDatabase.getThreadSession(SQLiteDatabase.java:359)
at android.database.sqlite.SQLiteProgram.getSession(SQLiteProgram.java:101)
at android.database.sqlite.SQLiteQuery.setLastStmt(SQLiteQuery.java:96)
at android.database.sqlite.SQLiteQuery.close(SQLiteQuery.java:111)
at android.database.sqlite.SQLiteCursor.close(SQLiteCursor.java:300)
at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:366)
at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:202)
at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:185)
at java.lang.Thread.run(Thread.java:818)
Here's a snippet from my build.gradle:
dependencies {
compile 'com.android.support:support-v4:25.0.0'
compile 'com.google.firebase:firebase-analytics:9.8.0'
compile 'com.google.firebase:firebase-crash:9.8.0'
compile files('src/main/resources/simple-xml-2.7.jar')
compile files('src/main/resources/date4j.jar')
compile 'com.android.support:appcompat-v7:25.0.0'
compile files('src/main/resources/picasso-2.5.2.jar')
}
All I do is call
_firebaseAnalytics = FirebaseAnalytics.getInstance(context);
and then
_firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SHARE, payload);
I have not been able to find any solutions online and am now hoping for help here...
Please move to latest version of firebase SDK. Firebase solved this memory leak issue in their updated sdk. Remove your old SDK and add below line in your gradle file.
compile 'com.google.firebase:firebase-core:11.0.1'
I have just faced with this when enabling strictmode, when adding
compile 'com.google.firebase:firebase-core:9.8.0'
I had to use earlier version:
compile 'com.google.firebase:firebase-core:9.6.0'
I've found latest version from Firebase Android SDK Release Notes
I have update the google play service version to 7.+, this version is required for GoogleApiClient, After updating google play version when i run project it will take much time and stuck entire computer.
Please guide.
thanks
Make sure to use required Google API in project. What you need in your project.
dependencies {
compile 'com.google.android.gms:play-services-plus:8.3.0'
compile 'com.google.android.gms:play-services-base:8.3.0'
compile 'com.google.android.gms:play-services-gcm:8.3.0'
compile 'com.google.android.gms:play-services-location:8.3.0'
compile 'com.google.android.gms:play-services-maps:8.3.0'
compile 'com.google.android.gms:play-services-analytics:8.3.0'
}
Note: Do not use complete google dependencies
dependencies {
compile 'com.google.android.gms:play-services:8.3.0'
}
I am trying to add the Instance Id (last line)
dependencies {
//Basic Google libs
compile 'com.android.support:support-v4:+'
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.google.android.gms:play-services-base:7.5.0'
compile 'com.google.android.gms:play-services-gcm:7.5.0'
compile 'com.google.android.gms:play-services-location:7.5.0'
compile 'com.google.android.gms:play-services-maps:7.5.0'
compile 'com.google.android.gms:play-services-wallet:7.5.0'
compile 'com.google.android.gms.iid:7.5.0'
}
but I keep getting:
Error:Failed to resolve: com.google.android.gms.iid:7.5.0:
Any clue why?
There is nothing like : 'com.google.android.gms.iid:7.5.0' provided by google play services
If you are looking for identity service then it should be :
com.google.android.gms:play-services-identity:7.5.0
Refer link : https://developers.google.com/android/guides/setup
Not sure for version 7.5
but for 10.0.1 just use
compile 'com.google.android.gms:play-services-iid:10.0.1'
For everyone searching for InstanceId for the new GCM, Firebase Cloud Messaging, use FirebaseInstanceId instead. With:
FirebaseInstanceId.getInstance().getToken();
read more at https://firebase.google.com/docs/cloud-messaging/android/client#sample-register
I am using Android Studio 0.3.4 with Gradle build.
I get this error message when I build my project:
Gradle: Execution failed for task > Could not call IncrementalTask.taskAction()
This is because google play services and GoogleAdMobAdsSdk-6.4.1 are conflictiing. My build.gradle has this entry:
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile 'com.android.support:support-v13:13.0.0'
compile 'com.google.android.gms:play-services:4.0.30'
compile files('libs/GoogleAdMobAdsSdk-6.4.1.jar')
When I remove GoogleAdMobAdsSdk then it builds fine. How can I solve this problem?
this is the error:
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lcom/google/ads/AdRequest$Err
orCode;
at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:12
3)
thanks
Google Mobile Ads SDK for Android is now included as part of Google Play services 4.0. More info http://googleadsdeveloper.blogspot.com.es/2013/10/upgrade-to-new-google-mobile-ads-sdk.html
As you say, your build.gradle should be without Google Mobile Ads SDK library:
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile 'com.android.support:support-v13:13.0.0'
compile 'com.google.android.gms:play-services:4.0.30'
}
But Google Mobile Ads SDK doesn't support DoubleClick For Publishers, Ad Exchange or Search Ads for Mobile Apps yet. They say that soon will be supported. If this is your case, use the previous version of Play Services combined with Google Mobile Ads SDK:
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile 'com.android.support:support-v13:13.0.0'
compile 'com.google.android.gms:play-services:3.2.65'
compile files('libs/GoogleAdMobAdsSdk-6.4.1.jar')
}