Firebase recyclerview在发布模式下未显示任何值,但在调试模式下可完美运行

时间:2019-07-05 12:07:23

标签: java android firebase firebase-realtime-database

我无法在发布模式下显示firebase recyclerview,但它在调试模式下显示所有值。我达到Firebase数据库限制后,就会发生此问题。我现在已经将计划从烈火升级为烈火。但是,问题仍然没有解决。

Query query = FirebaseDatabase.getInstance()
            .getReference()
            .child("quizTimings");

    FirebaseRecyclerOptions<CarouselModel> options =
            new FirebaseRecyclerOptions.Builder<CarouselModel>()
                    .setQuery(query, CarouselModel.class)
                    .build();

    scrollView = (RecyclerView) findViewById(R.id.picker);

    adapter = new FirebaseRecyclerAdapter<CarouselModel, TimeViewHolder>(options) {

        @Override
        public TimeViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
            View view = LayoutInflater.from(viewGroup.getContext())
                    .inflate(R.layout.item_time, viewGroup, false);

            return new TimeViewHolder(view);
        }

        @Override
        protected void onBindViewHolder(TimeViewHolder timeViewHolder, int i, final CarouselModel carouselModel) {

            try {
                String quizTimings = carouselModel.getTime();
                String timeMoney = carouselModel.getTimeMoney();
                timeViewHolder.timeShow.setText(quizTimings);
                timeViewHolder.timeMoney.setText(timeMoney);
                Log.w("timeMoney",timeMoney);
                /*final Animation myAnim = AnimationUtils.loadAnimation(MainActivity.this, R.anim.bounce);
                MyBounceInterpolator interpolator = new MyBounceInterpolator(0.2, 20);
                myAnim.setInterpolator(interpolator);
                startBtn.startAnimation(myAnim);*/
            } catch (Exception ex) {
                String err = (ex.getMessage()==null)?"SD Card failed":ex.getMessage();
                Log.e("sdcard-err2:",err);
            }
        }
    };
    //For setting time
    /*CarouselModel carouselModel = new CarouselModel("ewt","wtt","ete","wte");
    quizTiming.push().setValue(carouselModel);*/

    CustomLinearLayout linearLayoutManager = new CustomLinearLayout(this,LinearLayoutManager.HORIZONTAL,false);

    scrollView.addItemDecoration(new LinePagerIndicatorDecoration(MainActivity.this));
    scrollView.setLayoutManager(linearLayoutManager);
    scrollView.setAdapter(adapter);

1 个答案:

答案 0 :(得分:0)

确保遵循指南中指定的所有步骤: https://developers.google.com/identity/sign-in/android/start-integrating

。如果需要,请创建一个新的OAuth客户端,新的配置文件(google-services.json)文件,并逐步进行所有操作。

还尝试添加提供相同凭据的Web客户端。对于Android和Web客户端,同时提供SHA1进行调试以及发布密钥库。在Android Studio的最左侧,您会看到一个标签:“ Build Variants”。在此处选择发布模式,然后执行所有操作。