Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/217.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android Can';编辑SharedReferences时,不要在未调用Looper.prepare()的线程内创建处理程序_Android_Firebase_Firebase Realtime Database_Sharedpreferences_Firebase Cloud Messaging - Fatal编程技术网

Android Can';编辑SharedReferences时,不要在未调用Looper.prepare()的线程内创建处理程序

Android Can';编辑SharedReferences时,不要在未调用Looper.prepare()的线程内创建处理程序,android,firebase,firebase-realtime-database,sharedpreferences,firebase-cloud-messaging,Android,Firebase,Firebase Realtime Database,Sharedpreferences,Firebase Cloud Messaging,我正在尝试学习和开发一个使用FCM的NoSQL数据库的示例应用程序。我已经在Firebase控制台上成功注册了我的应用程序,并且还通过该应用程序向数据库写入了一些虚拟值,这表明从我的应用程序到FCM服务器的连接已清除。现在,出于某种原因,我想使用SharedReference。当我尝试在onCreate方法中编辑键值对时,会出现以下错误: Can't create handler inside thread that has not called Looper.prepare() 网址为: 在

我正在尝试学习和开发一个使用FCM的NoSQL数据库的示例应用程序。我已经在Firebase控制台上成功注册了我的应用程序,并且还通过该应用程序向数据库写入了一些虚拟值,这表明从我的应用程序到FCM服务器的连接已清除。现在,出于某种原因,我想使用SharedReference。当我尝试在onCreate方法中编辑键值对时,会出现以下错误:

