Firestore应用程式可在侦错中运作,但签名的APK却报错 [英] Firestore app works in debug but signed apk gives error

查看:51
本文介绍了Firestore应用程式可在侦错中运作,但签名的APK却报错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经用firestore创建了完整的应用程序,在调试apk时一切正常,但是当我创建用于发布的签名apk时,它给了我一个奇怪的错误.

I have created complete app with firestore everythings works fine in debug apk but when i create signed apk for publishing it gives me strange error.

使用签名的APK登录时,它会显示蓝线

While login with signed apk it gives blue lines of

 W/Firestore: (0.6.6-dev) [aei]: No setter/field for updated_at found on class com.binrafiq.reborn.mvp.data.db.model.j
 W/Firestore: (0.6.6-dev) [aei]: No setter/field for token found on class com.binrafiq.reborn.mvp.data.db.model.j
 W/Firestore: (0.6.6-dev) [aei]: No setter/field for image found on class com.binrafiq.reborn.mvp.data.db.model.j
 W/Firestore: (0.6.6-dev) [aei]: No setter/field for phone found on class com.binrafiq.reborn.mvp.data.db.model.j

和带有此错误的红线.

E/UncaughtException: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
                                                          at com.binrafiq.reborn.mvp.ui.login.d$3.a(Unknown Source)
                                                          at com.google.android.gms.tasks.l.run(Unknown Source)
                                                          at android.os.Handler.handleCallback(Handler.java:739)
                                                          at android.os.Handler.dispatchMessage(Handler.java:95)
                                                          at android.os.Looper.loop(Looper.java:148)
                                                          at android.app.ActivityThread.main(ActivityThread.java:5461)
                                                          at java.lang.reflect.Method.invoke(Native Method)
                                                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

我的用户模型是

public class User {

     public Long id;

     public String user_id;

     public String account_type;

     public String image;

     public String password;

     public String gender;

     public String device_id;


     public String name;

     public String address;

     public String type;

     public String country;

     public String age;


    public String occupation;


    public String hobbies;


    public String dreams;


    public String mobile;


    public String email;


    @ServerTimestamp
    public Date  created_at;

    @ServerTimestamp
    public Date  updated_at;





    public long profile_views;


    public double total_followers,total_following,total_images,total_videos,total_stories;


public User(Long id, String user_id, String account_type, String image, String password, String gender, String device_id, String name, String address, String type, String country, String age, String occupation, String hobbies, String dreams, String mobile,
        String email, Date created_at, Date updated_at, long profile_views, double total_followers, double total_following, double total_images, double total_videos, double total_stories) {
    this.id = id;
    this.user_id = user_id;
    this.account_type = account_type;
    this.image = image;
    this.password = password;
    this.gender = gender;
    this.device_id = device_id;
    this.name = name;
    this.address = address;
    this.type = type;
    this.country = country;
    this.age = age;
    this.occupation = occupation;
    this.hobbies = hobbies;
    this.dreams = dreams;
    this.mobile = mobile;
    this.email = email;
    this.created_at = created_at;
    this.updated_at = updated_at;
    this.profile_views = profile_views;
    this.total_followers = total_followers;
    this.total_following = total_following;
    this.total_images = total_images;
    this.total_videos = total_videos;
    this.total_stories = total_stories;
}



    public User() {
    }


    public User(long l, String currentUserId, String accountType, String currentUserEmail, String currentUserProfilePicUrl,  String currentUserGender, String currentUserDeviceToken, String currentUserName, String currentUserType, long currentUserProfileViews) {
        this.user_id = currentUserId;
        this.account_type = accountType;
        this.image = currentUserProfilePicUrl;

        this.gender = currentUserGender;
        this.device_id = currentUserDeviceToken;
        this.name = currentUserName;
        this.type = currentUserType;
        this.email = currentUserEmail;
        this.profile_views = currentUserProfileViews;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getCountry() {
        return country;
    }


    public void setCountry(String country) {
        this.country = country;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public String getOccupation() {
        return occupation;
    }

    public void setOccupation(String occupation) {
        this.occupation = occupation;
    }

    public String getHobbies() {
        return hobbies;
    }

    public void setHobbies(String hobbies) {
        this.hobbies = hobbies;
    }

    public String getDreams() {
        return dreams;
    }

    public void setDreams(String dreams) {
        this.dreams = dreams;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public Date getCreated_at() {
        return created_at;
    }

    public void setCreated_at(Date created_at) {
        this.created_at = created_at;
    }

    public Date getUpdated_at() {
        return updated_at;
    }

    public void setUpdated_at(Date updated_at) {
        this.updated_at = updated_at;
    }



    public String getUser_id() {
        return this.user_id;
    }



    public void setUser_id(String user_id) {
        this.user_id = user_id;
    }



    public String getAccount_type() {
        return this.account_type;
    }



    public void setAccount_type(String account_type) {
        this.account_type = account_type;
    }



    public String getDevice_id() {
        return this.device_id;
    }



    public void setDevice_id(String device_id) {
        this.device_id = device_id;
    }



    public long getProfile_views() {
        return this.profile_views;
    }



    public void setProfile_views(long profile_views) {
        this.profile_views = profile_views;
    }



    public double getTotal_followers() {
        return this.total_followers;
    }



    public void setTotal_followers(double total_followers) {
        this.total_followers = total_followers;
    }



    public double getTotal_following() {
        return this.total_following;
    }



    public void setTotal_following(double total_following) {
        this.total_following = total_following;
    }



    public double getTotal_images() {
        return this.total_images;
    }



    public void setTotal_images(double total_images) {
        this.total_images = total_images;
    }



    public double getTotal_videos() {
        return this.total_videos;
    }



    public void setTotal_videos(double total_videos) {
        this.total_videos = total_videos;
    }



    public double getTotal_stories() {
        return this.total_stories;
    }



    public void setTotal_stories(double total_stories) {
        this.total_stories = total_stories;
    }
}

我已经通过更改命名约定等方法在stackoverflow上尝试了很多答案,但没有任何解决方案能解决我的问题.

I have tried lot of answers on stackoverflow by changing naming convention etc but nothing solved my problem.

推荐答案

您的proguard设置似乎无法识别您的模型类.我会按照规则避免混淆:

It looks like your proguard setup doesn't let your model classes be recognized. I'd keep them out of obfuscation with a rule:

-keep class com.binrafiq.reborn.mvp.data.db.model.** { *; }

这篇关于Firestore应用程式可在侦错中运作,但签名的APK却报错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