每次启动应用程序时FirebaseRecyclerAdapter崩溃

时间:2019-02-04 13:46:13

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

嗨,我正在尝试向我的应用添加FirebaseRecyclerAdapter,以便用户可以滚动浏览新闻源并查看最近的帖子。图像和信息存储在Firebase中,然后从用户处检索,但应用程序不断崩溃,logcat中没有错误,并且使用哈希表在Firebase数据库中未显示日期,时间和描述,这可能是问题的原因?

请帮助。

张贴课程:

public class post {
    public String Uid,time,date,postimage,fullname,description,profileimage;

    public post(){

    }



    public post(String uid, String time, String date, String postimage, String fullname, String description, String profileimage) {
        Uid = uid;
        this.time = time;
        this.date = date;
        this.postimage = postimage;
        this.fullname = fullname;
        this.description = description;
        this.profileimage = profileimage;
    }

    public String getUid() {
        return Uid;
    }

    public void setUid(String uid) {
        Uid = uid;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getPostimage() {
        return postimage;
    }

    public void setPostimage(String postimage) {
        this.postimage = postimage;
    }

    public String getFullname() {
        return fullname;
    }

    public void setFullname(String fullname) {
        this.fullname = fullname;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getProfileimage() {
        return profileimage;
    }

    public void setProfileimage(String profileimage) {
        this.profileimage = profileimage;
    }
}

发布活动:

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

        add_post_image= findViewById(R.id.post);
        description =findViewById(R.id.image_description);
        upload=findViewById(R.id.upload_button);
        postReference =FirebaseStorage.getInstance().getReference();
        userRef = FirebaseDatabase.getInstance().getReference().child("Users");
        postref = FirebaseDatabase.getInstance().getReference().child("post");
        mAuth = FirebaseAuth.getInstance();
        loadingbar = new ProgressDialog(this);
        current_user_id = mAuth.getCurrentUser().getUid();

        mToolbar=findViewById(R.id.post_action_bar);
        setSupportActionBar(mToolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setDisplayShowHomeEnabled(true);
        getSupportActionBar().setTitle("Update Post");

        add_post_image.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                sendusertogallery();
            }
        });
        upload.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                validateuserinformation();
            }
        });

    }

    private void validateuserinformation() {
        String Description = description.getText().toString();
        if (imageuri==null){
            Toast.makeText(PostActivity.this,"please select image/video that u wish to post...",Toast.LENGTH_LONG).show();
        }
        else if (TextUtils.isEmpty(Description)){
            Toast.makeText(PostActivity.this,"please add description for your image/video",Toast.LENGTH_LONG).show();

        }
        else {

            loadingbar.setTitle("adding new post");
            loadingbar.setMessage("please wait ....");
            loadingbar.show();
            loadingbar.setCanceledOnTouchOutside(true);
            Storingmediatofirebasestorage();
        }
    }

    private void Storingmediatofirebasestorage() {
        Calendar callforddate = Calendar.getInstance();
        SimpleDateFormat currentdate =new SimpleDateFormat("dd-MMMM-yyyy");
        savecurrentdate= currentdate.format(callforddate.getTime());

        Calendar calFordTime = Calendar.getInstance();
        SimpleDateFormat currentTime = new SimpleDateFormat("HH:mm");
        savecurrenttime = currentTime.format(callforddate.getTime());

        postrandomname =savecurrentdate + savecurrenttime;

        StorageReference filepath = postReference.child("post image").child(imageuri.getLastPathSegment()+postrandomname + ".jpg");

        filepath.putFile(imageuri).addOnCompleteListener(new OnCompleteListener<UploadTask.TaskSnapshot>() {
            @Override
            public void onComplete(@NonNull Task<UploadTask.TaskSnapshot> task) {
                if (task.isSuccessful()){
                    Toast.makeText(PostActivity.this,"image uploaded successfully to storage",Toast.LENGTH_SHORT).show();
                    Task<Uri> result = task.getResult().getMetadata().getReference().getDownloadUrl();

                    result.addOnSuccessListener(new OnSuccessListener<Uri>() {
                        @Override
                        public void onSuccess(Uri uri) {
                            final String downloadUrl = uri.toString();

                            userRef.child(current_user_id).addValueEventListener(new ValueEventListener() {
                                @Override
                                public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
                                    String userfullname =dataSnapshot.child("fullname").getValue().toString();
                                    String userprofileimages = dataSnapshot.child("profileimage").getValue().toString();

                                    HashMap postsMap = new HashMap();
                                    postsMap.put("uid", current_user_id);
                                    postsMap.put("date", savecurrentdate);
                                    postsMap.put("time", savecurrenttime);
                                    postsMap.put("description", Description);
                                    postsMap.put("postimage", downloadUrl);
                                    postsMap.put("profileimage", userprofileimages);
                                    postsMap.put("fullname",userfullname);
                                    postref.child(current_user_id + postrandomname).updateChildren(postsMap)
                                            .addOnCompleteListener(new OnCompleteListener() {
                                                @Override
                                                public void onComplete(@NonNull Task task) {
                                                    if (task.isSuccessful()){
                                                        SENDUSERTOMAINACTIVITY();
                                                        Toast.makeText(PostActivity.this,"new post is updated successfully",Toast.LENGTH_SHORT).show();
                                                        loadingbar.dismiss();
                                                    }
                                                    else {
                                                        String message = task.getException().getMessage();
                                                        Toast.makeText(PostActivity.this,"Error! "+message,Toast.LENGTH_SHORT).show();
                                                        loadingbar.dismiss();
                                                    }

                                                }
                                            });



                                }

                                @Override
                                public void onCancelled(@NonNull DatabaseError databaseError) {

                                }
                            });



                        }
                    });


                }
            }
        });

    }

    private void sendusertogallery() {
        Intent galleryIntent = new Intent();
        galleryIntent.setAction(Intent.ACTION_GET_CONTENT);
        galleryIntent.setType("image/*");
        startActivityForResult(galleryIntent, GALLARY_PICK);

    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {

        super.onActivityResult(requestCode, resultCode, data);

        if (requestCode==GALLARY_PICK && resultCode==RESULT_OK && data!= null){
            imageuri = data.getData();
            add_post_image.setImageURI(imageuri);

        }
    }


    @Override
    public boolean onOptionsItemSelected(MenuItem item) {

        int id = item.getItemId();
        if (id == android.R.id.home){
            SENDUSERTOMAINACTIVITY();
        }
        return super.onOptionsItemSelected(item);
    }

    private void SENDUSERTOMAINACTIVITY() {
        Intent mainactivityintent = new Intent(PostActivity.this,MainActivity.class);
        startActivity(mainactivityintent);
    }
}

