Firebase突然停止工作,找不到com.google.android.gms.crash的本地模块描述符类

时间:2018-02-21 11:44:05

标签: java android firebase firebase-realtime-database firebase-authentication

我的所有firebase监听器突然停止工作,我开始在我的日志中收到Local module descriptor class for com.google.android.gms.crash not found.,没有任何错误。我在这里搜索了类似的问题,但几乎所有人都没有接受的解决方案,而那些确实没有帮助我的情况。这似乎很奇怪,因为我没有改变听众自己。请接受任何建议。

这是我的登录活动:

public class LoginActivity extends AppCompatActivity implements View.OnClickListener{

    //defining views
    private Button buttonSignIn;
    private EditText editTextEmail;
    private EditText editTextPassword;
    private TextView textViewSignup;
    private TextView textViewForgotPassword;

    //firebase auth object
    private FirebaseAuth firebaseAuth;

    //progress dialog
    private ProgressDialog progressDialog;
    private Toolbar mActionBarToolbar;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            Window w = getWindow(); // in Activity's onCreate() for instance
            w.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
        }

        //getting firebase auth object
        firebaseAuth = FirebaseAuth.getInstance();

        //if the objects getcurrentuser method is not null
        //means user is already logged in
        if(firebaseAuth.getCurrentUser() != null){
            //close this activity
            finish();
            //opening profile activity
            startActivity(new Intent(getApplicationContext(), MainActivity.class));
        }

        //initializing views
        editTextEmail = (EditText) findViewById(R.id.editTextEmail);
        editTextPassword = (EditText) findViewById(R.id.editTextPassword);
        buttonSignIn = (Button) findViewById(R.id.buttonSignin);
        textViewSignup  = (TextView) findViewById(R.id.textViewSignUp);
        textViewForgotPassword = (TextView) findViewById(R.id.textViewForgotPassword);

        progressDialog = new ProgressDialog(this);

        //attaching click listener
        buttonSignIn.setOnClickListener(this);
        textViewSignup.setOnClickListener(this);
        textViewForgotPassword.setOnClickListener(this);
    }

    //method for user login
    private void userLogin(){
        String email = editTextEmail.getText().toString().trim();
        String password  = editTextPassword.getText().toString().trim();


        //checking if email and passwords are empty
        if(TextUtils.isEmpty(email)){
            Toast.makeText(this,"Please enter email",Toast.LENGTH_LONG).show();
            return;
        }

        if(TextUtils.isEmpty(password)){
            Toast.makeText(this,"Please enter password",Toast.LENGTH_LONG).show();
            return;
        }



        //if the email and password are not empty
        //displaying a progress dialog

        progressDialog.setMessage("Logging In Please Wait...");
        progressDialog.show();

        //logging in the user
        firebaseAuth.signInWithEmailAndPassword(email, password)
                .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
                    @Override
                    public void onComplete(@NonNull Task<AuthResult> task) {
                        progressDialog.dismiss();
                        //if the task is successfull
                        if(task.isSuccessful()){
                            //start the profile activity
                            finish();
                            startActivity(new Intent(getApplicationContext(), MainActivity.class));
                        }
                        else {
                            failure();
                        }

                    }

                });

    }

    public void failure(){
        Toast.makeText(this,"Wrong Email or Password",Toast.LENGTH_LONG).show();
    }

    @Override
    public void onClick(View view) {
        if(view == buttonSignIn){
            userLogin();
        }

        if(view == textViewSignup){
            finish();
            startActivity(new Intent(this, SignUpActivity.class));
        }

        if(view == textViewForgotPassword){
            finish();
            startActivity(new Intent(this, ResetPasswordActivity.class));
        }
    }
}

以下是我的注册活动:

public class SignUpActivity extends AppCompatActivity implements View.OnClickListener {

    //defining view objects
    private EditText editTextEmail;
    private EditText editTextPassword;
    private EditText editTextPassword2;
    private Button buttonSignup;

    private TextView textViewSignin;
    private TextView textViewForgotPassword;

    private ProgressDialog progressDialog;


