android - firebase 错误 W/DynamiteModule : Local module descriptor class for com. 找不到 google.firebase.auth

标签 android firebase firebase-authentication

  • 我尝试基于登录/注册帐户构建应用。
  • 我创建了它的 Firebase 并通过电子邮件启用了身份验证。
  • 我添加了 google-play-services.json 文件。
  • 我加了

    apply plugin: 'com.google.gms.google-services'
    compile 'com.google.firebase:firebase-auth:10.0.1'
    

    在 build.gridle(app) 中

    然后在我添加的模块中

    classpath 'com.google.gms:google-services:3.0.0'
    

    这是我的代码

    public class splashscr extends Activity implements View.OnClickListener{
    
    TabHost tab ;
    Button logbtn,signup;
    EditText email,password,signupemail,signuppassword;
    private FirebaseAuth firebaseAuth;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        tab =(TabHost) findViewById(R.id.tabhost);
        logbtn = (Button) findViewById(R.id.btn_login);
        signup = (Button) findViewById(R.id.btn_signup);
        password = (EditText)findViewById(R.id.input_password);
        email = (EditText)findViewById(R.id.input_email);
        signupemail =(EditText)findViewById(R.id.signupinput_email);
        signuppassword = (EditText) findViewById(R.id.signupinput_password);
        firebaseAuth = FirebaseAuth.getInstance();
        logbtn.setOnClickListener(this);
        signup.setOnClickListener(this);
        tab.setup();
    
        TabHost.TabSpec spec = tab.newTabSpec("tag1");
        spec.setIndicator("",getResources().getDrawable(R.drawable.loginpic));
        spec.setContent(R.id.tab1);
        tab.addTab(spec);
    
        spec = tab.newTabSpec("tag2");
        spec.setIndicator("",getResources().getDrawable(R.drawable.signupp));
        spec.setContent(R.id.tab2);
        tab.addTab(spec);
    }
    @Override
    public void onClick(View view) {
       final Intent I = new Intent(this,HomeActivity.class);
        final String emailout = signupemail.getText().toString();
        final String passwordout = signuppassword.getText().toString();
        if (view == signup){
            (firebaseAuth.createUserWithEmailAndPassword(emailout,passwordout)).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
                @Override
                public void onComplete(@NonNull Task<AuthResult> task) {
                    if (task.isSuccessful()){
                        Toast.makeText(splashscr.this, "تم تسجيلك بنجاح ", Toast.LENGTH_SHORT).show();
                        startActivity(I);
                        finish();
                    }
                    else
                    {
                        Log.e("ERROR", task.getException().toString());
                        Toast.makeText(splashscr.this, "فشل التسجيل", Toast.LENGTH_SHORT).show();
                    }
                    Toast.makeText(splashscr.this,emailout+passwordout, Toast.LENGTH_SHORT).show();
                }
            });
        }
    }
    }
    

我得到这个错误:

E/ERROR: com.google.firebase.FirebaseException: An internal error has occurred. [ OPERATION_NOT_ALLOWED ]
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.

怎么了?

最佳答案

尝试将您的客户端与您的 Firebase 应用重新同步,并再次添加 .json 文件。 在 android studio 2.3 中,只需单击工具>firebase,然后在助手中检查您的应用是否已连接。

关于android - firebase 错误 W/DynamiteModule : Local module descriptor class for com. 找不到 google.firebase.auth,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41580389/

相关文章:

ios - 更改使用电子邮件链接验证的 iOS Firebase 用户的电子邮件

swift - Firebase 身份验证获取用户个人资料

java - Dagger 2,MVVM : Adding a third tab and going back and forth crashes the app

java - Android中Base64文件上传IllegalArgument异常

firebase - Flutter 无法构建 apk

java - list 合并失败并出现多个错误,请参阅日志错误

firebase - 本地主机上的 Firebase 不支持浏览器?

android - 需要在 android 中自定义 ListView 示例

android - 是否可以在 Android XML 资源文件中写入字符串数组文字?

Angular 7 通用 firebase 路由