Can't create handler inside thread that has not called Looper.prepare()
网址为: 在com.example.ankitshubham.ribbon.MyFireBaseInstancedService.onTokenRefresh(MyFireBaseInstancedService.java:18)上`

这是主要的活动:

public class MainActivity extends AppCompatActivity {
    private DatabaseReference mDatabase;
    private final int MY_PERMISSIONS_REQUEST_READ_GET_ACCOUNTS  =10;
    SharedPreferences sharedPreferences;
    private final static  String INIT_DB = "init_db";


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        FirebaseDatabase.getInstance().setPersistenceEnabled(true);
        mDatabase = FirebaseDatabase.getInstance().getReference();
        sharedPreferences = getSharedPreferences(INIT_DB, MODE_PRIVATE);
        if (!sharedPreferences.contains("firstrun")) {
            Toast.makeText(getApplicationContext(),"first run",Toast.LENGTH_SHORT).show();
            sharedPreferences.edit().putBoolean("firstrun", false).commit();
        }
        else {
            Toast.makeText(getApplicationContext(),"not the first run",Toast.LENGTH_SHORT).show();
        }
    }
}
这是MyFireBaseInstancedService:

public class MyFirebaseInstanceIDService extends FirebaseInstanceIdService {
    @Override
    public void onTokenRefresh() {
        super.onTokenRefresh();
        Log.i("Updated token", FirebaseInstanceId.getInstance().getToken());
        Toast.makeText(getApplicationContext(), FirebaseInstanceId.getInstance().getToken(),Toast.LENGTH_SHORT).show();

    }
}
如果我从MainActivity.java中删除以下行:

sharedPreferences.edit().putBoolean("firstrun", false).commit();
那么它不会显示任何错误。这里有什么问题

完整堆栈跟踪:

07-19 18:20:07.468 9082-9082/? D/dalvikvm: Late-enabling CheckJNI
07-19 18:20:07.598 9082-9082/com.example.ankitshubham.ribbon D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
07-19 18:20:07.598 9082-9082/com.example.ankitshubham.ribbon I/dalvikvm: Could not find method android.content.Context.getNoBackupFilesDir, referenced from method com.google.android.gms.common.util.zzx.getNoBackupFilesDir
07-19 18:20:07.598 9082-9082/com.example.ankitshubham.ribbon W/dalvikvm: VFY: unable to resolve virtual method 382: Landroid/content/Context;.getNoBackupFilesDir ()Ljava/io/File;
07-19 18:20:07.598 9082-9082/com.example.ankitshubham.ribbon D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006
07-19 18:20:07.618 9082-9082/com.example.ankitshubham.ribbon D/FirebaseApp: Initialized class com.google.firebase.iid.FirebaseInstanceId.
07-19 18:20:07.618 9082-9082/com.example.ankitshubham.ribbon D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
07-19 18:20:07.628 9082-9082/com.example.ankitshubham.ribbon I/dalvikvm: Could not find method android.content.pm.PackageManager.getPackageInstaller, referenced from method com.google.android.gms.common.zze.zzk
07-19 18:20:07.628 9082-9082/com.example.ankitshubham.ribbon W/dalvikvm: VFY: unable to resolve virtual method 523: Landroid/content/pm/PackageManager;.getPackageInstaller ()Landroid/content/pm/PackageInstaller;
07-19 18:20:07.628 9082-9082/com.example.ankitshubham.ribbon D/dalvikvm: VFY: replacing opcode 0x6e at 0x000b
07-19 18:20:07.638 9082-9082/com.example.ankitshubham.ribbon I/FA: App measurement is starting up, version: 9080
07-19 18:20:07.638 9082-9082/com.example.ankitshubham.ribbon I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
07-19 18:20:07.638 9082-9082/com.example.ankitshubham.ribbon D/FA: Debug logging enabled
07-19 18:20:07.638 9082-9082/com.example.ankitshubham.ribbon D/FA: AppMeasurement singleton hash: 1099921264
07-19 18:20:07.688 9082-9082/com.example.ankitshubham.ribbon D/FirebaseApp: Initialized class com.google.android.gms.measurement.AppMeasurement.
07-19 18:20:07.688 9082-9082/com.example.ankitshubham.ribbon I/FirebaseInitProvider: FirebaseApp initialization successful
07-19 18:20:07.718 9082-9110/com.example.ankitshubham.ribbon D/dalvikvm: GC_FOR_ALLOC freed 334K, 13% free 2971K/3388K, paused 18ms, total 18ms
07-19 18:20:07.728 9082-9110/com.example.ankitshubham.ribbon W/GooglePlayServicesUtil: Google Play services out of date.  Requires 9080000 but found 4324034
07-19 18:20:07.728 9082-9110/com.example.ankitshubham.ribbon D/FA: Service container out of date
07-19 18:20:07.728 9082-9082/com.example.ankitshubham.ribbon I/dalvikvm: Could not find method android.view.Window$Callback.onProvideKeyboardShortcuts, referenced from method android.support.v7.view.WindowCallbackWrapper.onProvideKeyboardShortcuts
07-19 18:20:07.728 9082-9082/com.example.ankitshubham.ribbon W/dalvikvm: VFY: unable to resolve interface method 16355: Landroid/view/Window$Callback;.onProvideKeyboardShortcuts (Ljava/util/List;Landroid/view/Menu;I)V
07-19 18:20:07.728 9082-9082/com.example.ankitshubham.ribbon D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002
07-19 18:20:07.728 9082-9082/com.example.ankitshubham.ribbon W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/view/SearchEvent;)
07-19 18:20:07.728 9082-9082/com.example.ankitshubham.ribbon I/dalvikvm: Could not find method android.view.Window$Callback.onSearchRequested, referenced from method android.support.v7.view.WindowCallbackWrapper.onSearchRequested
07-19 18:20:07.728 9082-9082/com.example.ankitshubham.ribbon W/dalvikvm: VFY: unable to resolve interface method 16357: Landroid/view/Window$Callback;.onSearchRequested (Landroid/view/SearchEvent;)Z
07-19 18:20:07.728 9082-9082/com.example.ankitshubham.ribbon D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002
07-19 18:20:07.728 9082-9082/com.example.ankitshubham.ribbon I/dalvikvm: Could not find method android.view.Window$Callback.onWindowStartingActionMode, referenced from method android.support.v7.view.WindowCallbackWrapper.onWindowStartingActionMode
07-19 18:20:07.728 9082-9082/com.example.ankitshubham.ribbon W/dalvikvm: VFY: unable to resolve interface method 16361: Landroid/view/Window$Callback;.onWindowStartingActionMode (Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode;
07-19 18:20:07.728 9082-9082/com.example.ankitshubham.ribbon D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002
07-19 18:20:07.738 9082-9082/com.example.ankitshubham.ribbon I/dalvikvm: Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.widget.TintTypedArray.getChangingConfigurations
07-19 18:20:07.738 9082-9082/com.example.ankitshubham.ribbon W/dalvikvm: VFY: unable to resolve virtual method 617: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
07-19 18:20:07.738 9082-9082/com.example.ankitshubham.ribbon D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
07-19 18:20:07.738 9082-9082/com.example.ankitshubham.ribbon I/dalvikvm: Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.widget.TintTypedArray.getType
07-19 18:20:07.738 9082-9082/com.example.ankitshubham.ribbon W/dalvikvm: VFY: unable to resolve virtual method 639: Landroid/content/res/TypedArray;.getType (I)I
07-19 18:20:07.738 9082-9110/com.example.ankitshubham.ribbon W/GooglePlayServicesUtil: Google Play services out of date.  Requires 9080000 but found 4324034
07-19 18:20:07.738 9082-9082/com.example.ankitshubham.ribbon D/dalvikvm: VFY: replacing opcode 0x6e at 0x0008
07-19 18:20:07.748 9082-9082/com.example.ankitshubham.ribbon I/dalvikvm: Could not find method android.content.Context.createDeviceProtectedStorageContext, referenced from method android.support.v4.content.ContextCompat.createDeviceProtectedStorageContext
07-19 18:20:07.748 9082-9082/com.example.ankitshubham.ribbon W/dalvikvm: VFY: unable to resolve virtual method 363: Landroid/content/Context;.createDeviceProtectedStorageContext ()Landroid/content/Context;
07-19 18:20:07.748 9082-9082/com.example.ankitshubham.ribbon D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006
07-19 18:20:07.748 9082-9082/com.example.ankitshubham.ribbon I/dalvikvm: Could not find method android.content.Context.getCodeCacheDir, referenced from method android.support.v4.content.ContextCompat.getCodeCacheDir
07-19 18:20:07.748 9082-9082/com.example.ankitshubham.ribbon W/dalvikvm: VFY: unable to resolve virtual method 369: Landroid/content/Context;.getCodeCacheDir ()Ljava/io/File;
07-19 18:20:07.748 9082-9082/com.example.ankitshubham.ribbon D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006
07-19 18:20:07.748 9082-9082/com.example.ankitshubham.ribbon I/dalvikvm: Could not find method android.content.Context.getColor, referenced from method android.support.v4.content.ContextCompat.getColor
07-19 18:20:07.748 9082-9082/com.example.ankitshubham.ribbon W/dalvikvm: VFY: unable to resolve virtual method 370: Landroid/content/Context;.getColor (I)I
07-19 18:20:07.748 9082-9082/com.example.ankitshubham.ribbon D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006
07-19 18:20:07.748 9082-9082/com.example.ankitshubham.ribbon I/dalvikvm: Could not find method android.content.Context.getColorStateList, referenced from method android.support.v4.content.ContextCompat.getColorStateList
07-19 18:20:07.748 9082-9082/com.example.ankitshubham.ribbon W/dalvikvm: VFY: unable to resolve virtual method 371: Landroid/content/Context;.getColorStateList (I)Landroid/content/res/ColorStateList;
07-19 18:20:07.748 9082-9082/com.example.ankitshubham.ribbon D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006
07-19 18:20:07.748 9082-9082/com.example.ankitshubham.ribbon I/dalvikvm: Could not find method android.content.Context.getDataDir, referenced from method android.support.v4.content.ContextCompat.getDataDir
07-19 18:20:07.748 9082-9082/com.example.ankitshubham.ribbon W/dalvikvm: VFY: unable to resolve virtual method 373: Landroid/content/Context;.getDataDir ()Ljava/io/File;
07-19 18:20:07.748 9082-9082/com.example.ankitshubham.ribbon D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006
07-19 18:20:07.748 9082-9082/com.example.ankitshubham.ribbon I/dalvikvm: Could not find method android.content.Context.getDrawable, referenced from method android.support.v4.content.ContextCompat.getDrawable
07-19 18:20:07.748 9082-9082/com.example.ankitshubham.ribbon W/dalvikvm: VFY: unable to resolve virtual method 375: Landroid/content/Context;.getDrawable (I)Landroid/graphics/drawable/Drawable;
07-19 18:20:07.748 9082-9082/com.example.ankitshubham.ribbon D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006
07-19 18:20:07.748 9082-9082/com.example.ankitshubham.ribbon I/dalvikvm: Could not find method android.content.Context.getNoBackupFilesDir, referenced from method android.support.v4.content.ContextCompat.getNoBackupFilesDir
07-19 18:20:07.748 9082-9082/com.example.ankitshubham.ribbon W/dalvikvm: VFY: unable to resolve virtual method 382: Landroid/content/Context;.getNoBackupFilesDir ()Ljava/io/File;
07-19 18:20:07.748 9082-9082/com.example.ankitshubham.ribbon D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006
07-19 18:20:07.748 9082-9082/com.example.ankitshubham.ribbon I/dalvikvm: Could not find method android.content.Context.isDeviceProtectedStorage, referenced from method android.support.v4.content.ContextCompat.isDeviceProtectedStorage
07-19 18:20:07.748 9082-9082/com.example.ankitshubham.ribbon W/dalvikvm: VFY: unable to resolve virtual method 395: Landroid/content/Context;.isDeviceProtectedStorage ()Z
07-19 18:20:07.748 9082-9082/com.example.ankitshubham.ribbon D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006
07-19 18:20:07.798 9082-9082/com.example.ankitshubham.ribbon I/dalvikvm: Could not find method android.content.res.Resources.getDrawable, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawable
07-19 18:20:07.798 9082-9082/com.example.ankitshubham.ribbon W/dalvikvm: VFY: unable to resolve virtual method 580: Landroid/content/res/Resources;.getDrawable (ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
07-19 18:20:07.798 9082-9082/com.example.ankitshubham.ribbon D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
07-19 18:20:07.798 9082-9082/com.example.ankitshubham.ribbon I/dalvikvm: Could not find method android.content.res.Resources.getDrawableForDensity, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawableForDensity
07-19 18:20:07.798 9082-9082/com.example.ankitshubham.ribbon W/dalvikvm: VFY: unable to resolve virtual method 582: Landroid/content/res/Resources;.getDrawableForDensity (IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
07-19 18:20:07.798 9082-9082/com.example.ankitshubham.ribbon D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
07-19 18:20:07.808 9082-9082/com.example.ankitshubham.ribbon I/dalvikvm: Could not find method android.content.Context.getColorStateList, referenced from method android.support.v7.content.res.AppCompatResources.getColorStateList
07-19 18:20:07.808 9082-9082/com.example.ankitshubham.ribbon W/dalvikvm: VFY: unable to resolve virtual method 371: Landroid/content/Context;.getColorStateList (I)Landroid/content/res/ColorStateList;
07-19 18:20:07.808 9082-9082/com.example.ankitshubham.ribbon D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006
07-19 18:20:07.828 9082-9082/com.example.ankitshubham.ribbon W/GooglePlayServicesUtil: Google Play services out of date.  Requires 9080000 but found 4324034
07-19 18:20:07.828 9082-9082/com.example.ankitshubham.ribbon I/DynamiteModule: Considering local module com.google.android.gms.firebase_database:2 and remote module com.google.android.gms.firebase_database:0
07-19 18:20:07.828 9082-9082/com.example.ankitshubham.ribbon I/DynamiteModule: Selected local version of com.google.android.gms.firebase_database
07-19 18:20:08.309 9082-9109/com.example.ankitshubham.ribbon D/dalvikvm: GC_FOR_ALLOC freed 308K, 12% free 3158K/3556K, paused 15ms, total 15ms
07-19 18:20:08.399 9082-9082/com.example.ankitshubham.ribbon W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
07-19 18:20:08.439 9082-9082/com.example.ankitshubham.ribbon D/ION: config: version(0x10001) secure(0xf000) 256M(0x221) fast(0x608) hwwr(0x4)
07-19 18:20:08.449 9082-9082/com.example.ankitshubham.ribbon I/MM_DEVICE: Waiting for mm thread to come up
07-19 18:20:08.449 9082-9127/com.example.ankitshubham.ribbon I/MM_DEVICE: mm_device_thread starting
07-19 18:20:08.449 9082-9082/com.example.ankitshubham.ribbon D/HAWAII_EGL: eglCreateContext() config: 19 context: 0x548a2498, VC context 0, Thread 9082
07-19 18:20:08.449 9082-9082/com.example.ankitshubham.ribbon D/HAWAII_EGL: eglMakeCurrent(0x548a2498, 0x5489dc50, 0x5489dc50) Thread: 9082
07-19 18:20:08.459 9082-9082/com.example.ankitshubham.ribbon D/OpenGLRenderer: Enabling debug mode 0
07-19 18:20:08.489 9082-9082/com.example.ankitshubham.ribbon D/dalvikvm: DexOpt: couldn't find field Landroid/os/Message;.sendingUid
07-19 18:20:08.489 9082-9082/com.example.ankitshubham.ribbon W/dalvikvm: VFY: unable to resolve instance field 132
07-19 18:20:08.489 9082-9082/com.example.ankitshubham.ribbon D/dalvikvm: VFY: replacing opcode 0x52 at 0x0000
07-19 18:20:09.940 9082-9128/com.example.ankitshubham.ribbon W/InstanceID/Rpc: Found 10009
07-19 18:20:11.352 9082-9117/com.example.ankitshubham.ribbon D/dalvikvm: GC_FOR_ALLOC freed 453K, 15% free 3215K/3752K, paused 15ms, total 17ms
07-19 18:20:11.382 9082-9128/com.example.ankitshubham.ribbon I/Updated token: c_p6z2MheZQ:APA91bFMfIpAyl_1SuCg3F2cG1cRLACtCgBSAtBnWY5sly-eypN-xGdh0jHBVa_EukERqYGUSFyuTYSSvypMXElWoFJ_6qNpjAWHrW7paNqiXMLp_VN2EwKdxTsFWttMMSImaETWFrLN
07-19 18:20:11.382 9082-9128/com.example.ankitshubham.ribbon W/dalvikvm: threadid=15: thread exiting with uncaught exception (group=0x41610ba8)
07-19 18:20:11.382 9082-9128/com.example.ankitshubham.ribbon E/AndroidRuntime: FATAL EXCEPTION: pool-4-thread-1
                                                                               Process: com.example.ankitshubham.ribbon, PID: 9082
                                                                               java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
                                                                                   at android.os.Handler.<init>(Handler.java:200)
                                                                                   at android.os.Handler.<init>(Handler.java:114)
                                                                                   at android.widget.Toast$TN.<init>(Toast.java:327)
                                                                                   at android.widget.Toast.<init>(Toast.java:92)
                                                                                   at android.widget.Toast.makeText(Toast.java:241)
                                                                                   at com.example.ankitshubham.ribbon.MyFirebaseInstanceIDService.onTokenRefresh(MyFirebaseInstanceIDService.java:18)
                                                                                   at com.google.firebase.iid.FirebaseInstanceIdService.zza(Unknown Source)
                                                                                   at com.google.firebase.iid.FirebaseInstanceIdService.zzm(Unknown Source)
                                                                                   at com.google.firebase.iid.zzb$2.run(Unknown Source)
                                                                                   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                                                                                   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                                                                                   at java.lang.Thread.run(Thread.java:841)
07-19 18:20:11.542 9082-9082/com.example.ankitshubham.ribbon D/HAWAII_EGL: eglMakeCurrent(NULL) Thread: 9082
07-19 18:20:11.542 9082-9082/com.example.ankitshubham.ribbon D/HAWAII_EGL: eglDestroySurface() surface: 0x5489dc50, android window 0x548a0378, Thread: 9082
07-19 18:20:11.992 9082-9082/com.example.ankitshubham.ribbon D/HAWAII_EGL: eglMakeCurrent(0x548a2498, 0x55611c90, 0x55611c90) Thread: 9082
07-19 18:20:12.002 9082-9082/com.example.ankitshubham.ribbon D/FirebaseApp: Notifying background state change listeners.
07-19 18:20:12.002 9082-9082/com.example.ankitshubham.ribbon D/HAWAII_EGL: eglMakeCurrent(NULL) Thread: 9082
07-19 18:20:12.002 9082-9082/com.example.ankitshubham.ribbon D/HAWAII_EGL: eglMakeCurrent(0x548a2498, 0x55611c90, 0x55611c90) Thread: 9082
07-19 18:20:12.002 9082-9082/com.example.ankitshubham.ribbon D/HAWAII_EGL: eglMakeCurrent(NULL) Thread: 9082
07-19 18:21:07.747 9082-9886/com.example.ankitshubham.ribbon W/FA: Tasks have been queued for a long time
07-19 18:25:11.434 9082-9128/? I/Process: Sending signal. PID: 9082 SIG: 9
07-19 18:20:07.468 9082-9082/?D/dalvikvm:延迟启用CheckJNI
07-19 18:20:07.598 9082-9082/com.example.ankitshubham.ribbon D/FirebaseApp:com.google.firebase.auth.FirebaseAuth未链接。跳过初始化。
07-19 18:20:07.598 9082-9082/com.example.ankitshubham.ribbon I/dalvikvm:找不到从方法com.google.android.gms.common.util.zzx.getNoBackupFilesDir引用的方法android.Context.getNoBackupFilesDir
07-19 18:20:07.598 9082-9082/com.example.ankitshubham.ribbon W/dalvikvm:VFY:无法解析虚拟方法382:Landroid/content/Context;。getnobackfilesdir()Ljava/io/File;
07-19 18:20:07.598 9082-9082/com.example.ankitshubham.ribbon D/dalvikvm:VFY:在0x0006处替换操作码0x6e
07-19 18:20:07.618 9082-9082/com.example.ankitshubham.ribbon D/FirebaseApp:Initialized class com.google.firebase.iid.FirebaseInstanceId。
07-19 18:20:07.618 9082-9082/com.example.ankitshubham.ribbon D/FirebaseApp:com.google.firebase.crash.firebaseCash未链接。跳过初始化。
07-19 18:20:07.628 9082-9082/com.example.ankitshubham.ribbon I/dalvikvm:找不到方法android.content.pm.PackageManager.getPackageInstaller,从方法com.google.android.gms.common.zze.zzk引用
07-19 18:20:07.628 9082-9082/com.example.ankitshubham.ribbon W/dalvikvm:VFY:无法解析虚拟方法523:Landroid/content/pm/PackageManager;。getPackageInstaller()Landroid/content/pm/PackageInstaller;
07-19 18:20:07.628 9082-9082/com.example.ankitshubham.ribbon D/dalvikvm:VFY:在0x000b处替换操作码0x6e
07-19 18:20:07.638 9082-9082/com.example.ankitshubham.ribbon I/FA:应用程序测量正在启动,版本:9080
07-19 18:20:07.638 9082-9082/com.example.ankitshubham.ribbon I/FA:启用调试日志运行:adb shell setprop log.tag.FA VERBOSE
07-19 18:20:07.638 9082-9082/com.example.ankitshubham.ribbon D/FA:已启用调试日志记录
07-19 18:20:07.638 9082-9082/com.example.ankitshubham.ribbon D/FA:AppMeasurement单例哈希:1099921264
07-19 18:20:07.688 9082-9082/com.example.ankitshubham.ribbon D/FirebaseApp:Initialized class com.google.android.gms.measurement.AppMeasurement。
07-19 18:20:07.688 9082-9082/com.example.ankitshubham.ribbon I/FirebaseInitProvider:FirebaseApp初始化成功
07-19 18:20:07.718 9082-9110/com.example.ankitshubham.ribbon D/dalvikvm:GC_用于所有释放的334K,13%自由的2971K/3388K,暂停18ms,总计18ms
07-19 18:20:07.728 9082-9110/com.example.ankitshubham.ribbon W/GooglePlayServicesUtil:googleplay服务过时了。需要9080000,但找到4324034
07-19 18:20:07.728 9082-9110/com.example.ankitshubham.ribbon D/FA:服务容器过期
07-19 18:20:07.728 9082-9082/com.example.ankitshubham.ribbon I/dalvikvm:找不到方法android.view.Window$Callback.onProvideKeyboardShortcuts,从方法android.support.v7.view.WindowCallbackWrapper.onProvideKeyboardShortcuts引用
07-19 18:20:07.728 9082-9082/com.example.ankitshubham.ribbon W/dalvikvm:VFY:无法解析接口方法16355:Landroid/view/Window$Callback;。onProvideKeyboardShortcuts(Ljava/util/List;Landroid/view/Menu;I)V
07-19 18:20:07.728 9082-9082/com.example.ankitshubham.ribbon D/dalvikvm:VFY:在0x0002处替换操作码0x72
07-19 18:20:07.728 9082-9082/com.example.ankitshubham.ribbon W/dalvikvm:VFY:找不到签名中引用的类(Landroid/view/SearchEvent;)
07-19 18:20:07.728 9082-9082/com.example.ankitshubham.ribbon I/dalvikvm:找不到方法android.view.Window$Callback.onSearchRequested,从方法android.support.v7.view.WindowCallbackWrapper.onSearchRequested引用
07-19 18:20:07.728 9082-9082/com.example.ankitshubham.ribbon W/dalvikvm:VFY:无法解析接口方法16357:Landroid/view/Window$Callback;。onSearchRequested(Landroid/view/SearchEvent;)Z
07-19 18:20:07.728 9082-9082/com.example.ankitshubham.ribbon D/dalvikvm:VFY:在0x0002处替换操作码0x72
07-19 18:20:07.728 9082-9082/com.example.ankitshubham.ribbon I/dalvikvm:找不到方法android.view.Window$Callback.onWindowStartingActionMode,从方法android.support.v7.view.WindowCallbackWrapper.onWindowStartingActionMode引用
07-19 18:20:07.728 9082-9082/com.example.ankitshubham.ribbon W/dalvikvm:VFY:无法解析接口方法16361:Landroid/view/Window$Callback;。OnWindowsStartingActionMode(Landroid/view/ActionMode$回调;I)Landroid/view/ActionMode;
07-19 18:20:07.728 9082-9082/com.example.ankitshubham.ribbon D/dalvikvm:VFY:在0x0002处替换操作码0x72
07-19 18:20:07.738 9082-9082/com.example.ankitshubham.ribbon I/dalvikvm:找不到方法android.content.res.TypedArray.getChangingConfigurations,从方法android.support.v7.widget.tintypedarray.getChangingConfigurations引用
07-19 18:20:07.738 9082-9082/com.example.ankitshubham.ribbon W/dalvikvm:VFY:无法解析虚拟方法617:Landroid/content/res/TypedArray;。getChangingConfigurations()I
07-19 18:20:07.738 9082-9082/com.example.ankitshubham.ribbon D/dalvikvm:VFY:在0x0002处替换操作码0x6e
07-19 18:20:07.738 9082-908
FirebaseAuth auth = FirebaseAuth.getInstance();
FirebaseAuth.AuthStateListener authListener;
authListener = new FirebaseAuth.AuthStateListener() {
    @Override
    public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
        firebaseUser = firebaseAuth.getCurrentUser();
        if (firebaseUser != null) {
            Log.d("TAG", "You are signed in Firebase!");
        } else {
            Log.d("TAG", "You are not signed in Firebase!");
        }
    }
};
public class MyFirebaseInstanceIDService extends FirebaseInstanceIdService {
    @Override
    public void onTokenRefresh() {
        super.onTokenRefresh();
        Log.i("Updated token", FirebaseInstanceId.getInstance().getToken());
        // TOAST REMOVED    
    }
}
W/GooglePlayServicesUtil: Google Play services out of date.  Requires 9080000 but found 4324034