    //defining firebaseauth object
    private FirebaseAuth firebaseAuth;
    private android.support.v7.widget.Toolbar mActionBarToolbar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sign_up);

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            Window w = getWindow(); // in Activity's onCreate() for instance
            w.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
        }

        //initializing firebase auth object
        firebaseAuth = FirebaseAuth.getInstance();

        //if getCurrentUser does not returns null
        if(firebaseAuth.getCurrentUser() != null){
            //that means user is already logged in
            //so close this activity
            finish();

            //and open profile activity
            startActivity(new Intent(getApplicationContext(), ProfileActivity.class));
        }

        //initializing views
        editTextEmail = (EditText) findViewById(R.id.editTextEmail);
        editTextPassword = (EditText) findViewById(R.id.editTextPassword);
        editTextPassword2 = (EditText) findViewById(R.id.editTextPassword2);
        textViewSignin = (TextView) findViewById(R.id.textViewSignin);
        textViewForgotPassword = (TextView) findViewById(R.id.textViewForgotPassword);

        buttonSignup = (Button) findViewById(R.id.buttonSignup);

        progressDialog = new ProgressDialog(this);

        //attaching listener to button
        buttonSignup.setOnClickListener(this);
        textViewSignin.setOnClickListener(this);
        textViewForgotPassword.setOnClickListener(this);
    }

    private void registerUser(){

        //getting email and password from edit texts
        String email = editTextEmail.getText().toString().trim();
        String password  = editTextPassword.getText().toString().trim();
        String password2 = editTextPassword2.getText().toString().trim();

        //checking if email and passwords are empty
        if(TextUtils.isEmpty(email)){
            Toast.makeText(this,"Please enter email",Toast.LENGTH_LONG).show();
            return;
        }

        if(TextUtils.isEmpty(password)){
            Toast.makeText(this,"Please enter password",Toast.LENGTH_LONG).show();
            return;
        }

        if(password.equals(password2)){

        }else {
            Toast.makeText(this,"Passwords not the same",Toast.LENGTH_LONG).show();
            return;
        }

        //if the email and password are not empty
        //displaying a progress dialog

        progressDialog.setMessage("Registering Please Wait...");
        progressDialog.show();

        //creating a new user
        firebaseAuth.createUserWithEmailAndPassword(email, password)
                .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
                    @Override
                    public void onComplete(@NonNull Task<AuthResult> task) {
                        //checking if success
                        if(task.isSuccessful()){
                            finish();
                            startActivity(new Intent(getApplicationContext(), MainActivity.class));
                        }else{
                            //display some message here
                            Toast.makeText(SignUpActivity.this,"Registration Error",Toast.LENGTH_LONG).show();
                        }
                        progressDialog.dismiss();
                    }
                });

    }

    @Override
    public void onClick(View view) {

        if(view == buttonSignup){
            registerUser();
        }

        if(view == textViewSignin){
            //open login activity when user taps on the already registered textview
            startActivity(new Intent(this, LoginActivity.class));
        }

        if(view == textViewForgotPassword){
            finish();
            startActivity(new Intent(this, ResetPasswordActivity.class));
        }

    }
}

这是我的build / app / gradle:

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.nocrat.fanti"
        minSdkVersion 19
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        useLibrary 'org.apache.http.legacy'
        vectorDrawables.useSupportLibrary = true // This line here
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'

    }
    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'
    }

    configurations.all {
        resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
    }
}

repositories {
    mavenCentral()
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:support-v4:26.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    compile 'com.firebase:firebase-client-android:2.5.2'
    compile 'com.google.firebase:firebase-database:11.8.0'
    compile 'com.google.firebase:firebase-auth:11.8.0'
    compile 'com.google.firebase:firebase-core:11.8.0'
    compile 'com.google.firebase:firebase-firestore:11.8.0'
    compile 'com.android.support:recyclerview-v7:26.1.0'
    compile 'com.google.api-client:google-api-client:1.23.0'
    compile 'com.google.android.gms:play-services-location:11.8.0'
    compile 'com.google.android.gms:play-services-auth:11.8.0'
    compile 'com.android.support:cardview-v7:26.1.0'
    compile 'com.google.firebase:firebase-crash:11.8.0'
}

