Java Firebase-新依赖项-问题:NoClassDefFoundError:解析失败(QueryListenOptions)

Java Firebase-新依赖项-问题:NoClassDefFoundError:解析失败(QueryListenOptions),java,android,firebase,google-cloud-firestore,Java,Android,Firebase,Google Cloud Firestore,我将应用程序中的firestore版本更新为最新版本,但我不太了解某些更改 我应该将QueryListenOptions转换为其他方法 有人能告诉我它现在应该是什么样子吗 目前,我得到一个错误: NoClassDefFoundError:解析失败:Lcom/google/firebase/firestore/QueryListenOptions Query query = dailyGoalsRef.orderBy("date", Query.Direction.ASCENDIN

我将应用程序中的firestore版本更新为最新版本,但我不太了解某些更改

我应该将QueryListenOptions转换为其他方法

有人能告诉我它现在应该是什么样子吗

目前,我得到一个错误: NoClassDefFoundError:解析失败:Lcom/google/firebase/firestore/QueryListenOptions

        Query query = dailyGoalsRef.orderBy("date", Query.Direction.ASCENDING);
    FirestoreRecyclerOptions<DailyGoalsModel> firestoreRecyclerOptions = new FirestoreRecyclerOptions.Builder<DailyGoalsModel>()
            .setQuery(query, DailyGoalsModel.class)
            .build();

    firestoreRecyclerAdapter =
            new FirestoreRecyclerAdapter<DailyGoalsModel, DailyGoalsHolder>(firestoreRecyclerOptions) {
                @Override
                protected void onBindViewHolder(@NonNull DailyGoalsHolder holder, int position, @NonNull DailyGoalsModel model) {
                    String fragmentName = "dailyGoals";
                    holder.setGoalsList(context, userEmail, model, fragmentName);
                }

                @Override
                public DailyGoalsHolder onCreateViewHolder(ViewGroup parent, int viewType) {
                    View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.daily_goals_list, parent, false);
                    return new DailyGoalsHolder(view);
                }

                @Override
                public int getItemCount() {
                    return super.getItemCount();
                }
            };

    recyclerView.setAdapter(firestoreRecyclerAdapter);
项目:

dependencies {
    classpath 'com.android.tools.build:gradle:3.2.1'
    classpath 'com.google.gms:google-services:4.0.1'
将版本更新为4.2.1应用程序级依赖项并重建应该可以解决您的问题

implementation 'com.firebaseui:firebase-ui-auth:4.1.2'
implementation 'com.firebaseui:firebase-ui-firestore:4.1.2'

希望有帮助

尝试重建应用程序:app:transformClassesWithDexBuilderForDebug AGPBI:{种类:错误,文本:无法在单个dex文件中容纳请求的类方法:88156\u003e 65536,源:[{}],工具:D8}:app:transformDexArchiveWithExternalLibsDexMergerForDebug失败:生成失败,出现异常。*错误:任务的执行失败:app:transformDexArchiveWithExternalLibsDexMergerForDebug。请尝试执行此任务。该项目已建成。我遇到了一个主要问题:NoClassDefFoundError:解析失败:Lcom/google/firebase/firestore/QueryListenOptions;请尝试将版本更新到4.2.1并重新生成。如果要准确地说,这是4.2.1版本:截至今天,6.0.2是最新版本。
implementation 'com.firebaseui:firebase-ui-auth:4.1.2'
implementation 'com.firebaseui:firebase-ui-firestore:4.1.2'