我正在开发我的应用程序我完全更新了我的android工作室之后,我面临与我的应用程序相关的问题。它没有错误,但我无法理解的运行时异常请指导我
01-03 11:12:53.283 10560-10560/? W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x9cc9cb20)
01-03 11:12:53.283 10560-10560/? D/AndroidRuntime: procName from cmdline: com.example.moin.fyp
01-03 11:12:53.283 10560-10560/? E/AndroidRuntime: in writeCrashedAppName, pkgName :com.example.moin.fyp
01-03 11:12:53.283 10560-10560/? I/Process: Sending signal. PID: 10560 SIG: 9
01-03 11:12:53.283 10560-10560/? D/AndroidRuntime: file written successfully with content: com.example.moin.fyp StringBuffer : ;com.example.moin.fyp
01-03 11:12:53.283 10560-10560/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.moin.fyp, PID: 10560
java.lang.NoClassDefFoundError: com.google.firebase.FirebaseOptions
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1591)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1562)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:4794)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4389)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4325)
at android.app.ActivityThread.access$1500(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5021)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:827)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643)
at dalvik.system.NativeStart.main(Native Method)
这是我的Java代码
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.widget.TableLayout;
import com.example.moin.fyp.Activities.Activities.Adapters.ViewPagerAdapter;
import com.example.moin.fyp.Activities.Activities.Fragments.Maps_Fragment;
import com.example.moin.fyp.R;
public class MainActivity extends AppCompatActivity {
Toolbar toolbar;
ViewPager viewPager;
TabLayout tabLayout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
toolbar = (Toolbar) findViewById(R.id.toolbar);
viewPager = (ViewPager)findViewById(R.id.viewPager);
tabLayout = (TabLayout)findViewById(R.id.tabLayout);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle("Cab Booking App");
ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager());
adapter.addFragemnt(new Maps_Fragment(),"Maps");
adapter.addFragemnt(new Maps_Fragment(),"Maps");
viewPager.setAdapter(adapter);
tabLayout.setupWithViewPager(viewPager);
}
}
这是XML代码:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.moin.fyp.Activities.Activities.MainActivity">-->
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:id="@+id/toolbar"
app:layout_scrollFlags="scroll"
app:popupTheme="@style/ThemeOverlay.AppCompat.ActionBar">
</android.support.v7.widget.Toolbar>
<android.support.design.widget.TabLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/tabLayout"
app:tabMode="scrollable">
</android.support.design.widget.TabLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/viewPager"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
</android.support.v4.view.ViewPager>
</android.support.design.widget.CoordinatorLayout>