apply plugin: 'com.google.gms.google-services'

这是我的日志:

02/21 08:46:39: Launching app
$ adb install-multiple -r -t -p com.nocrat.fanti C:\xampp\htdocs\fanti\app\build\intermediates\split-apk\debug\slices\slice_8.apk 
Split APKs installed
$ adb shell am start -n "com.nocrat.fanti/com.nocrat.fanti.LoginActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D
Waiting for application to come online: com.nocrat.fanti | com.nocrat.fanti.test
Waiting for application to come online: com.nocrat.fanti | com.nocrat.fanti.test
Connecting to com.nocrat.fanti
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
W/ActivityThread: Application com.nocrat.fanti is waiting for the debugger on port 8100...
I/System.out: Sending WAIT chunk
I/zygote64: Debugger is active
Connected to the target VM, address: 'localhost:8602', transport: 'socket'
I/System.out: Debugger has connected
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/chatty: uid=10232(com.nocrat.fanti) identical 1 line
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: debugger has settled (1435)
I/MultiDex: VM with version 2.1.0 has multidex support
I/MultiDex: Installing application
I/MultiDex: VM has multidex support, MultiDex support library is disabled.
W/zygote64: Skipping duplicate class check due to unrecognized classloader
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
I/BiChannelGoogleApi: [FirebaseAuth: ] No Fallback module; NOT setting up for lazy initialization
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
I/FirebaseAuth: [FirebaseAuth:] Loading module via FirebaseOptions.
I/FirebaseAuth: [FirebaseAuth:] Preparing to create service connection to gms implementation
I/DynamiteModule: Considering local module com.google.android.gms.flags:2 and remote module com.google.android.gms.flags:0
I/DynamiteModule: Selected local version of com.google.android.gms.flags
W/DynamiteModule: Local module descriptor class for com.google.android.gms.crash not found.
I/DynamiteModule: Considering local module com.google.android.gms.crash:0 and remote module com.google.android.gms.crash:10
I/DynamiteModule: Selected remote version of com.google.android.gms.crash, version >= 10
W/zygote64: Skipping duplicate class check due to unrecognized classloader
I/FirebaseCrashApiImpl: FirebaseCrashApiImpl created by ClassLoader ae[DexPathList[[zip file "/data/user_de/0/com.google.android.gms/app_chimera/m/00000054/DynamiteModulesC_GmsCore_prodmnc_alldpi_release.apk"],nativeLibraryDirectories=[/data/user_de/0/com.google.android.gms/app_chimera/m/00000054/n/arm64-v8a, /system/lib64, /system/vendor/lib64]]]
I/FirebaseCrash: FirebaseCrash reporting loaded - com.google.android.gms.internal.zzdzk@791b6c3
V/FA: Cancelling job. JobID: 997157958
V/FA: Registered activity lifecycle callback
I/FirebaseInitProvider: FirebaseApp initialization successful
I/InstantRun: starting instant run server: is main process
V/Font: Change font:2
V/FA: Collection enabled
V/FA: App package, google app id: com.nocrat.fanti, 1:877219620776:android:1780dbf638eb2991
I/FA: App measurement is starting up, version: 11910
I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
I/FA: To enable faster debug mode event logging run:
        adb shell setprop debug.firebase.analytics.app com.nocrat.fanti