主要活动:

 private void DisplayAllUsersPosts() {
            FirebaseRecyclerOptions<post> options=
                    new FirebaseRecyclerOptions.Builder<post>()
                    .setQuery(postreference,post.class)
                    .build();

        FirebaseRecyclerAdapter<post,postholder> adapter
                = new FirebaseRecyclerAdapter<post, postholder>(options) {
            @Override
            protected void onBindViewHolder(@NonNull postholder holder, int position, @NonNull post model) {
                holder.username1.setText(model.getFullname());
                holder.date1.setText(model.getDate());
                holder.time1.setText(model.getTime());
                holder.postdescription.setText(model.getDescription());
                Picasso.get().load(model.getPostimage()).into(holder.postted_image);
                Picasso.get().load(model.getProfileimage()).into(holder.post_profilepicture);

            }

            @NonNull
            @Override
            public postholder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
                View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.all_post_layout,parent, false);
                postholder viewholder = new postholder(view);
                return viewholder;
            }
        };
        postlist.setAdapter(adapter);
        adapter.startListening();

    }


    public static class postholder extends RecyclerView.ViewHolder {
        TextView username1, date1, time1, postdescription;
        CircleImageView post_profilepicture;
        ImageView postted_image;




        View mView;
        public postholder(@NonNull View itemView) {


            super(itemView);
            mView=itemView;

            username1 = itemView.findViewById(R.id.post_user_name);
            date1 = itemView.findViewById(R.id.date);
            time1 = itemView.findViewById(R.id.time);
            postdescription = itemView.findViewById(R.id.post_description);
           post_profilepicture = itemView.findViewById(R.id.user_post_image);
            postted_image = itemView.findViewById(R.id.post_view);


        }
    }

