应用程序在打开时崩溃。
我一直对技术感兴趣。我正在做一个项目。我想根据需要列出数据。但是我有一些问题。
logcat:
05-07 23:53:43.588 18182-18182/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.erdemswordx.eticaretuygulama.menuapplicaion, PID: 18182
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/firestore/QueryListenOptions;
at com.firebase.ui.firestore.FirestoreRecyclerOptions$Builder.setQuery(FirestoreRecyclerOptions.java:108)
at com.erdemswordx.eticaretuygulama.menuapplicaion.MainScreen.Fragments.UrunlerFragment.onStart(UrunlerFragment.java:199)
at android.support.v4.app.Fragment.performStart(Fragment.java:2477)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1494)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3269)
at android.support.v4.app.FragmentManagerImpl.dispatchStart(FragmentManager.java:3235)
at android.support.v4.app.FragmentController.dispatchStart(FragmentController.java:212)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:628)
at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:178)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1288)
at android.app.Activity.performStart(Activity.java:6279)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2472)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2569)
at android.app.ActivityThread.access$900(ActivityThread.java:150)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1399)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:168)
at android.app.ActivityThread.main(ActivityThread.java:5885)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.firestore.QueryListenOptions" on path: DexPathList[[zip file "/data/app/com.erdemswordx.eticaretuygulama.menuapplicaion-1/base.apk"],nativeLibraryDirectories=[/data/app/com.erdemswordx.eticaretuygulama.menuapplicaion-1/lib/arm, /system/lib, /vendor/lib, system/vendor/lib, system/vendor/lib/egl, system/lib/hw]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at com.firebase.ui.firestore.FirestoreRecyclerOptions$Builder.setQuery(FirestoreRecyclerOptions.java:108)
at com.erdemswordx.eticaretuygulama.menuapplicaion.MainScreen.Fragments.UrunlerFragment.onStart(UrunlerFragment.java:199)
at android.support.v4.app.Fragment.performStart(Fragment.java:2477)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1494)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3269)
at android.support.v4.app.FragmentManagerImpl.dispatchStart(FragmentManager.java:3235)
at android.support.v4.app.FragmentController.dispatchStart(FragmentController.java:212)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:628)
at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:178)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1288)
at android.app.Activity.performStart(Activity.java:6279)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2472)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2569)
at android.app.ActivityThread.access$900(ActivityThread.java:150)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1399)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:168)
at android.app.ActivityThread.main(ActivityThread.java:5885)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687)
Suppressed: java.lang.ClassNotFoundException: com.google.firebase.firestore.QueryListenOptions
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 24 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
05-07 23:53:43.588 1808-1818/? E/ActivityManager: App crashed! Process: com.erdemswordx.eticaretuygulama.menuapplicaion
感谢帮助。
等级:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-vector-drawable:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-auth:16.2.0'
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation "android.arch.core:runtime:1.1.1"
implementation "android.arch.core:common:1.1.1"
implementation 'com.firebaseui:firebase-ui-firestore:3.2.2'
implementation 'com.google.firebase:firebase-firestore:15.0.0'
implementation 'com.google.firebase:firebase-messaging:17.6.0'
}
public void onStart() {
super.onStart();
String searchText = searchField.getText().toString();
Query query = dbRef.orderBy("aracParkSaati",Query.Direction.ASCENDING);
try {
FirestoreRecyclerOptions<OtoparkAraclar> options =
new FirestoreRecyclerOptions.Builder<OtoparkAraclar>()
.setQuery(query, OtoparkAraclar.class)
.build();
adapter = new FirestoreRecyclerAdapter<OtoparkAraclar, RequestViewHolder>(options) {
@Override
protected void onBindViewHolder(RequestViewHolder holder, int position, OtoparkAraclar model) {
final String arac_id = getSnapshots().getSnapshot(position).getId();
final String plaka = String.valueOf(model.getPlakaText());
final String adsoyad = String.valueOf(model.getAdsoyadText());
final String aractipi = String.valueOf(model.getAracTipiText());
final String aracrengi = String.valueOf(model.getAracRengiText());
final String tcno = String.valueOf(model.getTcnoText());
final String telefon = String.valueOf(model.getTelefonText());
final long girisZaman = Long.valueOf(model.getAracGirisTarihiText());
final String girisZaman1 = getDate(girisZaman, "dd/MM/yyyy HH:mm:ss");
final long cikisZaman = Long.valueOf(model.getAracParkSaati());
final String cikisZaman1 = getDate(cikisZaman, "dd/MM/yyyy HH:mm:ss");
holder.aracPlakaLayout.setText(model.getPlakaText());
holder.girisTarihiLayout.setText("Giriş tarihi : " + girisZaman1);
holder.cikisTarihiLayout.setText("Çıkış tarihi : " + cikisZaman1);
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent aracDetailActivity = new Intent(getActivity(), AracDetails.class);
aracDetailActivity.putExtra("arac_id", arac_id);
aracDetailActivity.putExtra("adsoyad", adsoyad);
aracDetailActivity.putExtra("plaka", plaka);
aracDetailActivity.putExtra("aractipi", aractipi);
aracDetailActivity.putExtra("aracrengi", aracrengi);
aracDetailActivity.putExtra("tcno", tcno);
aracDetailActivity.putExtra("telefon", telefon);
aracDetailActivity.putExtra("giris", girisZaman1);
aracDetailActivity.putExtra("cikis", cikisZaman1);
aracDetailActivity.putExtra("timeago", girisZaman);
startActivity(aracDetailActivity);
}
});
LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());
layoutManager.setReverseLayout(true);
layoutManager.setStackFromEnd(true);
}
@NonNull
@Override
public RequestViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.recycler_layout, viewGroup, false);
RequestViewHolder holder = new RequestViewHolder(view);
return holder;
}
};
recyclerView.setAdapter(adapter);
adapter.startListening();
}catch (Exception ex){
Toast.makeText(getActivity().getApplicationContext(),"Hata!" + ex, Toast.LENGTH_SHORT).show();
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-vector-drawable:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-auth:16.2.0'
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation "android.arch.core:runtime:1.1.1"
implementation "android.arch.core:common:1.1.1"
implementation 'com.firebaseui:firebase-ui-firestore:3.2.2'
implementation 'com.google.firebase:firebase-firestore:15.0.0'
implementation 'com.google.firebase:firebase-messaging:17.6.0'
}