D/FA: Debug-level message logging enabled
I/DynamiteModule: Considering local module com.google.android.gms.flags:2 and remote module com.google.android.gms.flags:0
I/DynamiteModule: Selected local version of com.google.android.gms.flags
W/DynamiteModule: Local module descriptor class for com.google.android.gms.crash not found.
V/FA: Connecting to remote service
V/FA: Connection attempt already in progress
I/FirebaseCrashApiImpl: FirebaseCrash reporting API initialized
I/FirebaseCrash: FirebaseCrash reporting initialized com.google.android.gms.internal.zzdzk@791b6c3
D/FirebaseCrash: Firebase Analytics Listener for Firebase Crash is initialized
V/FA: onActivityCreated
V/FA: onActivityCreated
V/BoostFramework: mIOPStart method = public int com.qualcomm.qti.Performance.perfIOPrefetchStart(int,java.lang.String)
I/zygote64: Do partial code cache collection, code=28KB, data=29KB
I/zygote64: After code cache collection, code=28KB, data=29KB
I/zygote64: Increasing code cache capacity to 128KB
I/zygote64: Do partial code cache collection, code=37KB, data=59KB
I/zygote64: After code cache collection, code=37KB, data=59KB
I/zygote64: Increasing code cache capacity to 256KB
I/zygote64: Compiler allocated 8MB to compile void android.widget.TextView.<init>(android.content.Context, android.util.AttributeSet, int, int)
V/FA: Connection attempt already in progress
D/AppTracker: App Event: start
V/FA: Activity resumed, time: 511184460
I/FA: Tag Manager is not found and thus will not be used
D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=5493284681258470717}]
I/DynamiteModule: Considering local module com.google.android.gms.firebase_database:4 and remote module com.google.android.gms.firebase_database:6
I/DynamiteModule: Selected remote version of com.google.android.gms.firebase_database, version >= 6
D/OpenGLRenderer: HWUI GL Pipeline
V/FA: Connection attempt already in progress
D/FA: Connected to remote service
V/FA: Processing queued up service tasks: 4
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
E/test6: com.google.firebase.auth.internal.zzg@9c63d3f
I/zygote64: Do full code cache collection, code=91KB, data=82KB
I/zygote64: After code cache collection, code=84KB, data=59KB
E/Test6: https://fanti-82ec7.firebaseio.com/users/Dlwpcmzx0hPOeWxXqzhZWLStQ6g1/Projects
E/test5: what's happening
W/RenderThread: type=1400 audit(0.0:61288): avc: denied { search } for name="proc" dev="debugfs" ino=15082 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:qti_debugfs:s0 tclass=dir permissive=0
I/vndksupport: sphal namespace is not configured for this process. Loading /vendor/lib64/hw/gralloc.msm8996.so from the current namespace instead.
I/Adreno: PFP: 0x005ff087, ME: 0x005ff063
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Swap behavior 2
E/RecyclerView: No adapter attached; skipping layout
I/vndksupport: sphal namespace is not configured for this process. Loading /vendor/lib64/hw/gralloc.msm8996.so from the current namespace instead.

               [ 02-21 08:46:50.388   910: 1209 E/         ]
               Cannot load libgui-plugin
E/test4: what's happening
V/FA: Inactivity, disconnecting from the service
V/FA: Session started, time: 511194425
D/FA: Logging event (FE): session_start(_s), Bundle[{firebase_event_origin(_o)=auto, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=5493284681258470717}]
V/FA: Connecting to remote service
D/FA: Connected to remote service
V/FA: Processing queued up service tasks: 1
I/FirebaseCrash: Sending crashes
V/FA: Inactivity, disconnecting from the service
W/InputEventReceiver: Attempted to finish an input event but the input event receiver has already been disposed.
D/AppTracker: App Event: stop
V/FA: Recording user engagement, ms: 143299
V/FA: Connecting to remote service
V/FA: Activity paused, time: 511327757
D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=143299, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=5493284681258470717}]
V/FA: Connection attempt already in progress
D/FA: Connected to remote service
V/FA: Processing queued up service tasks: 2
V/FA: Inactivity, disconnecting from the service
I/FirebaseAuth: [FirebaseAuth:] Loading module via FirebaseOptions.
I/FirebaseAuth: [FirebaseAuth:] Preparing to create service connection to gms implementation
Disconnected from the target VM, address: 'localhost:8602', transport: 'socket'

2 个答案:

答案 0 :(得分:1)

您收到以下错误:

Local module descriptor class for com.google.android.gms.crash not found

由于您使用应用的设备没有最新版本的Google Play Services

要解决此问题,请将Google Play Services更新为最新版本,您的问题将得到解决。

答案 1 :(得分:0)

我遇到了同样的问题,我从类别中获取图像,但是当我将图像添加到类别错误中时,只有一个类别并且内部没有图像。