stacktrace:

02/04 10:21:16: Launching app
$ adb install-multiple -r -t C:\PROJECTS\BFit\app\build\intermediates\split-apk\debug\slices\slice_2.apk C:\PROJECTS\BFit\app\build\intermediates\split-apk\debug\slices\slice_6.apk C:\PROJECTS\BFit\app\build\intermediates\split-apk\debug\slices\slice_0.apk C:\PROJECTS\BFit\app\build\intermediates\split-apk\debug\slices\slice_1.apk C:\PROJECTS\BFit\app\build\intermediates\split-apk\debug\slices\slice_8.apk C:\PROJECTS\BFit\app\build\intermediates\split-apk\debug\slices\slice_7.apk C:\PROJECTS\BFit\app\build\intermediates\split-apk\debug\slices\slice_4.apk C:\PROJECTS\BFit\app\build\intermediates\split-apk\debug\slices\slice_5.apk C:\PROJECTS\BFit\app\build\intermediates\split-apk\debug\slices\slice_9.apk C:\PROJECTS\BFit\app\build\intermediates\split-apk\debug\slices\slice_3.apk C:\PROJECTS\BFit\app\build\intermediates\split-apk\debug\dep\dependencies.apk C:\PROJECTS\BFit\app\build\intermediates\instant-run-apk\debug\app-debug.apk 
Split APKs installed in 12 s 574 ms
$ adb shell am start -n "aj_studio.bfit/aj_studio.bfit.Login" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet..Connected to process 27880 on device samsung-sm_g925i-05157df5484e863d
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
W/System: ClassLoader referenced unknown path: /data/app/aj_studio.bfit-2/lib/arm64
V/FA: Registered activity lifecycle callback
D/FirebaseAuth: Notifying id token listeners about user ( 94pYST3YcGegYCjnOpQ9DTYDtDs1 ).
D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
I/FirebaseInitProvider: FirebaseApp initialization successful
V/FA: Collection enabled
    App package, google app id: aj_studio.bfit, 1:1041467221265:android:c6621db46ea28f6a
I/InstantRun: starting instant run server: is main process
I/FA: App measurement is starting up, version: 14710
    To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
    To enable faster debug mode event logging run:
      adb shell setprop debug.firebase.analytics.app aj_studio.bfit
D/FA: Debug-level message logging enabled
V/InstantRun: Starting server socket listening for package aj_studio.bfit on android.net.LocalSocketAddress@defa118
V/InstantRun: Started server for package aj_studio.bfit
V/FA: Connecting to remote service
V/FA: Connection attempt already in progress
W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
V/FA: onActivityCreated
I/art: Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$OnUnhandledKeyEventListenerWrapper>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener;
        at void androidx.core.view.ViewCompat.setOnApplyWindowInsetsListener(android.view.View, androidx.core.view.OnApplyWindowInsetsListener) (ViewCompat.java:2203)
        at android.view.ViewGroup androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:637)
        at void androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:518)
        at void androidx.appcompat.app.AppCompatDelegateImpl.setContentView(int) (AppCompatDelegateImpl.java:466)
        at void androidx.appcompat.app.AppCompatActivity.setContentView(int) (AppCompatActivity.java:140)
        at void aj_studio.bfit.Login.onCreate(android.os.Bundle) (Login.java:33)
        at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:6942)
        at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1126)
        at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2880)
        at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2988)
        at void android.app.ActivityThread.-wrap14(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
        at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1631)
        at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102)
        at void android.os.Looper.loop() (Looper.java:154)
        at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6682)
        at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2)
        at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:1520)
        at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:1410)
    Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/aj_studio.bfit-2/base.apk", zip file "/data/app/aj_studio.bfit-2/split_lib_dependencies_apk.apk", zip file "/data/app/aj_studio.bfit-2/split_lib_slice_0_apk.apk", zip file "/data/app/aj_studio.bfit-2/split_lib_slice_1_apk.apk", zip file "/data/app/aj_studio.bfit-2/split_lib_slice_2_apk.apk", zip file "/data/app/aj_studio.bfit-2/split_lib_slice_3_apk.apk", zip file "/data/app/aj_studio.bfit-2/split_lib_slice_4_apk.apk", zip file "/data/app/aj_studio.bfit-2/split_lib_slice_5_apk.apk", zip file "/data/app/aj_studio.bfit-2/split_lib_slice_6_apk.apk", zip file "/data/app/aj_studio.bfit-2/split_lib_slice_7_apk.apk", zip file "/data/app/aj_studio.bfit-2/split_lib_slice_8_apk.apk", zip file "/data/app/aj_studio.bfit-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/aj_studio.bfit-2/lib/arm64, /system/lib64, /vendor/lib64]]
        at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56)
        at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:380)
        at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
        at void androidx.core.view.ViewCompat.setOnApplyWindowInsetsListener(android.view.View, androidx.core.view.OnApplyWindowInsetsListener) (ViewCompat.java:2203)
        at android.view.ViewGroup androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:637)
        at void androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:518)
        at void androidx.appcompat.app.AppCompatDelegateImpl.setContentView(int) (AppCompatDelegateImpl.java:466)
        at void androidx.appcompat.app.AppCompatActivity.setContentView(int) (AppCompatActivity.java:140)
        at void aj_studio.bfit.Login.onCreate(android.os.Bundle) (Login.java:33)
        at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:6942)
        at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1126)
        at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2880)
        at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2988)
        at void android.app.ActivityThread.-wrap14(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
        at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1631)
        at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102)
        at void android.os.Looper.loop() (Looper.java:154)
        at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6682)
        at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2)
        at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:1520)
        at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:1410)
W/art: Suspending all threads took: 8.242ms
I/art: Background partial concurrent mark sweep GC freed 459(24KB) AllocSpace objects, 0(0B) LOS objects, 40% free, 19MB/33MB, paused 9.153ms total 34.289ms
D/TextView: setTypeface with style : 0
D/FirebaseApp: Notifying auth state listeners.
D/FirebaseApp: Notified 0 auth state listeners.
V/FA: onActivityCreated
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.flags.IFlagProvider$Stub>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/stable/zzb;
        at void com.google.android.gms.flags.Singletons.<init>() ((null):-1)
        at void com.google.android.gms.flags.Singletons.<clinit>() ((null):-1)
        at com.google.android.gms.flags.FlagRegistry com.google.android.gms.flags.Singletons.flagRegistry() ((null):-1)
        at void com.google.android.gms.flags.Flag.<init>(int, java.lang.String, java.lang.Object) ((null):-1)
        at void com.google.android.gms.flags.Flag.<init>(int, java.lang.String, java.lang.Object, com.google.android.gms.flags.zza) ((null):-1)
        at void com.google.android.gms.flags.Flag$BooleanFlag.<init>(int, java.lang.String, java.lang.Boolean) ((null):-1)
        at com.google.android.gms.flags.Flag$BooleanFlag com.google.android.gms.flags.Flag.define(int, java.lang.String, java.lang.Boolean) ((null):-1)
        at void com.google.firebase.auth.internal.zzx.<clinit>() ((null):-1)
        at void com.google.firebase.auth.internal.zzx.initialize(android.content.Context) ((null):-1)
        at void com.google.firebase.auth.internal.zzt.run() ((null):-1)
        at void android.os.Handler.handleCallback(android.os.Message) (Handler.java:751)
        at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:95)
        at void android.os.Looper.loop() (Looper.java:154)
        at void android.os.HandlerThread.run() (HandlerThread.java:61)
    Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.internal.stable.zzb" on path: DexPathList[[zip file "/data/app/aj_studio.bfit-2/base.apk", zip file "/data/app/aj_studio.bfit-2/split_lib_dependencies_apk.apk", zip file "/data/app/aj_studio.bfit-2/split_lib_slice_0_apk.apk", zip file "/data/app/aj_studio.bfit-2/split_lib_slice_1_apk.apk", zip file "/data/app/aj_studio.bfit-2/split_lib_slice_2_apk.apk", zip file "/data/app/aj_studio.bfit-2/split_lib_slice_3_apk.apk", zip file "/data/app/aj_studio.bfit-2/split_lib_slice_4_apk.apk", zip file "/data/app/aj_studio.bfit-2/split_lib_slice_5_apk.apk", zip file "/data/app/aj_studio.bfit-2/split_lib_slice_6_apk.apk", zip file "/data/app/aj_studio.bfit-2/split_lib_slice_7_apk.apk", zip file "/data/app/aj_studio.bfit-2/split_lib_slice_8_apk.apk", zip file "/data/app/aj_studio.bfit-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/aj_studio.bfit-2/lib/arm64, /system/lib64, /vendor/lib64]]
        at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56)
        at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:380)
        at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
        at void com.google.android.gms.flags.Singletons.<init>() ((null):-1)
        at void com.google.android.gms.flags.Singletons.<clinit>() ((null):-1)
        at com.google.android.gms.flags.FlagRegistry com.google.android.gms.flags.Singletons.flagRegistry() ((null):-1)
        at void com.google.android.gms.flags.Flag.<init>(int, java.lang.String, java.lang.Object) ((null):-1)
        at void com.google.android.gms.flags.Flag.<init>(int, java.lang.String, java.lang.Object, com.google.android.gms.flags.zza) ((null):-1)
        at void com.google.android.gms.flags.Flag$BooleanFlag.<init>(int, java.lang.String, java.lang.Boolean) ((null):-1)
        at com.google.android.gms.flags.Flag$BooleanFlag com.google.android.gms.flags.Flag.define(int, java.lang.String, java.lang.Boolean) ((null):-1)
        at void com.google.firebase.auth.internal.zzx.<clinit>() ((null):-1)
        at void com.google.firebase.auth.internal.zzx.initialize(android.content.Context) ((null):-1)
        at void com.google.firebase.auth.internal.zzt.run() ((null):-1)
        at void android.os.Handler.handleCallback(android.os.Message) (Handler.java:751)
        at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:95)
        at void android.os.Looper.loop() (Looper.java:154)
        at void android.os.HandlerThread.run() (HandlerThread.java:61)
E/AndroidRuntime: FATAL EXCEPTION: TokenRefresher
    Process: aj_studio.bfit, PID: 27880
    java.lang.NoSuchFieldError: No field PREFER_HIGHEST_OR_REMOTE_VERSION_NO_FORCE_STAGING of type Lcom/google/android/gms/dynamite/DynamiteModule$VersionPolicy; in class Lcom/google/android/gms/dynamite/DynamiteModule; or its superclasses (declaration of 'com.google.android.gms.dynamite.DynamiteModule' appears in /data/app/aj_studio.bfit-2/split_lib_dependencies_apk.apk)
        at com.google.android.gms.flags.FlagValueProvider.initialize(Unknown Source)
        at com.google.android.gms.flags.FlagRegistry.initialize(Unknown Source)
        at com.google.firebase.auth.internal.zzx.initialize(Unknown Source)
        at com.google.firebase.auth.internal.zzt.run(Unknown Source)
        at android.os.Handler.handleCallback(Handler.java:751)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:154)
        at android.os.HandlerThread.run(HandlerThread.java:61)
D/TextView: setTypeface with style : 0
D/TextView: setTypeface with style : 0
W/ActionBarDrawerToggle: DrawerToggle may not show up because NavigationIcon is not visible. You may need to call actionbar.setDisplayHomeAsUpEnabled(true);
I/Process: Sending signal. PID: 27880 SIG: 9
Application terminated.

2 个答案:

答案 0 :(得分:1)

我认为矢量可绘制会发生此问题。 在应用程序级别gradle文件中使用vector drawable true。

build.gradle(模块:应用)

android {
    defaultConfig{
        vectorDrawables.useSupportLibrary = true
    }
}

答案 1 :(得分:1)

您遇到以下错误:

  

“ com.google.firebase.database.DatabaseException:找到两个具有属性区分大小写的吸气剂或字段:uid”

因为在您的post.class中,您拥有Uid属性,该属性以大写字母开头。 post 在我的回答中提到了解决问题的方法。