Issue
While working with firebase UI I am getting Unable to find explicit activity class com.firebase.ui.auth.KickoffActivity
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FirebaseApp.initializeApp(this);
setContentView(R.layout.activity_main);
FirebaseApp.initializeApp(this);
mAuth=FirebaseAuth.getInstance();
mAuthListner=new FirebaseAuth.AuthStateListener() {
@Override
public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
FirebaseUser user=firebaseAuth.getCurrentUser();
if(user!=null){
Toast.makeText(getApplicationContext(),"Sign in success",Toast.LENGTH_SHORT).show();
}
else {
startActivityForResult(AuthUI.getInstance()
.createSignInIntentBuilder()
.setIsSmartLockEnabled(false)
.setProviders(AuthUI.EMAIL_PROVIDER,AuthUI.GOOGLE_PROVIDER).build(),
RC_SIGN_IN);
}
}
};
}
Full error message
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.flamanco.trackme/com.firebase.ui.auth.KickoffActivity}; have you declared this activity in your AndroidManifest.xml? at android.app.Instrumentation.checkStartActivityResult
Added dependencies on app/.gradle file
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.firebaseui:firebase-ui-auth:1.1.1'
}
apply plugin: 'com.google.gms.google-services'
also added plugin in build gradle
classpath 'com.google.gms:google-services:3.0.0'
Finally I did added SHA1 fingerprint in my firebase console project.
Do I need to add auth.kickOff activity in manifest file
Solution
Finally I have completely reinstall android studio to latest version, updated everything including
- Google play service
- firebase libraries
- gradle version
- google repositoris
And I started new project from begining and worked with no error. there are many activities that are added automatically on adding AUTHUI dependencies. these activity includes kickoffactivity,recoverpasswordactivity,registerEmailActivity,etc I can verify if by going to path
/project/module/build/intermediates/manifests/full/debug/AndroidManifest.xml.
previously i don't have kickoffactivity in this manifest file, I don't know the reason,but now i have it.I don't think adding it manually on app's manifest file will work.
Answered By - Kharak
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.