Skip to content

Instantly share code, notes, and snippets.

@samtstern
Last active September 18, 2018 17:10
Show Gist options
  • Save samtstern/c8633dd03cd050699e436ece5334b61b to your computer and use it in GitHub Desktop.
Save samtstern/c8633dd03cd050699e436ece5334b61b to your computer and use it in GitHub Desktop.
FirebaseUI-Android#1447
FirebaseUI-Android#1447
Trying to repro
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.firebase.example.firebaseui1447"
minSdkVersion 21
targetSdkVersion 27
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(include: ['*.jar'], dir: 'libs')
implementation('com.crashlytics.sdk.android:crashlytics:2.7.1@aar') {
transitive = true
}
implementation('io.fabric.sdk.android:fabric:1.3.10@aar') {
transitive = true
}
implementation 'io.branch.sdk.android:library:2.+'
implementation 'com.facebook.android:facebook-android-sdk:4.34.0'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:customtabs:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:27.1.1'
implementation 'com.google.firebase:firebase-perf:16.1.0'
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.google.firebase:firebase-messaging:17.3.1'
implementation 'com.google.firebase:firebase-invites:16.0.3'
implementation 'com.firebaseui:firebase-ui-auth:4.2.0'
implementation ('com.firebaseui:firebase-ui-database:4.2.0'){
exclude group: 'com.google.firebase', module: 'firebase-database'
}
implementation 'com.firebaseui:firebase-ui-storage:4.2.0'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'com.google.maps.android:android-maps-utils:0.5'
implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
implementation 'android.arch.lifecycle:extensions:1.1.1'
annotationProcessor 'android.arch.lifecycle:compiler:1.1.1'
}
apply plugin: 'com.google.gms.google-services'
package com.firebase.example.firebaseui1447;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
FirebaseAuth.getInstance().signInAnonymously()
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
Log.d("MainActivity", "signIn: success");
onLoggedIn();
} else {
Log.w("MainActivity", "signIn: failure", task.getException());
}
}
});
}
private void onLoggedIn() {
FirebaseDatabase firebaseDatabase = FirebaseDatabase.getInstance();
DatabaseReference dataRef = firebaseDatabase.getReference();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment