我是Android开发人员,我在我的应用中使用了Firebase数据库。 我用app_debug.apk运行应用程序它工作正常,但app_release.apk没有,它无法加载Firebase数据库。 我检查了日志文件,我得到了这个:
No setter/field for xxx found on class
[ex: xxx is a field in Post model]
我之前检查过这篇文章:No setter/field for xxx found on class link和release apk doesn't load data link ,但他们没有帮助我。 这是我的模特课:
abstract public class BaseModel {
public String userPhotoUrl= "";
public String contentPhotoUrl = "";
public BaseModel(){}
public BaseModel(String userPhotoUrl, String contentPhotoUrl) {
this.userPhotoUrl = userPhotoUrl;
this.contentPhotoUrl = contentPhotoUrl;
}
public String getUserPhotoUrl() {
return userPhotoUrl;
}
public void setUserPhotoUrl(String userPhotoUrl) {
this.userPhotoUrl = userPhotoUrl;
}
public String getContentPhotoUrl() {
return contentPhotoUrl;
}
public void setContentPhotoUrl(String contentPhotoUrl) {
this.contentPhotoUrl = contentPhotoUrl;
}
}
和
public class Post extends BaseModel{
protected String id ="";
protected String userId ="";
protected String userName = "";
protected String content = "";
protected int likeCount = 0;
protected int commentCount = 0;
protected long dataInverse = 0L; /*Use to sort data base publish experience*/
protected long sharedDate = 0L; /*TimeStamp in minisecond - The date expert shared.*/
protected String sharedSourceFrom = ""; /*From facebook or app*/
protected String facebookPostUrl = "";
public Post(){}
public Post(String id, String userId, String userName, String userPhotoUrl, String content, String contentPhotoUrl, int likeCount, int commentCount, long sharedDate, String sharedSourceFrom) {
super(userPhotoUrl, contentPhotoUrl);
this.id = id;
this.userId = userId;
this.userName = userName;
this.userPhotoUrl = userPhotoUrl;
this.content = content;
this.contentPhotoUrl = contentPhotoUrl;
this.likeCount = likeCount;
this.commentCount = commentCount;
this.dataInverse = 0 - sharedDate;
this.sharedDate = sharedDate;
this.sharedSourceFrom = sharedSourceFrom;
this.facebookPostUrl = "";
}
public String getUserPhotoUrl() {
return userPhotoUrl;
}
public void setUserPhotoUrl(String userPhotoUrl) {
this.userPhotoUrl = userPhotoUrl;
}
public String getContentPhotoUrl() {
return contentPhotoUrl;
}
public void setContentPhotoUrl(String contentPhotoUrl) {
this.contentPhotoUrl = contentPhotoUrl;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public int getLikeCount() {
return likeCount;
}
public void setLikeCount(int likeCount) {
this.likeCount = likeCount;
}
public int getCommentCount() {
return commentCount;
}
public void setCommentCount(int commentCount) {
this.commentCount = commentCount;
}
public long getDataInverse() {
return dataInverse;
}
public void setDataInverse(long dataInverse) {
this.dataInverse = dataInverse;
}
public long getSharedDate() {
return sharedDate;
}
public void setSharedDate(long sharedDate) {
this.sharedDate = sharedDate;
}
public String getSharedSourceFrom() {
return sharedSourceFrom;
}
public void setSharedSourceFrom(String sharedSourceFrom) {
this.sharedSourceFrom = sharedSourceFrom;
}
public String getFacebookPostUrl() {
return facebookPostUrl;
}
public void setFacebookPostUrl(String facebookPostUrl) {
this.facebookPostUrl = facebookPostUrl;
}
}
中的datasnapshoot您有什么建议可以解决这个问题吗?