我最近升级到Android Studio 2.2.2,并迁移到位于here的新Firebase SDK。从那时起,我注意到我无法再查看Logging。在下面的代码中,我只是检查用户是否已登录/验证,但我的日志未显示任何活动(请参见屏幕截图):
public class LoadingActivity extends AppCompatActivity {
private FirebaseAuth.AuthStateListener mAuthListener;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.v("OnCreate_TRIGGERED", "OnCreate HAS BEEN TRIGGERED");
setContentView(R.layout.activity_loading);
final DatabaseReference userRef = FirebaseUtil.FIREBASE.child("Users");
Thread thread= new Thread(){
@Override
public void run(){
try {
synchronized(this){
wait(3000);
}
}
catch(InterruptedException ex){
}
mAuthListener = new FirebaseAuth.AuthStateListener() {
@Override
public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
FirebaseUser user = firebaseAuth.getCurrentUser();
if (user != null) {
// User is signed in
Log.d("TAG", "onAuthStateChanged:signed_in:" + user.getUid());
} else {
// User is signed out
Log.d("TAG", "onAuthStateChanged:signed_out");
}
}
};
}
};
thread.start();
}
}
在我的代码中,我设置基本日志以确定用户的身份验证状态。但是,当我在Android监视器中搜索标签时,我发现由于某种原因,跟踪代码管理器无法正常工作。我之前使用过Tag Manager没有任何问题,因此我担心我对Android Studio 2.2.2的更新会导致此问题。任何帮助将不胜感激。