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
Finally I have completely reinstall android studio to latest version, updated everything including
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
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.
Manually adding the KickoffActivity activity to the manifest is not the right solution. It should be done for you. If you manually add the KickoffActivity, you will then have to add another activity and another one and so on. I happened to have:
In my manifest. Which prevents any manifest merging. Removed it and it worked fine since.
After that you might get some other merging errors like duplicate tags etc.. But the error will be different and will tell you what to do now. I had a case of a tag used twice in my and in a merged manifest so I was told to add:
Which fixed that too.
You need to declare the activity in the AndroidManifest.xml
Open your manifest file and add the KicoffActivity.
Also, I am not sure you have initial FirebaseApp twice here..
Usually it should be initialized only once in the application class, in onCreate() method.
Create a new application class..
And add the same in the manifest,
Make sure your have declared your KickoffActivity properly in AndroidManifest.xml as
Especially check the name attribute, if you have activity in package say "test" then you'll have to change the name attribute as
If everything fine with AndroidManifest.xml, I would suggest to update your libraries as mentioned by deividas.
You can check the FirebaseUI release notes here https://github.com/firebase/FirebaseUI-Android/releases
Also update other firebase libraries to