Reputation: 1
I've made a signup activity in android development which is supposed to make an account in the app using the given credentials.
Here's the original code:
signUpBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String emailString = email.getText().toString();
String passwordString = password.getText().toString();
if(TextUtils.isEmpty(emailString)){
email.setError("Email is required!");
}
if(TextUtils.isEmpty(passwordString)){
password.setError("Password is required!");
}
else {
progressDialog.setMessage("Signing up in progress..");
progressDialog.setCanceledOnTouchOutside(false);
progressDialog.show();
mauth.createUserWithEmailAndPassword(emailString, passwordString).addOnCompleteListener((task) -> {
if(task.isSuccessful()) {
Intent intent = new Intent(RegistrationActivity.this, MainActivity.class);
startActivity(intent);
finish();
progressDialog.dismiss();
}
else {
Toast.makeText(RegistrationActivity.this, task.getException().toString(), Toast.LENGTH_SHORT).show();
progressDialog.dismiss();
}
});
}
}
});
But this is not working, clicking on the signup button is taking the user back to the screen before it i.e. the login screen.
While trying to debug it, I reduced the code to this:
signUpBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String emailString = email.getText().toString();
if(TextUtils.isEmpty(emailString)){
email.setError("Email is required!");
}
Intent intent = new Intent(RegistrationActivity.this, MainActivity.class);
startActivity(intent);
}
});
If we comment out the code and just let Intent run, then the app is running fine and we're redirected to the MainActivity but if there's even a single line like String email, then the button fails to work. What could be the problem?
Edit: This is the logcat when I click on signup button. I'm new to android development, so I'm unable to figure out the exact problem.
2022-05-24 12:32:11.729 24034-24034/? I/le.moneymanage: Late-enabling -Xcheck:jni
2022-05-24 12:32:11.777 24034-24034/? E/le.moneymanage: Unknown bits set in runtime_flags: 0x8000
2022-05-24 12:32:11.779 24034-24034/? I/le.moneymanage: Reinit property: dalvik.vm.checkjni= false
2022-05-24 12:32:11.803 24034-24034/? E/libc: Access denied finding property "runtime.mmitest.isrunning"
2022-05-24 12:32:11.810 24034-24034/? D/ActivityThread: Attach thread to application
2022-05-24 12:32:12.252 24034-24034/com.example.moneymanager I/le.moneymanage: QarthPatchMonintor::Init
2022-05-24 12:32:12.252 24034-24034/com.example.moneymanager I/le.moneymanage:
2022-05-24 12:32:12.252 24034-24034/com.example.moneymanager I/le.moneymanage: QarthPatchMonintor::StartWatch
2022-05-24 12:32:12.252 24034-24034/com.example.moneymanager I/le.moneymanage:
2022-05-24 12:32:12.252 24034-24034/com.example.moneymanager I/le.moneymanage: QarthPatchMonintor::WatchPackage: /data/hotpatch/fwkhotpatch/
2022-05-24 12:32:12.252 24034-24034/com.example.moneymanager I/le.moneymanage:
2022-05-24 12:32:12.252 24034-24034/com.example.moneymanager I/le.moneymanage: QarthPatchMonintor::CheckAndWatchPatch: /data/hotpatch/fwkhotpatch/com.example.moneymanager
2022-05-24 12:32:12.252 24034-24034/com.example.moneymanager I/le.moneymanage:
2022-05-24 12:32:12.252 24034-24034/com.example.moneymanager I/le.moneymanage: QarthPatchMonintor::CheckAndWatchPatch: /data/hotpatch/fwkhotpatch/all
2022-05-24 12:32:12.252 24034-24034/com.example.moneymanager I/le.moneymanage:
2022-05-24 12:32:12.252 24034-24034/com.example.moneymanager I/le.moneymanage: QarthPatchMonintor::Run
2022-05-24 12:32:12.252 24034-24034/com.example.moneymanager I/le.moneymanage:
2022-05-24 12:32:12.253 24034-24069/com.example.moneymanager I/le.moneymanage: QarthPatchMonintor::Reading
2022-05-24 12:32:12.253 24034-24069/com.example.moneymanager I/le.moneymanage:
2022-05-24 12:32:12.253 24034-24069/com.example.moneymanager I/le.moneymanage: QarthPatchMonintor::CheckNotifyEvent
2022-05-24 12:32:12.253 24034-24069/com.example.moneymanager I/le.moneymanage:
2022-05-24 12:32:12.253 24034-24069/com.example.moneymanager I/le.moneymanage: QarthPatchMonintor::CheckNotifyEvent before read
2022-05-24 12:32:12.253 24034-24069/com.example.moneymanager I/le.moneymanage:
2022-05-24 12:32:12.259 24034-24054/com.example.moneymanager I/HwApiCacheMangerEx: apicache path=/storage/emulated/0 state=mounted key=com.example.moneymanager#10253#256
2022-05-24 12:32:12.264 24034-24054/com.example.moneymanager I/HwApiCacheMangerEx: apicache path=/storage/emulated/0 state=mounted key=com.example.moneymanager#10253#0
2022-05-24 12:32:12.274 24034-24054/com.example.moneymanager I/AwareBitmapCacher: init processName:com.example.moneymanager pid=24034 uid=10253
2022-05-24 12:32:12.283 24034-24071/com.example.moneymanager E/AwareLog: AtomicFileUtils: readFileLines file not exist: android.util.AtomicFile@5acff7b
2022-05-24 12:32:12.284 24034-24034/com.example.moneymanager I/FirebaseApp: Device unlocked: initializing all Firebase APIs for app [DEFAULT]
2022-05-24 12:32:12.329 24034-24034/com.example.moneymanager D/FirebaseAuth: Notifying id token listeners about user ( H4wOjceBtpe0PQw6emhOLPk3V7G3 ).
2022-05-24 12:32:12.345 24034-24034/com.example.moneymanager I/FirebaseInitProvider: FirebaseApp initialization successful
2022-05-24 12:32:12.348 24034-24078/com.example.moneymanager D/HwFrameworkSecurityPartsFactory: HwFrameworkSecurityPartsFactory in.
2022-05-24 12:32:12.348 24034-24078/com.example.moneymanager I/HwFrameworkSecurityPartsFactory: add HwFrameworkSecurityPartsFactory to memory.
2022-05-24 12:32:12.362 24034-24078/com.example.moneymanager I/DynamiteModule: Considering local module com.google.android.gms.measurement.dynamite:73 and remote module com.google.android.gms.measurement.dynamite:72
2022-05-24 12:32:12.362 24034-24078/com.example.moneymanager I/DynamiteModule: Selected local version of com.google.android.gms.measurement.dynamite
2022-05-24 12:32:12.428 24034-24034/com.example.moneymanager V/ActivityThread: callActivityOnCreate
2022-05-24 12:32:12.442 24034-24078/com.example.moneymanager V/FA: onActivityCreated
2022-05-24 12:32:12.451 24034-24084/com.example.moneymanager V/FA: App measurement collection enabled
2022-05-24 12:32:12.451 24034-24084/com.example.moneymanager V/FA: App measurement enabled for app package, google app id: com.example.moneymanager, 1:487631718384:android:f0439b2d58f4976aae3f35
2022-05-24 12:32:12.453 24034-24084/com.example.moneymanager I/FA: App measurement initialized, version: 64000
2022-05-24 12:32:12.453 24034-24084/com.example.moneymanager I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
2022-05-24 12:32:12.453 24034-24084/com.example.moneymanager I/FA: To enable faster debug mode event logging run:
adb shell setprop debug.firebase.analytics.app com.example.moneymanager
2022-05-24 12:32:12.453 24034-24084/com.example.moneymanager D/FA: Debug-level message logging enabled
2022-05-24 12:32:12.454 24034-24034/com.example.moneymanager V/HwWidgetFactory: : successes to get AllImpl object and return....
2022-05-24 12:32:12.488 24034-24034/com.example.moneymanager W/le.moneymanage: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
2022-05-24 12:32:12.490 24034-24034/com.example.moneymanager W/le.moneymanage: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
2022-05-24 12:32:12.517 24034-24084/com.example.moneymanager V/FA: Connecting to remote service
2022-05-24 12:32:12.542 24034-24084/com.example.moneymanager V/FA: Connection attempt already in progress
2022-05-24 12:32:12.611 24034-24034/com.example.moneymanager D/ActivityThread: add activity client record, r= ActivityRecord{ab633ea token=android.os.BinderProxy@e170c8 {com.example.moneymanager/com.example.moneymanager.LoginActivity}} token= android.os.BinderProxy@e170c8
2022-05-24 12:32:12.551 24034-24084/com.example.moneymanager V/FA: Connection attempt already in progress
2022-05-24 12:32:12.622 24034-24084/com.example.moneymanager V/FA: Activity resumed, time: 4493921349
2022-05-24 12:32:12.627 24034-24084/com.example.moneymanager I/FA: Tag Manager is not found and thus will not be used
2022-05-24 12:32:12.651 24034-24084/com.example.moneymanager V/FA: Connection attempt already in progress
2022-05-24 12:32:12.652 24034-24084/com.example.moneymanager V/FA: Connection attempt already in progress
2022-05-24 12:32:12.659 24034-24091/com.example.moneymanager D/HiTouch_PressGestureDetector: onAttached, package=com.example.moneymanager, windowType=1, mHiTouchRestricted=false
2022-05-24 12:32:12.688 24034-24081/com.example.moneymanager I/iGraphics: [0020080c] pn: com.example.moneymanager, p: 24034
2022-05-24 12:32:12.689 24034-24081/com.example.moneymanager I/iGraphics: [0030080c] no spt app: com.example.moneymanager
2022-05-24 12:32:12.704 24034-24081/com.example.moneymanager D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
2022-05-24 12:32:12.720 24034-24081/com.example.moneymanager W/Gralloc3: mapper 3.x is not supported
2022-05-24 12:32:12.748 24034-24081/com.example.moneymanager E/: APS:IFLoad:importExternalFunctions, search function createNewHwApsUtils failed, dlsym err:undefined symbol: createNewHwApsUtils
2022-05-24 12:32:12.748 24034-24081/com.example.moneymanager D/: APS:importExternalFunctions OK
2022-05-24 12:32:12.753 24034-24034/com.example.moneymanager I/HwViewRootImpl: removeInvalidNode jank list is null
2022-05-24 12:32:12.783 24034-24084/com.example.moneymanager D/FA: Connected to remote service
2022-05-24 12:32:12.784 24034-24084/com.example.moneymanager V/FA: Processing queued up service tasks: 5
2022-05-24 12:32:13.892 24034-24047/com.example.moneymanager I/le.moneymanage: Background concurrent copying GC freed 36186(7828KB) AllocSpace objects, 20(464KB) LOS objects, 69% free, 2719KB/8863KB, paused 320us total 113.373ms
2022-05-24 12:32:17.278 24034-24034/com.example.moneymanager D/AwareBitmapCacher: handleInit switch not opened pid=24034
2022-05-24 12:32:17.840 24034-24084/com.example.moneymanager V/FA: Inactivity, disconnecting from the service
Error Logcat :
2022-05-24 12:43:31.434 25022-25022/? E/le.moneymanage: Unknown bits set in runtime_flags: 0x8000
2022-05-24 12:43:31.461 25022-25022/? E/libc: Access denied finding property "runtime.mmitest.isrunning"
2022-05-24 12:43:31.908 25022-25058/com.example.moneymanager E/AwareLog: AtomicFileUtils: readFileLines file not exist: android.util.AtomicFile@e311dec
2022-05-24 12:43:32.380 25022-25070/com.example.moneymanager E/: APS:IFLoad:importExternalFunctions, search function createNewHwApsUtils failed, dlsym err:undefined symbol: createNewHwApsUtils
Upvotes: 0
Views: 79