When testing my apps before releasing to play store. My apps were able to fetch data from firestore to recycle view.
in the second image, before and upload the file, apps can read data from firestore, but can not fetch it into recycle view Here is the code of the problem:
package com.hmatewu.ewulife;
import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.paging.PagedList;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;``
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import com.firebase.ui.firestore.paging.FirestorePagingAdapter;
import com.firebase.ui.firestore.paging.FirestorePagingOptions;
import com.firebase.ui.firestore.paging.LoadingState;
import com.google.firebase.firestore.FirebaseFirestore;
import com.google.firebase.firestore.Query;
import java.util.ArrayList;
import java.util.List;
public class FeedFragment extends Fragment {
public FirebaseFirestore fstore;
public RecyclerView recyclerView;
public ArrayList<String> arrayList_parent;
public ArrayAdapter<String> arrayAdapter_parent;
public static final String EXTRA_NFID= "com.hm.roktojoddha.EXTRA_NFID";
public static final String EXTRA_MOBILE= "com.hm.roktojoddha.EXTRA_MOBILE";
public static final String EXTRA_ID= "com.hm.roktojoddha.EXTRA_ID";
List<String> cgpa_list = new ArrayList<>();
public Query query;
FirestorePagingAdapter adapter;
public FeedFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View v = inflater.inflate(R.layout.fragment_feed, container, false);
fstore=FirebaseFirestore.getInstance();
recyclerView= v.findViewById(R.id.rev_view);
arrayList_parent = new ArrayList<>();
query = fstore.collection("News_Feed");
PagedList.Config config = new PagedList.Config.Builder()
.setInitialLoadSizeHint(5).setPageSize(3).build();
FirestorePagingOptions< newsadapter > options = new FirestorePagingOptions.Builder<newsadapter>()
.setLifecycleOwner(getActivity())
.setQuery(query, config,newsadapter.class).build();
adapter = new FirestorePagingAdapter<newsadapter, ProductViewHolder>(options) {
@NonNull
@Override
public ProductViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.news_recycle, parent, false);
return new ProductViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull ProductViewHolder holder, int positions, @NonNull final newsadapter newsadapter) {
holder.a1.setText(newsadapter.getTitle());
holder.a2.setText(newsadapter.getDescription());
holder.b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String n_fid= newsadapter.getNFID();
String category = newsadapter.getCategory();
String mobile = newsadapter.getMobile();
String id = newsadapter.getUpload_User_ID();
if(category.equals("Blood")){
Intent intent = new Intent(getActivity(), BloodInfoActivity.class);
intent.putExtra(EXTRA_NFID, n_fid);
intent.putExtra(EXTRA_MOBILE, mobile);
intent.putExtra(EXTRA_ID, id);
startActivity(intent);
}
if(category.equals("Add")){
Intent intent = new Intent(getActivity(), AddDropActivity.class);
startActivity(intent);
}
if(category.equals("Calender")){
Intent intent = new Intent(getActivity(), CalenderActivity.class);
startActivity(intent);
}
if(category.equals("Advising")){
Intent intent = new Intent(getActivity(), AdvisingActivity.class);
startActivity(intent);
}
if(category.equals("Course")){
Intent intent = new Intent(getActivity(), Course_ChartActivity.class);
startActivity(intent);
}
if(category.equals("Club")){
Intent intent = new Intent(getActivity(), ClubInfoActivity.class);
intent.putExtra(EXTRA_NFID, n_fid);
intent.putExtra(EXTRA_ID, id);
startActivity(intent);
}
if(category.equals("Others")){
Toast.makeText(getActivity(), "Just a Notice", Toast.LENGTH_SHORT).show();
}
}
});
}
@Override
public void onLoadingStateChanged(@NonNull LoadingState state) {
super.onLoadingStateChanged(state);
switch (state){
case LOADING_INITIAL:Toast.makeText(getActivity(), "Loading Initial Data", Toast.LENGTH_SHORT).show();
break;
case LOADING_MORE:Toast.makeText(getActivity(), "Loading Next Page", Toast.LENGTH_SHORT).show();
break;
case FINISHED: Toast.makeText(getActivity(), "Finished", Toast.LENGTH_SHORT).show();
break;
case ERROR: Toast.makeText(getActivity(), "ERROR", Toast.LENGTH_SHORT).show();
break;
case LOADED: Toast.makeText(getActivity(), "Loaded", Toast.LENGTH_SHORT).show();
break;
}
}
};
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
recyclerView.setAdapter(adapter);
return v;
}
public class ProductViewHolder extends RecyclerView.ViewHolder {
TextView a1,a2;
Button b1;
public ProductViewHolder(@NonNull View itemView) {
super(itemView);
a1 = itemView.findViewById(R.id.textView67);
a2 = itemView.findViewById(R.id.textView68);
b1 = itemView.findViewById(R.id.button9);
}
}
// @Override
// public void onStart() {
// super.onStart();
// adapter.startListening();
// }
// @Override
// public void onStop() {
// super.onStop();
// adapter.stopListening();
//}
}
So this my code for that activity file but same problem is seeing in other 2 activity. so can not able to catch the problem here is the link of my apps in playstore also
Here is the LogCat:
2021-04-06 10:13:46.403 919-919/? E/OIFACE_HAL: open /proc/shell-temp failed(No such file or directory)
2021-04-06 10:13:46.705 1729-2816/? E/InputReader: isBtnTouch is true need to clear slots
2021-04-06 10:13:46.725 1289-1425/? E/statsd: Found dropped events: 1 error -19 last atom tag 83 from uid 10387
2021-04-06 10:13:47.286 32325-32325/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.hmatewu.ewulife, PID: 32325
java.lang.RuntimeException: No properties to serialize found on class e.f.a.o1
at e.e.d.x.o0.k$a.<init>(:21)
at e.e.d.x.o0.k.g(Unknown Source:12)
at e.e.d.x.o0.k.c(:18)
at e.e.d.x.h.f(:2)
at e.e.d.x.z.f(Unknown Source:5)
at e.e.d.x.z.e(:1)
at e.d.a.d.b.a(:1)
at com.firebase.ui.firestore.paging.FirestorePagingAdapter.o(Unknown Source:8)
at androidx.recyclerview.widget.RecyclerView$e.p(Unknown Source:0)
at androidx.recyclerview.widget.RecyclerView$s.j(:83)
at androidx.recyclerview.widget.LinearLayoutManager$c.c(:3)
at androidx.recyclerview.widget.LinearLayoutManager.v1(Unknown Source:0)
at androidx.recyclerview.widget.LinearLayoutManager.g1(:2)
at androidx.recyclerview.widget.LinearLayoutManager.u0(:20)
at androidx.recyclerview.widget.RecyclerView.s(Unknown Source:38)
at androidx.recyclerview.widget.RecyclerView.q(:7)
at androidx.recyclerview.widget.RecyclerView.n(:9)
at androidx.recyclerview.widget.RecyclerView$a.run(Unknown Source:31)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1103)
at android.view.Choreographer.doCallbacks(Choreographer.java:926)
at android.view.Choreographer.doFrame(Choreographer.java:848)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1088)
at android.os.Handler.handleCallback(Handler.java:899)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:238)
at android.app.ActivityThread.main(ActivityThread.java:7864)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:998)
2021-04-06 10:13:47.301 4120-4149/? E/hypnusd: set new thermal delta to 0 (prev = 0) right now
2021-04-06 10:13:47.400 919-919/? E/OIFACE_HAL: open /proc/shell-temp failed(No such file or directory)
2021-04-06 10:13:47.419 1729-2815/? E/InputDispatcher: channel 'e15cc28 Toast (server)' ~ Channel is unrecoverably broken and will be disposed!
2021-04-06 10:13:47.448 1729-2815/? E/InputDispatcher: channel 'ce47dbe com.hmatewu.ewulife/com.hmatewu.ewulife.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
2021-04-06 10:13:47.510 1729-3920/? E/OppoThermalStats: Error getting package info: com.oppo.launcher
2021-04-06 10:13:47.586 1729-28064/? E/ANDR-PERF-JNI: UXEngine Trigger - Returning null
2021-04-06 10:13:47.597 31903-32022/? E/msgr.MsysPublishManager: onPublishError, token=10
java.net.SocketTimeoutException: MQTT connection timeout
at X.2BI.run(Unknown Source:125)
at X.0pV.run(Unknown Source:2)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at X.0pb.run(Unknown Source:3)
at X.0pc.run(Unknown Source:12)
at java.lang.Thread.run(Thread.java:919)
2021-04-06 10:13:47.599 31903-32111/? E/msgr.msys: E[N rtchannel]_rt_mqtt_publish_callback(356)=>Failed to publish the request over MQTT. token:724b9903-a7c2-4d25-acae-8b450abab0ba, category:mcd-sync-data-task-category, requestId:28607, error:Error Domain=mqtt Code=3008
2021-04-06 10:13:47.600 31903-32110/? E/msgr.msys: E[S sync]_createResponseError(166)=>Network Response 724b9903-a7c2-4d25-acae-8b450abab0ba contains sync error Error Domain=mqtt Code=3008 - Underlying error (null): Error Domain=mqtt Code=3008
2021-04-06 10:13:47.819 1729-4535/? E/Process: get_ion_cache_memory: Unable to open /d/ion/system_stats
2021-04-06 10:13:47.821 1729-4535/? E/Process: get_ion_cache_memory: Unable to open /d/ion/system_stats
2021-04-06 10:13:47.832 4128-25391/? E/oiface: packageSwitch pkg com.oppo.launcher, enter
2021-04-06 10:13:47.832 4128-25391/? E/oiface: current package is com.oppo.launcher
2021-04-06 10:13:47.841 4128-4143/? E/oiface: access /sys/devices/system/cpu/cpu6/cpufreq/stats/time_in_state failed(No such file or directory)
2021-04-06 10:13:47.841 4128-4143/? E/oiface: Average freq 0 for 0s.
2021-04-06 10:13:47.841 4128-4143/? E/oiface: access /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state failed(No such file or directory)
2021-04-06 10:13:47.841 4128-4143/? E/oiface: Average freq 0 for 0s.
2021-04-06 10:13:47.851 4128-4143/? E/oiface: client not found, skipped
2021-04-06 10:13:47.859 4128-4143/? E/oiface: access /sys/devices/system/cpu/cpu6/cpufreq/stats/time_in_state failed(No such file or directory)
2021-04-06 10:13:47.859 4128-4143/? E/oiface: access /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state failed(No such file or directory)
2021-04-06 10:13:47.879 1729-5766/? E/Process: get_ion_cache_memory: Unable to open /d/ion/system_stats
2021-04-06 10:13:47.944 1729-5766/? E/OppoKillerManagerService: o-kill [32604] com.android.vending:download_service
2021-04-06 10:13:47.945 1729-5766/? E/OppoKillerManagerService: o-kill [32453] com.android.vending
2021-04-06 10:13:47.946 1729-5766/? E/Process: get_ion_cache_memory: Unable to open /d/ion/system_stats
2021-04-06 10:13:47.947 1729-5766/? E/OppoKillerManagerService: o-kill [32421] com.qualcomm.qti.modemtestmode
2021-04-06 10:13:47.949 1729-4535/? E/Process: get_ion_cache_memory: Unable to open /d/ion/system_stats
2021-04-06 10:13:47.949 1729-4535/? E/Process: get_ion_cache_memory: Unable to open /d/ion/system_stats
2021-04-06 10:13:48.058 1729-5766/? E/Process: get_ion_cache_memory: Unable to open /d/ion/system_stats
2021-04-06 10:13:48.061 1729-3920/? E/Process: get_ion_cache_memory: Unable to open /d/ion/system_stats
2021-04-06 10:13:48.402 919-919/? E/OIFACE_HAL: open /proc/shell-temp failed(No such file or directory)
Before and after uploading apps in firebase
https://play.google.com/store/apps/details?id=com.hmatewu.ewulife
It is because of progaurds minify which is changing the names of your classes when you compile your program.
You can either change your build gradle so that minifyEnabled is false or you could use @Keep before the model classes you are using to preserve their naming convention for Firestore.
release {
debuggable true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
@Keep
newsadapter(){
}