I am new to android and have just made a simple login app using Firebase. The problem is that, I first developed the registration page and then the login page.
Now when i am specifying my LoginActivity in the AndroidManifest it is still calling the RegisterActivity.
I tried invalidating the caches, restarted but nothing is working it is still calling the RegisterActivity rather than LoginActivity
AndroidManifiest file:
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".LoginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".RegisterStudent"></activity>
<activity android:name=".ResetPassword"></activity>
</application>
LoginActivity file:
public class LoginActivity extends AppCompatActivity {
private EditText inputEmail, inputPassword;
private FirebaseAuth auth;
private ProgressBar progressBar;
private Button btnReset;
private TextView btnLogin;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
auth = FirebaseAuth.getInstance();
.....
RegisterActivity file:
public class RegisterStudent extends AppCompatActivity {
private TextInputLayout etStudentName, etStudentEmail, etPassword, etStudentPhone, etFeesPaid, etTotalfees;
private AppCompatSpinner batchesSpinner;
private Button registerStudentBtn;
private FirebaseAuth mAuth;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register_student);
.....
Log Cat:
01-07 01:47:49.582 16643-16643/? I/m.hitech.hitec: Late-enabling -Xcheck:jni
01-07 01:47:49.629 16643-16657/com.hitech.hitech I/m.hitech.hitec: The ClassLoaderContext is a special shared library.
01-07 01:47:49.771 16643-16643/com.hitech.hitech W/m.hitech.hitec: JIT profile information will not be recorded: profile file does not exits.
01-07 01:47:49.773 16643-16643/com.hitech.hitech I/chatty: uid=10187(com.hitech.hitech) identical 10 lines
01-07 01:47:49.773 16643-16643/com.hitech.hitech W/m.hitech.hitec: JIT profile information will not be recorded: profile file does not exits.
01-07 01:47:49.780 16643-16643/com.hitech.hitech I/Perf: Connecting to perf service.
01-07 01:47:49.803 16643-16643/com.hitech.hitech W/m.hitech.hitec: Unsupported class loader
01-07 01:47:49.804 16643-16643/com.hitech.hitech W/m.hitech.hitec: Skipping duplicate class check due to unsupported classloader
01-07 01:47:49.807 16643-16643/com.hitech.hitech W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
01-07 01:47:49.810 16643-16643/com.hitech.hitech W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
01-07 01:47:49.817 16643-16643/com.hitech.hitech I/BiChannelGoogleApi: [FirebaseAuth: ] No Fallback module; NOT setting up for lazy initialization
01-07 01:47:49.823 16643-16660/com.hitech.hitech W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
01-07 01:47:49.827 16643-16660/com.hitech.hitech I/FirebaseAuth: [FirebaseAuth:] Loading module via FirebaseOptions.
01-07 01:47:49.828 16643-16660/com.hitech.hitech I/FirebaseAuth: [FirebaseAuth:] Preparing to create service connection to gms implementation
01-07 01:47:49.841 16643-16643/com.hitech.hitech D/FirebaseAuth: Notifying id token listeners about user ( mfjhDZacBWgG3rjpPB7ZKkTPJQd2 ).
01-07 01:47:49.846 16643-16643/com.hitech.hitech D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
01-07 01:47:49.880 16643-16643/com.hitech.hitech V/FA: Cancelling job. JobID: 915335141
01-07 01:47:49.883 16643-16643/com.hitech.hitech V/FA: Registered activity lifecycle callback
01-07 01:47:49.884 16643-16643/com.hitech.hitech I/FirebaseInitProvider: FirebaseApp initialization successful
01-07 01:47:49.885 16643-16643/com.hitech.hitech I/InstantRun: starting instant run server: is main process
01-07 01:47:49.890 16643-16643/com.hitech.hitech V/Font: Change font:2
01-07 01:47:49.897 16643-16663/com.hitech.hitech V/FA: Collection enabled
01-07 01:47:49.897 16643-16663/com.hitech.hitech V/FA: App package, google app id: com.hitech.hitech, 1:432442387783:android:03d10637e6d05449
01-07 01:47:49.898 16643-16663/com.hitech.hitech I/FA: App measurement is starting up, version: 11717
To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
To enable faster debug mode event logging run:
adb shell setprop debug.firebase.analytics.app com.hitech.hitech
01-07 01:47:49.898 16643-16663/com.hitech.hitech D/FA: Debug-level message logging enabled
01-07 01:47:49.902 16643-16666/com.hitech.hitech E/libc: Access denied finding property "vendor.debug.egl.profiler"
01-07 01:47:49.903 16643-16666/com.hitech.hitech E/libc: Access denied finding property "vendor.debug.prerotation.disable"
01-07 01:47:49.909 16643-16663/com.hitech.hitech V/FA: Connecting to remote service
01-07 01:47:49.914 16643-16663/com.hitech.hitech V/FA: Connection attempt already in progress
01-07 01:47:49.941 16643-16643/com.hitech.hitech V/FA: onActivityCreated
01-07 01:47:49.968 16643-16643/com.hitech.hitech W/m.hitech.hitec: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (light greylist, reflection)
01-07 01:47:49.969 16643-16643/com.hitech.hitech W/m.hitech.hitec: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (light greylist, reflection)
01-07 01:47:50.063 16643-16643/com.hitech.hitech D/FirebaseApp: Notifying auth state listeners.
Notified 0 auth state listeners.
01-07 01:47:50.074 16643-16643/com.hitech.hitech W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy#ca54cf0
01-07 01:47:50.084 16643-16643/com.hitech.hitech V/FA: onActivityCreated
01-07 01:47:50.200 16643-16663/com.hitech.hitech V/FA: Connection attempt already in progress
01-07 01:47:50.201 16643-16663/com.hitech.hitech V/FA: Activity resumed, time: 730786762
01-07 01:47:50.201 16643-16643/com.hitech.hitech D/OpenGLRenderer: Skia GL Pipeline
01-07 01:47:50.202 16643-16663/com.hitech.hitech I/FA: Tag Manager is not found and thus will not be used
01-07 01:47:50.203 16643-16663/com.hitech.hitech D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_screen_class(_sc)=RegisterStudent, firebase_screen_id(_si)=9094250577024489675}]
01-07 01:47:50.219 16643-16663/com.hitech.hitech V/FA: Connection attempt already in progress
01-07 01:47:50.219 16643-16663/com.hitech.hitech D/FA: Connected to remote service
01-07 01:47:50.219 16643-16663/com.hitech.hitech V/FA: Processing queued up service tasks: 4
01-07 01:47:50.273 16643-16657/com.hitech.hitech D/DecorView: onWindowFocusChangedFromViewRoot hasFocus: true, DecorView#182005e[RegisterStudent]
01-07 01:47:50.274 16643-16670/com.hitech.hitech I/Adreno: QUALCOMM build : 0bf40b0, I486bafd568
Build Date : 08/22/18
OpenGL ES Shader Compiler Version: EV031.25.03.00
Local Branch :
Remote Branch : refs/tags/AU_LINUX_ANDROID_LA.UM.7.3.R1.08.00.00.423.039
Remote Branch : NONE
Reconstruct Branch : NOTHING
Build Config : S P 6.0.3 AArch64
01-07 01:47:50.276 16643-16670/com.hitech.hitech E/libc: Access denied finding property "vendor.debug.prerotation.disable"
01-07 01:47:50.277 16643-16670/com.hitech.hitech E/libc: Access denied finding property "ro.vendor.graphics.memory"
Access denied finding property "vendor.debug.prerotation.disable"
Access denied finding property "vendor.debug.prerotation.disable"
01-07 01:47:50.278 16643-16670/com.hitech.hitech I/Adreno: PFP: 0x016ee170, ME: 0x00000000
01-07 01:47:50.278 16643-16670/com.hitech.hitech E/libc: Access denied finding property "vendor.debug.prerotation.disable"
01-07 01:47:50.280 16643-16670/com.hitech.hitech I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 1
android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
01-07 01:47:50.281 16643-16670/com.hitech.hitech I/OpenGLRenderer: Initialized EGL, version 1.4
01-07 01:47:50.281 16643-16670/com.hitech.hitech D/OpenGLRenderer: Swap behavior 2
01-07 01:47:50.285 16643-16670/com.hitech.hitech E/libc: Access denied finding property "vendor.debug.egl.changepixelformat"
01-07 01:47:50.334 16643-16670/com.hitech.hitech E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
01-07 01:47:50.355 16643-16670/com.hitech.hitech E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
01-07 01:47:51.845 16643-16670/com.hitech.hitech E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
01-07 01:47:51.830 16643-16643/com.hitech.hitech W/RenderThread: type=1400 audit(0.0:6573004): avc: denied { read } for name="u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=16956 scontext=u:r:untrusted_app:s0:c187,c256,c512,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=0
01-07 01:47:51.850 16643-16643/com.hitech.hitech W/RenderThread: type=1400 audit(0.0:6573005): avc: denied { read } for name="u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=16956 scontext=u:r:untrusted_app:s0:c187,c256,c512,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=0
01-07 01:47:51.858 16643-16670/com.hitech.hitech E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
01-07 01:47:51.860 16643-16643/com.hitech.hitech W/RenderThread: type=1400 audit(0.0:6573006): avc: denied { read } for name="u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=16956 scontext=u:r:untrusted_app:s0:c187,c256,c512,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=0
01-07 01:47:51.874 16643-16670/com.hitech.hitech E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
01-07 01:47:51.880 16643-16643/com.hitech.hitech W/RenderThread: type=1400 audit(0.0:6573007): avc: denied { read } for name="u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=16956 scontext=u:r:untrusted_app:s0:c187,c256,c512,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=0
01-07 01:47:51.891 16643-16670/com.hitech.hitech E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
01-07 01:47:51.900 16643-16643/com.hitech.hitech W/RenderThread: type=1400 audit(0.0:6573008): avc: denied { read } for name="u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=16956 scontext=u:r:untrusted_app:s0:c187,c256,c512,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=0
01-07 01:47:51.907 16643-16670/com.hitech.hitech E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
01-07 01:47:51.992 16643-16670/com.hitech.hitech I/chatty: uid=10187(com.hitech.hitech) RenderThread identical 5 lines
01-07 01:47:52.007 16643-16670/com.hitech.hitech E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
01-07 01:47:52.024 16643-16670/com.hitech.hitech E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
01-07 01:47:52.090 16643-16670/com.hitech.hitech I/chatty: uid=10187(com.hitech.hitech) RenderThread identical 4 lines
01-07 01:47:52.107 16643-16670/com.hitech.hitech E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
01-07 01:47:55.252 16643-16663/com.hitech.hitech V/FA: Inactivity, disconnecting from the service
01-07 01:48:19.541 16643-16663/com.hitech.hitech V/FA: Recording user engagement, ms: 29340
01-07 01:48:19.542 16643-16663/com.hitech.hitech V/FA: Connecting to remote service
01-07 01:48:19.545 16643-16663/com.hitech.hitech V/FA: Activity paused, time: 730816101
01-07 01:48:19.547 16643-16663/com.hitech.hitech D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=29340, firebase_screen_class(_sc)=RegisterStudent, firebase_screen_id(_si)=9094250577024489675}]
01-07 01:48:19.582 16643-16663/com.hitech.hitech V/FA: Connection attempt already in progress
01-07 01:48:19.582 16643-16663/com.hitech.hitech D/FA: Connected to remote service
01-07 01:48:19.582 16643-16663/com.hitech.hitech V/FA: Processing queued up service tasks: 2
01-07 01:48:24.607 16643-16663/com.hitech.hitech V/FA: Inactivity, disconnecting from the service
01-07 01:48:29.633 16643-16660/com.hitech.hitech I/FirebaseAuth: [FirebaseAuth:] Loading module via FirebaseOptions.
[FirebaseAuth:] Preparing to create service connection to gms implementation
Related
I am trying to open LoginActivity screen from the RegisterActivity screen, but it does not go to LoginActivity and instead it goes to HomeActivity. My plan is to be able to have a register screen and if user has an account already, the user should be able to login by clicking on the link. For my activity_register.xml, I put the link android id as follows: "android:id="#+id/login_link_textview".
AndroidManifest.xml (Updated 2/3/2020)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.kumoapp">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".RegisterActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".LoginActivity"/>
<activity android:name=".HomeActivity"/>
</application>
RegisterActivity.kt
class RegisterActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_register)
register_button_register.setOnClickListener {
performRegister()
}
login_link_textview.setOnClickListener {
Log.d("RegisterActivity", "Try to show login activity")
//launch login
val intent = Intent(this, LoginActivity::class.java)
startActivity(intent)
}
...
LoginActivity.kt
package com.example.kumoapp
import android.content.Intent
import android.os.Bundle
import android.os.PersistableBundle
import android.util.Log
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.google.firebase.auth.FirebaseAuth
import kotlinx.android.synthetic.main.activity_login.*
import kotlinx.android.synthetic.main.activity_register.*
class LoginActivity: AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) {
super.onCreate(savedInstanceState, persistentState)
setContentView(R.layout.activity_login)
initialize()
}
override fun onStart() {
super.onStart()
val mUser = FirebaseAuth.getInstance().currentUser
if(mUser != null)
{
updateUI()
}
}
private fun initialize() {
val email = email_edittext_login.text.toString()
val password = password_edittext_login.text.toString()
login_button.setOnClickListener {
if(email.isNullOrEmpty() || password.isNullOrEmpty())
{
Toast.makeText(this, "Please enter text in email/password", Toast.LENGTH_SHORT).show()
} else {
Log.d("Login", "Attempt login with email/password: $email/***")
FirebaseAuth.getInstance().signInWithEmailAndPassword(email, password)
.addOnCompleteListener(this) {task ->
if (task.isSuccessful) {
Log.d("LoginActivity", "Sign in success")
} else {
Log.e("LoginActivity", "Sign in failed", task.exception)
Toast.makeText(this#LoginActivity, "Authentication failed",
Toast.LENGTH_SHORT).show()
}
}
}
}
back_to_register_textview.setOnClickListener {
Log.d("RegisterActivity", "Try to show login activity")
//launch login
val intent = Intent(this#LoginActivity, RegisterActivity::class.java)
startActivity(intent)
}
}
private fun updateUI() {
val intent = Intent(this#LoginActivity, HomeActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
startActivity(intent)
}
}
Is this a token issue or did I not call LoginActivity properly? Here is the LogCat when I click on the link to open LoginActivity:
2020-02-02 17:26:55.130 8872-8872/? I/example.kumoap: Not late-enabling -Xcheck:jni (already on)
2020-02-02 17:26:55.169 8872-8872/? W/example.kumoap: Unexpected CPU variant for X86 using defaults: x86
2020-02-02 17:26:56.513 8872-8872/com.example.kumoapp V/FA: Registered activity lifecycle callback
2020-02-02 17:26:56.567 8872-8903/com.example.kumoapp W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
2020-02-02 17:26:56.671 8872-8872/com.example.kumoapp D/FirebaseAuth: Notifying id token listeners about user ( fc6IZPVTjfUE3ScqffSaJg2Tpzb2 ).
2020-02-02 17:26:56.720 8872-8872/com.example.kumoapp I/FirebaseInitProvider: FirebaseApp initialization successful
2020-02-02 17:26:56.762 8872-8905/com.example.kumoapp W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
2020-02-02 17:26:56.818 8872-8905/com.example.kumoapp I/FirebaseAuth: [FirebaseAuth:] Preparing to create service connection to gms implementation
2020-02-02 17:26:56.827 8872-8902/com.example.kumoapp V/FA: Collection enabled
2020-02-02 17:26:56.840 8872-8902/com.example.kumoapp V/FA: App package, google app id: com.example.kumoapp, 1:742201828416:android:3ba68c024c12f1520beba5
2020-02-02 17:26:56.849 8872-8902/com.example.kumoapp I/FA: App measurement is starting up, version: 18202
2020-02-02 17:26:56.849 8872-8902/com.example.kumoapp I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
2020-02-02 17:26:56.849 8872-8902/com.example.kumoapp I/FA: To enable faster debug mode event logging run:
adb shell setprop debug.firebase.analytics.app com.example.kumoapp
2020-02-02 17:26:56.849 8872-8902/com.example.kumoapp D/FA: Debug-level message logging enabled
2020-02-02 17:26:56.889 8872-8872/com.example.kumoapp V/FA: onActivityCreated
2020-02-02 17:26:56.993 8872-8902/com.example.kumoapp V/FA: Connecting to remote service
2020-02-02 17:26:57.059 8872-8902/com.example.kumoapp V/FA: Connection attempt already in progress
2020-02-02 17:26:57.073 8872-8872/com.example.kumoapp W/example.kumoap: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (light greylist, reflection)
2020-02-02 17:26:57.074 8872-8872/com.example.kumoapp W/example.kumoap: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (light greylist, reflection)
2020-02-02 17:26:57.276 8872-8902/com.example.kumoapp V/FA: Activity resumed, time: 7703380
2020-02-02 17:26:57.291 8872-8872/com.example.kumoapp D/OpenGLRenderer: HWUI GL Pipeline
2020-02-02 17:26:57.312 8872-8902/com.example.kumoapp I/FA: Tag Manager is not found and thus will not be used
2020-02-02 17:26:57.331 8872-8902/com.example.kumoapp D/FA: Logging event (FE): screen_view(_vs), Bundle[{ga_event_origin(_o)=auto, ga_screen_class(_sc)=RegisterActivity, ga_screen_id(_si)=-6615119760841562676}]
2020-02-02 17:26:57.418 8872-8912/com.example.kumoapp D/HostConnection: HostConnection::get() New Host Connection established 0xe1d2e5a0, tid 8912
2020-02-02 17:26:57.422 8872-8912/com.example.kumoapp D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_2
2020-02-02 17:26:57.446 8872-8912/com.example.kumoapp I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
2020-02-02 17:26:57.447 8872-8912/com.example.kumoapp I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
2020-02-02 17:26:57.447 8872-8912/com.example.kumoapp I/OpenGLRenderer: Initialized EGL, version 1.4
2020-02-02 17:26:57.447 8872-8912/com.example.kumoapp D/OpenGLRenderer: Swap behavior 1
2020-02-02 17:26:57.447 8872-8912/com.example.kumoapp W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2020-02-02 17:26:57.447 8872-8912/com.example.kumoapp D/OpenGLRenderer: Swap behavior 0
2020-02-02 17:26:57.456 8872-8912/com.example.kumoapp D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 0 0
2020-02-02 17:26:57.456 8872-8912/com.example.kumoapp D/EGL_emulation: eglCreateContext: 0xe1d048a0: maj 2 min 0 rcv 2
2020-02-02 17:26:57.490 8872-8912/com.example.kumoapp D/EGL_emulation: eglMakeCurrent: 0xe1d048a0: ver 2 0 (tinfo 0xe1d03900)
2020-02-02 17:26:57.497 8872-8902/com.example.kumoapp V/FA: Connection attempt already in progress
2020-02-02 17:26:57.498 8872-8902/com.example.kumoapp V/FA: Connection attempt already in progress
2020-02-02 17:26:57.545 8872-8912/com.example.kumoapp D/HostConnection: createUnique: call
2020-02-02 17:26:57.546 8872-8912/com.example.kumoapp D/HostConnection: HostConnection::get() New Host Connection established 0xe1d2e8c0, tid 8912
2020-02-02 17:26:57.550 8872-8912/com.example.kumoapp D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_2
2020-02-02 17:26:57.550 8872-8912/com.example.kumoapp E/eglCodecCommon: GoldfishAddressSpaceHostMemoryAllocator: ioctl_ping failed for device_type=5, ret=-1
2020-02-02 17:26:57.567 8872-8912/com.example.kumoapp D/EGL_emulation: eglMakeCurrent: 0xe1d048a0: ver 2 0 (tinfo 0xe1d03900)
2020-02-02 17:26:57.685 8872-8902/com.example.kumoapp D/FA: Connected to remote service
2020-02-02 17:26:57.688 8872-8902/com.example.kumoapp V/FA: Processing queued up service tasks: 4
2020-02-02 17:27:03.018 8872-8902/com.example.kumoapp V/FA: Inactivity, disconnecting from the service
2020-02-02 17:27:08.793 8872-8872/com.example.kumoapp D/RegisterActivity: Try to show login activity
2020-02-02 17:27:08.815 8872-8902/com.example.kumoapp V/FA: Recording user engagement, ms: 11536
2020-02-02 17:27:08.827 8872-8902/com.example.kumoapp V/FA: Connecting to remote service
2020-02-02 17:27:08.829 8872-8872/com.example.kumoapp W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy#27f7682
2020-02-02 17:27:08.848 8872-8872/com.example.kumoapp V/FA: onActivityCreated
2020-02-02 17:27:08.848 8872-8902/com.example.kumoapp V/FA: Activity paused, time: 7714915
2020-02-02 17:27:08.873 8872-8902/com.example.kumoapp D/FA: Logging event (FE): user_engagement(_e), Bundle[{ga_event_origin(_o)=auto, engagement_time_msec(_et)=11536, ga_screen_class(_sc)=RegisterActivity, ga_screen_id(_si)=-6615119760841562676}]
2020-02-02 17:27:08.966 8872-8902/com.example.kumoapp V/FA: Connection attempt already in progress
2020-02-02 17:27:08.966 8872-8902/com.example.kumoapp V/FA: Activity resumed, time: 7715017
2020-02-02 17:27:09.032 8872-8872/com.example.kumoapp W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy#59e5739
2020-02-02 17:27:09.036 8872-8902/com.example.kumoapp D/FA: Logging event (FE): screen_view(_vs), Bundle[{ga_event_origin(_o)=auto, ga_previous_class(_pc)=RegisterActivity, ga_previous_id(_pi)=-6615119760841562676, ga_screen_class(_sc)=LoginActivity, ga_screen_id(_si)=-6615119760841562675}]
2020-02-02 17:27:09.043 8872-8872/com.example.kumoapp V/FA: onActivityCreated
2020-02-02 17:27:09.118 8872-8902/com.example.kumoapp V/FA: Connection attempt already in progress
2020-02-02 17:27:09.119 8872-8902/com.example.kumoapp V/FA: Connection attempt already in progress
2020-02-02 17:27:09.119 8872-8902/com.example.kumoapp V/FA: Screen exposed for less than 1000 ms. Event not sent. time: 208
2020-02-02 17:27:09.120 8872-8902/com.example.kumoapp V/FA: Connection attempt already in progress
2020-02-02 17:27:09.120 8872-8902/com.example.kumoapp V/FA: Activity paused, time: 7715038
2020-02-02 17:27:09.124 8872-8912/com.example.kumoapp D/EGL_emulation: eglMakeCurrent: 0xe1d048a0: ver 2 0 (tinfo 0xe1d03900)
2020-02-02 17:27:09.138 8872-8902/com.example.kumoapp V/FA: Activity resumed, time: 7715196
2020-02-02 17:27:09.177 8872-8902/com.example.kumoapp D/FA: Logging event (FE): screen_view(_vs), Bundle[{ga_event_origin(_o)=auto, ga_previous_class(_pc)=LoginActivity, ga_previous_id(_pi)=-6615119760841562675, ga_screen_class(_sc)=HomeActivity, ga_screen_id(_si)=-6615119760841562674}]
2020-02-02 17:27:09.284 8872-8912/com.example.kumoapp D/EGL_emulation: eglMakeCurrent: 0xe1d048a0: ver 2 0 (tinfo 0xe1d03900)
2020-02-02 17:27:09.437 8872-8902/com.example.kumoapp V/FA: Connection attempt already in progress
2020-02-02 17:27:09.437 8872-8902/com.example.kumoapp V/FA: Connection attempt already in progress
2020-02-02 17:27:09.438 8872-8902/com.example.kumoapp D/FA: Connected to remote service
2020-02-02 17:27:09.440 8872-8902/com.example.kumoapp V/FA: Processing queued up service tasks: 7
2020-02-02 17:27:14.585 8872-8902/com.example.kumoapp V/FA: Inactivity, disconnecting from the service
Maybe there is something wrong with login_activity.xml ? I am still learning how to design layout, so my xml might not be the best you have seen.
<com.google.android.flexbox.FlexboxLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:flexWrap="wrap"
app:alignItems="stretch"
app:alignContent="stretch"
app:justifyContent="center"
android:background="#android:color/holo_blue_light"
tools:context=".LoginActivity"
>
<LinearLayout
android:orientation="vertical"
android:background="#android:color/holo_green_light"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_alignSelf="flex_start"
android:padding="16dp"
>
<TextView
android:text="#string/app_name"
android:textColor="#android:color/white"
android:layout_gravity="center"
android:textSize="30sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
<EditText
android:id="#+id/email_edittext_login"
android:ems="10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:background="#android:color/white"
android:hint="Email"
android:inputType="textEmailAddress"
app:layout_flexBasisPercent="90%"
/>
<EditText
android:id="#+id/password_edittext_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:layout_below="#id/email_edittext_login"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:background="#android:color/white"
android:hint="Password"
android:inputType="textPassword"
app:layout_flexBasisPercent="90%"
/>
<Button
android:id="#+id/login_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/password_edittext_login"
android:layout_marginTop="24dp"
android:layout_marginBottom="24dp"
android:padding="12dp"
app:layout_flexBasisPercent="90%"
android:text="Login" />
<TextView
android:id="#+id/back_to_register_textview"
android:layout_below="#id/login_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="75dp"
android:gravity="center"
android:textSize="16dip"
android:text="Register an Account" />
</com.google.android.flexbox.FlexboxLayout>
Launcher is the one activity that starts your application, the rest should be default not Launcher like you did.
Try this and check:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.kumoapp">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".RegisterActivity"/>
<activity android:name=".LoginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".HomeActivity"/>
</application>
In RegisterActivity.kt
login_link_textview.setOnClickListener {
val intent = Intent(this#RegisterActivity, LoginActivity::class.java)
startActivity(intent)
}
I faced infinite run when I am trying using ListView with retrieving data from firebase, and I don't know how can I solve it.
My main goal is retrieving from firebase with a dynamic number of clients who have a status of "Not approved".
This my RUN
10/03 21:30:58: Launching app $ adb shell am start -n
"com.example.atheer.booklyv1/com.example.atheer.booklyv1.MainActivity"
-a android.intent.action.MAIN -c android.intent.category.LAUNCHER Client not ready yet..Waiting for process to come online Connected to
process 8309 on device emulator-5554 Capturing and displaying logcat
messages from application. This behavior can be disabled in the
"Logcat output" section of the "Debugger" settings page.
W/atheer.booklyv: JIT profile information will not be recorded:
profile file does not exits. I/chatty:
uid=10086(com.example.atheer.booklyv1) identical 10 lines
W/atheer.booklyv: JIT profile information will not be recorded:
profile file does not exits. W/atheer.booklyv: Unsupported class
loader W/atheer.booklyv: Skipping duplicate class check due to
unsupported classloader W/DynamiteModule: Local module descriptor
class for com.google.firebase.auth not found. W/DynamiteModule: Local
module descriptor class for com.google.firebase.auth not found.
W/atheer.booklyv: Verification of android.content.Intent
com.google.android.gms.common.zzf.zza(android.content.Context, int,
java.lang.String) took 130.356ms I/BiChannelGoogleApi: [FirebaseAuth:
] No Fallback module; NOT setting up for lazy initialization
D/FirebaseAuth: Notifying id token listeners about user (
N72Vpxaf6dao4pSf5cvBJ1jwzGo2 ). D/FirebaseApp:
com.google.firebase.crash.FirebaseCrash is not linked. Skipping
initialization. V/FA: Cancelling job. JobID: -1422956107 V/FA:
Registered activity lifecycle callback I/FirebaseInitProvider:
FirebaseApp initialization successful I/InstantRun: starting instant
run server: is main process V/FA: Collection enabled V/FA: App
package, google app id: com.example.atheer.booklyv1,
1:666514046827:android:60ad4570c33e1aec I/FA: App measurement is
starting up, version: 11910
To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
To enable faster debug mode event logging run:
adb shell setprop debug.firebase.analytics.app com.example.atheer.booklyv1 D/FA: Debug-level message logging enabled
W/DynamiteModule: Local module descriptor class for
com.google.firebase.auth not found. V/FA: onActivityCreated V/FA:
Connecting to remote service I/FirebaseAuth: [FirebaseAuth:] Loading
module via FirebaseOptions.
[FirebaseAuth:] Preparing to create service connection to gms implementation V/FA: Connection attempt already in progress
W/atheer.booklyv: Accessing hidden method
Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z
(light greylist, reflection) W/atheer.booklyv: Accessing hidden method
Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (light
greylist, reflection) D/OpenGLRenderer: Skia GL Pipeline V/FA:
Connection attempt already in progress
Activity resumed, time: 1574868 I/FA: Tag Manager is not found and thus will not be used D/FirebaseApp: Notifying auth state
listeners. D/FirebaseApp: Notified 0 auth state listeners. D/FA:
Logging event (FE): screen_view(_vs),
Bundle[{firebase_event_origin(_o)=auto,
firebase_screen_class(_sc)=MainActivity,
firebase_screen_id(_si)=5185910341027462403}] D/:
HostConnection::get() New Host Connection established 0xdeffec40, tid
8354 I/ConfigStore:
android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay
retrieved: 0
android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay
retrieved: 0 I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Swap behavior 1 W/OpenGLRenderer: Failed to choose
config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/OpenGLRenderer: Swap behavior 0 D/EGL_emulation: eglCreateContext:
0xcc20f240: maj 3 min 0 rcv 3 D/EGL_emulation: eglMakeCurrent:
0xcc20f240: ver 3 0 (tinfo 0xe2730c60) D/EGL_emulation:
eglMakeCurrent: 0xcc20f240: ver 3 0 (tinfo 0xe2730c60) V/FA:
Connection attempt already in progress D/FA: Connected to remote
service V/FA: Processing queued up service tasks: 4 V/StudioProfiler:
StudioProfilers agent attached. V/StudioProfiler: Acquiring
Application for Events V/StudioProfiler: Transformed class:
java/net/URL W/atheer.booklyv: Current dex file has more than one
class in it. Calling RetransformClasses on this class might fail if no
transformations are applied to it! V/StudioProfiler: Memory control
stream started. V/StudioProfiler: Live memory tracking disabled.
V/StudioProfiler: Live memory tracking enabled.
JNIEnv not attached V/StudioProfiler: Loaded classes: 11553 V/StudioProfiler: Tracking initialization took:
410566000ns W/ActivityThread: handleWindowVisibility: no activity for
token android.os.BinderProxy#f188cbd V/FA: Recording user engagement,
ms: 4164 V/FA: Activity paused, time: 1579010 V/FA: onActivityCreated
I/atheer.booklyv: Background concurrent copying GC freed 662(4MB)
AllocSpace objects, 0(0B) LOS objects, 49% free, 3MB/6MB, paused
1.122ms total 328.178ms D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto,
engagement_time_msec(_et)=4164,
firebase_screen_class(_sc)=MainActivity,
firebase_screen_id(_si)=5185910341027462403}] V/FA: Activity resumed,
time: 1580197 D/FA: Logging event (FE): screen_view(_vs),
Bundle[{firebase_event_origin(_o)=auto,
firebase_previous_class(_pc)=MainActivity,
firebase_previous_id(_pi)=5185910341027462403,
firebase_screen_class(_sc)=mHomePage,
firebase_screen_id(_si)=5185910341027462404}] D/EGL_emulation:
eglMakeCurrent: 0xcc20f240: ver 3 0 (tinfo 0xe2730c60)
W/ActivityThread: handleWindowVisibility: no activity for token
android.os.BinderProxy#877a26c V/FA: Recording user engagement, ms:
4828 V/FA: Activity paused, time: 1585022 V/FA: onActivityCreated
D/FA: Logging event (FE): user_engagement(_e),
Bundle[{firebase_event_origin(_o)=auto,
engagement_time_msec(_et)=4828, firebase_screen_class(_sc)=mHomePage,
firebase_screen_id(_si)=5185910341027462404}] I/DynamiteModule:
Considering local module com.google.android.gms.firebase_database:4
and remote module com.google.android.gms.firebase_database:6
Selected remote version of com.google.android.gms.firebase_database, version >= 6 V/FA: Activity
resumed, time: 1585685 I/Choreographer: Skipped 37 frames! The
application may be doing too much work on its main thread.
W/atheer.booklyv: Unsupported class loader W/atheer.booklyv: Skipping
duplicate class check due to unsupported classloader D/FA: Logging
event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto,
firebase_previous_class(_pc)=mHomePage,
firebase_previous_id(_pi)=5185910341027462404,
firebase_screen_class(_sc)=loginActivity,
firebase_screen_id(_si)=5185910341027462405}] I/OpenGLRenderer: Davey!
duration=916ms; Flags=1, IntendedVsync=1585088907737,
Vsync=1585705574379, OldestInputEvent=9223372036854775807,
NewestInputEvent=0, HandleInputStart=1585721516670,
AnimationStart=1585721565670, PerformTraversalsStart=1585722412670,
DrawStart=1586003516670, SyncQueued=1586003568670,
SyncStart=1586003659670, IssueDrawCommandsStart=1586003710670,
SwapBuffers=1586004070670, FrameCompleted=1586005330670,
DequeueBufferDuration=162000, QueueBufferDuration=300000,
D/EGL_emulation: eglMakeCurrent: 0xcc20f240: ver 3 0 (tinfo
0xe2730c60) D/NetworkSecurityConfig: No Network Security Config
specified, using platform default I/AssistStructure: Flattened final
assist data: 3404 bytes, containing 1 windows, 11 views V/FA:
Inactivity, disconnecting from the service I/AssistStructure:
Flattened final assist data: 3428 bytes, containing 1 windows, 11
views W/BiChannelGoogleApi: [FirebaseAuth: ] getGoogleApiForMethod()
returned Gms D/FirebaseAuth: Notifying id token listeners about user (
N72Vpxaf6dao4pSf5cvBJ1jwzGo2 ). D/FirebaseApp: Notifying auth state
listeners. D/FirebaseApp: Notified 1 auth state listeners. V/FA:
Recording user engagement, ms: 21363 V/FA: Connecting to remote
service W/ActivityThread: handleWindowVisibility: no activity for
token android.os.BinderProxy#48f31b0 V/FA: Activity paused, time:
1607047 D/FA: Logging event (FE): user_engagement(_e),
Bundle[{firebase_event_origin(_o)=auto,
engagement_time_msec(_et)=21363,
firebase_screen_class(_sc)=loginActivity,
firebase_screen_id(_si)=5185910341027462405}] V/FA: onActivityCreated
V/FA: Connection attempt already in progress I/atheer.booklyv:
NativeAlloc concurrent copying GC freed 25494(1649KB) AllocSpace
objects, 19(632KB) LOS objects, 50% free, 3MB/7MB, paused 580us total
742.771ms V/FA: Connection attempt already in progress V/FA: Activity resumed, time: 1608103 D/FA: Logging event (FE): screen_view(_vs),
Bundle[{firebase_event_origin(_o)=auto,
firebase_previous_class(_pc)=loginActivity,
firebase_previous_id(_pi)=5185910341027462405,
firebase_screen_class(_sc)=dashboardAdmin,
firebase_screen_id(_si)=5185910341027462406}] D/EGL_emulation:
eglMakeCurrent: 0xcc20f240: ver 3 0 (tinfo 0xe2730c60) V/FA:
Connection attempt already in progress D/FA: Connected to remote
service V/FA: Processing queued up service tasks: 4 W/ActivityThread:
handleWindowVisibility: no activity for token
android.os.BinderProxy#7f475a4 V/FA: Recording user engagement, ms:
5136 V/FA: Activity paused, time: 1613235 D/FA: Logging event (FE):
user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto,
engagement_time_msec(_et)=5136,
firebase_screen_class(_sc)=dashboardAdmin,
firebase_screen_id(_si)=5185910341027462406}] V/FA: onActivityCreated
V/FA: Activity resumed, time: 1613594 D/FA: Logging event (FE):
screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto,
firebase_previous_class(_pc)=dashboardAdmin,
firebase_previous_id(_pi)=5185910341027462406,
firebase_screen_class(_sc)=approvedAdmin,
firebase_screen_id(_si)=5185910341027462407}] D/EGL_emulation:
eglMakeCurrent: 0xcc20f240: ver 3 0 (tinfo 0xe2730c60)
D/EGL_emulation: eglMakeCurrent: 0xcc20f240: ver 3 0 (tinfo
0xe2730c60) W/atheer.booklyv: Long wait of 5.943ms for
Thread[1,tid=8309,Native,Thread*=0xe6674000,peer=0x738f9ec8,"main"]
suspension! D/EGL_emulation: eglMakeCurrent: 0xcc20f240: ver 3 0
(tinfo 0xe2730c60) D/EGL_emulation: eglMakeCurrent: 0xcc20f240: ver 3
0 (tinfo 0xe2730c60) D/EGL_emulation: eglMakeCurrent: 0xcc20f240: ver
3 0 (tinfo 0xe2730c60) V/FA: Inactivity, disconnecting from the
service E/StudioProfiler: JVMTI error:
15(JVMTI_ERROR_THREAD_NOT_ALIVE) I/chatty:
uid=10086(com.example.atheer.booklyv1) Binder:8309_5 identical 3 lines
E/StudioProfiler: JVMTI error: 15(JVMTI_ERROR_THREAD_NOT_ALIVE)
I/FirebaseAuth: [FirebaseAuth:] Loading module via FirebaseOptions.
I/FirebaseAuth: [FirebaseAuth:] Preparing to create service connection
to gms implementation
And this is my java code
package com.example.atheer.booklyv1;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import com.google.firebase.database.ChildEventListener;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import java.util.ArrayList;
import java.util.Map;
public class approvedAdmin extends AppCompatActivity implements View.OnClickListener{
DatabaseReference dref;
ListView listview;
ArrayList<String> list=new ArrayList<>();
ArrayAdapter<String> adapter;
public approvedAdmin() {
}
#Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_approved_admin);
listview=(ListView)findViewById(R.id.list);
dref= FirebaseDatabase.getInstance().getReference("client");
// adapter.notifyDataSetChanged();
dref.addChildEventListener(new ChildEventListener() {
#Override
public void onChildAdded(DataSnapshot dataSnapshot, String s) {
String status;
String name;
String email;
Toast.makeText(approvedAdmin.this, "ok", Toast.LENGTH_SHORT).show();
for(DataSnapshot ds: dataSnapshot.getChildren() ){
if (ds.hasChild("Status")){
status=ds.child("Status").getValue(String.class);
if (status.equalsIgnoreCase("Not approved")){
name= ds.child("name").getValue(String.class);
list.add(name);
adapter= new ArrayAdapter<String>(approvedAdmin.this, android.R.layout.simple_list_item_1, list);
listview.setAdapter(adapter);
}}
}}
#Override
public void onChildChanged(DataSnapshot dataSnapshot, String s) {
}
#Override
public void onChildRemoved(DataSnapshot dataSnapshot) {
}
#Override
public void onChildMoved(DataSnapshot dataSnapshot, String s) {
}
#Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
#Override
public void onClick(View v) {
}
}
And this is my xml code
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".approvedAdmin">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:orientation="vertical"
android:paddingLeft="15dp"
android:paddingRight="15dp">
<ListView
android:id="#android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
You need to move out setting up adapter code out from for loop, like below
for(DataSnapshot ds: dataSnapshot.getChildren() ){
if (ds.hasChild("Status")){
status=ds.child("Status").getValue(String.class);
if (status.equalsIgnoreCase("Not approved")){
name= ds.child("name").getValue(String.class);
list.add(name);
}
}
}
adapter= new ArrayAdapter<String>(approvedAdmin.this, android.R.layout.simple_list_item_1, list);
listview.setAdapter(adapter);
You also need to change the listview id from android:id="#android:id/list" to android:id="#+id/list"
This is the code I use to connect and write to the database (I want to create a new child node userand assign the value alex to it.
DatabaseReference mDatabase = FirebaseDatabase.getInstance().getReference();
mDatabase.child("user").setValue("alex");
Note: I have followed the correct set-up instructions and have changed the authorisation of read and write to true. The code was working for about a month but now I can't figure out why its not writing to the database.
Below is my logcat
03-12 14:43:38.882 12158-12158/? I/art: Late-enabling -Xcheck:jni
03-12 14:43:38.900 12158-12165/? I/art: Debugger is no longer active
03-12 14:43:38.900 12158-12165/? I/art: Starting a blocking GC Instrumentation
03-12 14:43:38.923 12158-12158/? W/System: ClassLoader referenced unknown path: /data/app/anaysingh.anaytyproject-1/lib/arm
03-12 14:43:38.932 12158-12158/? I/InstantRun: Instant Run Runtime started. Android package is anaysingh.anaytyproject, real application class is null.
03-12 14:43:39.090 12158-12158/? W/System: ClassLoader referenced unknown path: /data/app/anaysingh.anaytyproject-1/lib/arm
03-12 14:43:39.127 12158-12158/? D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
03-12 14:43:39.136 12158-12158/? D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
03-12 14:43:39.247 12158-12158/? V/FA: Cancelling job. JobID: -129726599
03-12 14:43:39.253 12158-12158/? V/FA: Registered activity lifecycle callback
03-12 14:43:39.255 12158-12158/? I/FirebaseInitProvider: FirebaseApp initialization successful
03-12 14:43:39.264 12158-12174/? V/FA: Collection enabled
03-12 14:43:39.264 12158-12174/? V/FA: App package, google app id: anaysingh.anaytyproject, 1:1025179625916:android:afeaaa816280de9a
03-12 14:43:39.266 12158-12174/? I/FA: App measurement is starting up, version: 11910
03-12 14:43:39.266 12158-12174/? I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
03-12 14:43:39.266 12158-12174/? I/FA: To enable faster debug mode event logging run:
adb shell setprop debug.firebase.analytics.app anaysingh.anaytyproject
03-12 14:43:39.266 12158-12174/? D/FA: Debug-level message logging enabled
03-12 14:43:39.278 12158-12174/? V/FA: Connecting to remote service
03-12 14:43:39.293 12158-12174/? V/FA: Connection attempt already in progress
03-12 14:43:39.379 12158-12158/? W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
03-12 14:43:39.384 12158-12158/? V/FA: onActivityCreated
03-12 14:43:39.534 12158-12158/? D/Connection: https://anaytyproject.firebaseio.com/Nigga
03-12 14:43:39.551 12158-12174/? V/FA: Connection attempt already in progress
03-12 14:43:39.556 12158-12174/? I/FA: Tag Manager is not found and thus will not be used
03-12 14:43:39.557 12158-12174/? D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=-4541290412013862895}]
03-12 14:43:39.559 12158-12177/? I/DynamiteModule: Considering local module com.google.android.gms.firebase_database:4 and remote module com.google.android.gms.firebase_database:6
03-12 14:43:39.559 12158-12177/? I/DynamiteModule: Selected remote version of com.google.android.gms.firebase_database, version >= 6
03-12 14:43:39.566 12158-12177/? W/System: ClassLoader referenced unknown path:
03-12 14:43:39.573 12158-12174/? V/FA: Connection attempt already in progress
03-12 14:43:39.574 12158-12174/? V/FA: Activity resumed, time: 4225355
03-12 14:43:39.582 12158-12177/? W/System: ClassLoader referenced unknown path: /data/user_de/0/com.google.android.gms/app_chimera/m/0000004c/n/armeabi-v7a
03-12 14:43:39.582 12158-12177/? W/System: ClassLoader referenced unknown path: /data/user_de/0/com.google.android.gms/app_chimera/m/0000004c/n/armeabi
03-12 14:43:39.604 12158-12178/? I/Adreno: QUALCOMM build : bc479b6, I15255e4b4a
Build Date : 02/22/17
OpenGL ES Shader Compiler Version: XE031.09.00.03
Local Branch :
Remote Branch : refs/tags/AU_LINUX_ANDROID_LA.UM.5.5.R1.07.00.00.269.019
Remote Branch : NONE
Reconstruct Branch : NOTHING
03-12 14:43:39.608 12158-12178/? I/OpenGLRenderer: Initialized EGL, version 1.4
03-12 14:43:39.608 12158-12178/? D/OpenGLRenderer: Swap behavior 1
03-12 14:43:39.625 12158-12179/? D/NetworkSecurityConfig: No Network Security Config specified, using platform default
03-12 14:43:39.659 12158-12174/? D/FA: Connected to remote service
03-12 14:43:39.660 12158-12174/? V/FA: Processing queued up service tasks: 4
03-12 14:43:44.701 12158-12174/anaysingh.anaytyproject V/FA: Inactivity, disconnecting from the service
03-12 14:43:56.840 12158-12174/anaysingh.anaytyproject V/FA: Recording user engagement, ms: 17290
03-12 14:43:56.840 12158-12174/anaysingh.anaytyproject V/FA: Connecting to remote service
03-12 14:43:56.842 12158-12174/anaysingh.anaytyproject V/FA: Activity paused, time: 4242644
03-12 14:43:56.844 12158-12174/anaysingh.anaytyproject D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=17290, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=-4541290412013862895}]
03-12 14:43:56.852 12158-12174/anaysingh.anaytyproject V/FA: Connection attempt already in progress
03-12 14:43:56.852 12158-12174/anaysingh.anaytyproject D/FA: Connected to remote service
03-12 14:43:56.852 12158-12174/anaysingh.anaytyproject V/FA: Processing queued up service tasks: 2
What am I doing wrong, my firebase database still shows null. However when I add data manually and read via JS it is working correctly.
The errors tell you that you haven't linked Firebase to your project.
03-12 14:43:39.127 12158-12158/? D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
03-12 14:43:39.136 12158-12158/? D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
Use the Firebase Assistant to set it up:
To open the Firebase Assistant in Android Studio:
Click Tools > Firebase to open the Assistant window.
Click to expand one of the listed features (for example, Analytics), then click the provided tutorial link (for example, Log an Analytics event).
Click the Connect to Firebase button to connect to Firebase and add the necessary code to your app.
Full documentation here.
I was not able to find here solution to read/write problem on Android File manager application I am trying to create. When running on real device, I am not able to delete a file from SD card.
Could anyone guide me, what am I doing wrong and how to fix the permissions?
I have added read/write permissions to AndroidManifest.xml
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
but anyway, I am getting this error message:
avc: denied { read } for name="/" dev="rootfs" ino=1 scontext=u:r:untrusted_app
for dependencies I am using:
compile 'org.apache.directory.studio:org.apache.commons.io:2.4'
Full LogCat:
02-28 10:59:49.740 12067-12067/? W/art: Unexpected CPU variant for X86 using defaults: x86_64
02-28 10:59:49.765 12067-12067/? W/System: ClassLoader referenced unknown path: /data/app/com.example.filemanager-1/lib/x86_64
02-28 10:59:49.770 12067-12067/? I/InstantRun: Instant Run Runtime started. Android package is com.example.filemanager, real application class is com.example.filemanager.FileManager.
02-28 10:59:49.797 12067-12074/? E/art: Failed writing handshake bytes (-1 of 14): Broken pipe
02-28 10:59:49.797 12067-12074/? I/art: Debugger is no longer active
02-28 10:59:49.797 12067-12074/? I/art: Starting a blocking GC Instrumentation
02-28 10:59:50.284 12067-12067/? W/System: ClassLoader referenced unknown path: /data/app/com.example.filemanager-1/lib/x86_64
02-28 10:59:50.337 12067-12067/? W/ini.filemanager: type=1400 audit(0.0:27): avc: denied { read } for name="/" dev="rootfs" ino=1 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0
[ 02-28 10:59:50.356 12067:12067 W/ ]
Process pipe failed
02-28 10:59:50.376 12067-12089/? I/OpenGLRenderer: Initialized EGL, version 1.4
02-28 10:59:50.376 12067-12089/? D/OpenGLRenderer: Swap behavior 1
02-28 10:59:50.390 12067-12089/? E/EGL_emulation: tid 12089: eglSurfaceAttrib(1174): error 0x3009 (EGL_BAD_MATCH)
02-28 10:59:50.390 12067-12089/? W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x76656d668840, error=EGL_BAD_MATCH
I am developing an app using Android Studio.
The problem is that app gets crashed twice within few minutes of running it and besides Application terminated. and normal logs no error is shown in the logcat.
Here's complete logcat:
02/12 22:31:34: Launching app
Cold swapped changes.
$ adb shell am start -n "com.abc.xxx/com.abc.xxx.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 13399 on device micromax-micromax_aq4502-2864004C04884I2
I/art: Late-enabling -Xcheck:jni
W/System: ClassLoader referenced unknown path: /data/app/com.abc.xxx-2/lib/arm
I/InstantRun: Instant Run Runtime started. Android package is com.abc.xxx, real application class is null.
W/System: ClassLoader referenced unknown path: /data/app/com.abc.xxx-2/lib/arm
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
I/art: Background sticky concurrent mark sweep GC freed 11281(1218KB) AllocSpace objects, 22(696KB) LOS objects, 15% free, 5MB/6MB, paused 13.077ms total 70.659ms
I/DynamiteModule: Considering local module com.google.android.gms.flags:2 and remote module com.google.android.gms.flags:0
I/DynamiteModule: Selected local version of com.google.android.gms.flags
W/DynamiteModule: Local module descriptor class for com.google.android.gms.crash not found.
I/DynamiteModule: Considering local module com.google.android.gms.crash:0 and remote module com.google.android.gms.crash:4
I/DynamiteModule: Selected remote version of com.google.android.gms.crash, version >= 4
W/System: ClassLoader referenced unknown path: /data/user/0/com.google.android.gms/app_chimera/m/00000012/n/armeabi-v7a
W/System: ClassLoader referenced unknown path: /data/user/0/com.google.android.gms/app_chimera/m/00000012/n/armeabi
I/FirebaseCrashApiImpl: FirebaseCrashApiImpl created by ClassLoader p[DexPathList[[zip file "/data/data/com.google.android.gms/app_chimera/m/00000012/DynamiteModulesC_GmsCore_prodmnc_hdpi_release.apk"],nativeLibraryDirectories=[/data/user/0/com.google.android.gms/app_chimera/m/00000012/n/armeabi-v7a, /data/user/0/com.google.android.gms/app_chimera/m/00000012/n/armeabi, /vendor/lib, /system/lib]]]
I/DynamiteModule: Considering local module com.google.android.gms.flags:2 and remote module com.google.android.gms.flags:0
I/DynamiteModule: Selected local version of com.google.android.gms.flags
W/DynamiteModule: Local module descriptor class for com.google.android.gms.crash not found.
I/FA: App measurement is starting up, version: 10084
I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
D/FA: Debug-level message logging enabled
D/FA: AppMeasurement singleton hash: 198168520
V/FA: Collection enabled
V/FA: App package, google app id: com.abc.xxx, 1:987905869088:android:e7f50263e7b8aa58
I/FA: To enable faster debug mode event logging run:
adb shell setprop debug.firebase.analytics.app com.getsportalapp.sportal
V/FA: Registered activity lifecycle callback
I/FirebaseCrash: FirebaseCrash reporting initialized com.google.android.gms.internal.zzbks#e551d72
I/FirebaseInitProvider: FirebaseApp initialization successful
V/FA: Using measurement service
V/FA: Connecting to remote service
W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
W/com.facebook.appevents.AppEventsLogger: activateApp events are being logged automatically. There's no need to call activateApp explicitly, this is safe to remove.
I/GAC: Building GoogleApiClient
I/CrashlyticsCore: Initializing Crashlytics 2.3.15.167
V/FA: Connection attempt already in progress
V/FA: Activity resumed, time: 824779068
D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: false
D/signedIn: onAuthStateChanged:signed_in:ShXMXdc5kHUQZWG3lGudJtt2
I/DynamiteModule: Considering local module com.google.android.gms.firebase_database:4 and remote module com.google.android.gms.firebase_database:5
I/DynamiteModule: Selected remote version of com.google.android.gms.firebase_database, version >= 5
I/OpenGLRenderer: Initialized EGL, version 1.4
I/MaliEGL: [Mali]window_type=1, is_framebuffer=0, errnum = 0
I/MaliEGL: [Mali]surface->num_buffers=4, surface->num_frames=3, win_min_undequeued=1
I/MaliEGL: [Mali]max_allowed_dequeued_buffers=3
E/RecyclerView: No adapter attached; skipping layout
D/FA: Connected to remote service
V/FA: Processing queued up service tasks: 2
E/RecyclerView: No adapter attached; skipping layout
D/getInvitation: getInvitation: no deep link found.
D/called: again
D/cLat: 2.8418744
D/cLng: 8.7791019
I/MaliEGL: [Mali]window_type=1, is_framebuffer=0, errnum = 0
I/MaliEGL: [Mali]surface->num_buffers=4, surface->num_frames=3, win_min_undequeued=1
I/MaliEGL: [Mali]max_allowed_dequeued_buffers=3
W/PersistentConnection: pc_0 - Using an unspecified index. Consider adding '".indexOn": "g"' at geofire to your security and Firebase Database rules for better performance
W/PersistentConnection: pc_0 - Using an unspecified index. Consider adding '".indexOn": "g"' at geofire to your security and Firebase Database rules for better performance
W/PersistentConnection: pc_0 - Using an unspecified index. Consider adding '".indexOn": "g"' at geofire to your security and Firebase Database rules for better performance
W/PersistentConnection: pc_0 - Using an unspecified index. Consider adding '".indexOn": "g"' at geofire to your security and Firebase Database rules for better performance
W/Settings: Setting airplane_mode_on has moved from android.provider.Settings.System to android.provider.Settings.Global, returning read-only value.
W/System: ClassLoader referenced unknown path: /data/user/0/com.google.android.gms/app_chimera/m/00000010/n/armeabi
D/DynamitePackage: Instantiated singleton DynamitePackage.
D/DynamitePackage: Instantiating com.google.android.gms.ads.ChimeraAdManagerCreatorImpl
I/DynamiteModule: Considering local module com.google.android.gms.piccard.dynamite:0 and remote module com.google.android.gms.piccard.dynamite:12
I/DynamiteModule: Selected remote version of com.google.android.gms.piccard.dynamite, version >= 12
W/System: ClassLoader referenced unknown path: /data/user/0/com.google.android.gms/app_chimera/m/00000010/n/armeabi
W/VideoCapabilities: Unrecognized profile/level 32768/2 for video/mp4v-es
I/VideoCapabilities: Unsupported profile 8 for video/mp4v-es
I/VideoCapabilities: Unsupported profile 8 for video/mp4v-es
I/VideoCapabilities: Unsupported profile 8 for video/mp4v-es
I/VideoCapabilities: Unsupported profile 8 for video/mp4v-es
I/VideoCapabilities: Unsupported profile 8 for video/mp4v-es
I/VideoCapabilities: Unsupported profile 8 for video/mp4v-es
I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
I/Ads: Starting ad request.
I/WebViewFactory: Loading com.google.android.webview version 53.0.2785.124 (code 278512400)
D/diffAnother: -6283000
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.ServiceWorkerControllerAdapter>
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.ServiceWorkerControllerAdapter>
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.TokenBindingManagerAdapter>
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.TokenBindingManagerAdapter>
I/cr_LibraryLoader: Time to load native libraries: 6 ms (timestamps 5738-5744)
I/cr_LibraryLoader: Expected native library version number "53.0.2785.124", actual native library version number "53.0.2785.124"
V/WebViewChromiumFactoryProvider: Binding Chromium to main looper Looper (main, tid 1) {611ead6}
I/cr_LibraryLoader: Expected native library version number "53.0.2785.124", actual native library version number "53.0.2785.124"
I/chromium: [INFO:library_loader_hooks.cc(151)] Chromium logging enabled: level = 0, default verbosity = 0
I/cr_BrowserStartup: Initializing chromium process, singleProcess=true
W/cr_media: Requires BLUETOOTH permission
W/cr_AwContents: onDetachedFromWindow called when already detached. Ignoring
I/cr_Ime: ImeThread is not enabled.
E/libEGL: validate_display:255 error 3008 (EGL_BAD_DISPLAY)
W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 13399
I/DynamiteModule: Considering local module com.google.android.gms.tagmanager:8 and remote module com.google.android.gms.tagmanager:9
I/DynamiteModule: Selected remote version of com.google.android.gms.tagmanager, version >= 9
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
W/GoogleTagManager: No container asset found in /assets/containers. Checking top level /assets directory for container assets.
W/GoogleTagManager: Tag Manager's event handler WILL NOT be installed (no container loaded)
I/GoogleTagManager: Tag Manager initilization took 213ms
V/FA: Using measurement service
V/FA: Connecting to remote service
D/FA: Connected to remote service
V/FA: Processing queued up service tasks: 1
I/Ads: Scheduling ad refresh 45000 milliseconds from now.
W/cr_AwContents: onDetachedFromWindow called when already detached. Ignoring
I/cr_Ime: ImeThread is not enabled.
I/Ads: Ad finished loading.
W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 13399
I/chromium: [INFO:CONSOLE(0)] "Document was loaded from Application Cache with manifest https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40-loader.appcache", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40-loader.html (0)
I/chromium: [INFO:CONSOLE(0)] "Application Cache Checking event", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40-loader.html (0)
I/chromium: [INFO:CONSOLE(0)] "Application Cache NoUpdate event", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40-loader.html (0)
D/diffAnother: 1129000
D/DynamitePackage: Instantiating com.google.android.gms.ads.ChimeraAdManagerCreatorImpl
I/Ads: Starting ad request.
D/diffAnother: -6300000
W/cr_AwContents: onDetachedFromWindow called when already detached. Ignoring
I/cr_Ime: ImeThread is not enabled.
W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 13399
I/Ads: Scheduling ad refresh 45000 milliseconds from now.
I/Ads: Ad finished loading.
V/FA: Using measurement service
V/FA: Connecting to remote service
D/FA: Logging event (FE): _e, Bundle[{_o=auto, _et=29568, _sc=MainActivity, _si=-6311178554893906199}]
V/FA: Using measurement service
V/FA: Connection attempt already in progress
V/FA: Activity paused, time: 824808635
D/FA: Connected to remote service
V/FA: Processing queued up service tasks: 2
W/com.facebook.appevents.AppEventsLogger: activateApp events are being logged automatically. There's no need to call activateApp explicitly, this is safe to remove.
I/MaliEGL: [Mali]window_type=1, is_framebuffer=0, errnum = 0
I/MaliEGL: [Mali]surface->num_buffers=4, surface->num_frames=3, win_min_undequeued=1
I/MaliEGL: [Mali]max_allowed_dequeued_buffers=3
D/call1: called
D/call2: called
D/call1: called
D/call2: called
D/error1: ERROR1
D/error1: ERROR1
I/MaliEGL: [Mali]window_type=1, is_framebuffer=0, errnum = 0
I/MaliEGL: [Mali]surface->num_buffers=4, surface->num_frames=3, win_min_undequeued=1
I/MaliEGL: [Mali]max_allowed_dequeued_buffers=3
V/RenderScript: 0xb8457a88 Launching thread(s), CPUs 4
I/MaliEGL: [Mali]window_type=1, is_framebuffer=0, errnum = 0
I/MaliEGL: [Mali]surface->num_buffers=4, surface->num_frames=3, win_min_undequeued=1
I/MaliEGL: [Mali]max_allowed_dequeued_buffers=3
V/FA: Inactivity, disconnecting from the service
I/MaliEGL: [Mali]window_type=1, is_framebuffer=0, errnum = 0
I/MaliEGL: [Mali]surface->num_buffers=4, surface->num_frames=3, win_min_undequeued=1
I/MaliEGL: [Mali]max_allowed_dequeued_buffers=3
I/MaliEGL: [Mali]window_type=1, is_framebuffer=0, errnum = 0
I/MaliEGL: [Mali]surface->num_buffers=4, surface->num_frames=3, win_min_undequeued=1
I/MaliEGL: [Mali]max_allowed_dequeued_buffers=3
I/Ads: Ad is not visible. Not refreshing ad.
I/Ads: Scheduling ad refresh 60000 milliseconds from now.
I/Ads: Ad is not visible. Not refreshing ad.
I/Ads: Scheduling ad refresh 60000 milliseconds from now.
Application terminated.
I tried integrating crashlytics but even it doesn't show any error when the app crashes in this manner.
The question is how will I be able to fix the error if I don't even know what the error is?
Please help me with this.
I think the issue is related to your ad view.
In last line it is showing that ad is not visible.