Camera surface preview gives multiple errors on multiple devices - java

The Problem:
In using the camera on the device, I'm getting a number of errors. I have looked over many answers here on StackOverflow and I have tried many solutions to no avail. I'm not sure what the problem is. I have tried this on two different devices and I'm getting the same errors. This is failing on multiple devices... Samsung Galaxy S7 and a Vankyo Z4 Tablet. The logs are from the tablet.
2020-01-27 06:51:43.571 4182-4182/ W/e.myapplicatio: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (light greylist, reflection)
2020-01-27 06:51:43.649 4182-4182/ D/OpenGLRenderer: Skia GL Pipeline
2020-01-27 06:51:44.474 4182-4182/ E/Camera: Error 2
2020-01-27 06:51:44.600 4182-4262/ I/mali_so: [File] : hardware/rockchip/mali_so_src_of_midgard/driver/product/base/src/mali_base_kbase.c; [Line] : 1095; [Func] : base_context_deal_with_version_affairs_rk_ext;
arm_release_ver of this mali_so is 'r12p0-01rel0', rk_so_ver is '9#0 '.
2020-01-27 06:51:44.600 4182-4262/ I/mali_so: [File] : hardware/rockchip/mali_so_src_of_midgard/driver/product/base/src/mali_base_kbase.c; [Line] : 1101; [Func] : base_context_deal_with_version_affairs_rk_ext;
mali_ver_property has been set to 'r12p0-01rel0-x-9#0', to return.
2020-01-27 06:51:44.601 4182-4262/ I/mali_so: [File] : hardware/rockchip/mali_so_src_of_midgard/driver/product/cmem/src/mali_cmem_hoard.c; [Line] : 559; [Func] : should_current_process_not_to_use_hoard;
WOULD use hoard.
2020-01-27 06:51:44.617 4182-4262/ I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
2020-01-27 06:51:44.618 4182-4262/ I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
2020-01-27 06:51:44.618 4182-4262/ I/OpenGLRenderer: Initialized EGL, version 1.4
2020-01-27 06:51:44.618 4182-4262/ D/OpenGLRenderer: Swap behavior 2
2020-01-27 06:51:44.648 4182-4262/ D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
2020-01-27 06:51:44.670 4182-4182/ D/Camera: setPreviewTexture failed
2020-01-27 06:51:44.674 4182-4182/ D/Camera: Rotate 270
2020-01-27 06:51:44.675 4182-4182/ D/Camera: setDisplayOrientation Failed: set display orientation failed
2020-01-27 06:51:44.677 4182-4182/ D/Camera: setPreviewTexture failed
2020-01-27 06:51:45.630 4182-4182/ D/Camera: Rotate 270
2020-01-27 06:51:45.818 4182-4182/ I/Choreographer: Skipped 76 frames! The application may be doing too much work on its main thread.
2020-01-27 06:51:46.014 4182-4262/ D/GRALLOC-ROCKCHIP: RK_GRAPHICS_VER=commit-id:69cd12f
2020-01-27 06:51:46.464 4182-4262/ I/OpenGLRenderer: Davey! duration=1946ms; Flags=1, IntendedVsync=15482245744667, Vsync=15483533880219, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=15483548307810, AnimationStart=15483548629227, PerformTraversalsStart=15483550124019, DrawStart=15483591003440, SyncQueued=15483639373153, SyncStart=15483640225986, IssueDrawCommandsStart=15483711543452, SwapBuffers=15484188006958, FrameCompleted=15484193184333, DequeueBufferDuration=14675000, QueueBufferDuration=3065000,
2020-01-27 06:51:46.491 4182-4182/ I/Choreographer: Skipped 39 frames! The application may be doing too much work on its main thread.
2020-01-27 06:51:46.539 4182-4262/ I/OpenGLRenderer: Davey! duration=709ms; Flags=0, IntendedVsync=15483558409277, Vsync=15484219426205, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=15484220349586, AnimationStart=15484220561045, PerformTraversalsStart=15484222148003, DrawStart=15484224182962, SyncQueued=15484224448962, SyncStart=15484224914753, IssueDrawCommandsStart=15484225396878, SwapBuffers=15484260477090, FrameCompleted=15484268449216, DequeueBufferDuration=11816000, QueueBufferDuration=3806000,
2020-01-27 06:53:10.381 4182-4262/ W/libEGL: EGLNativeWindowType 0xee0ea008 disconnect failed
2020-01-27 06:53:11.199 4182-4182/ I/Choreographer: Skipped 49 frames! The application may be doing too much work on its main thread.
2020-01-27 06:53:11.283 4182-4262/ D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
2020-01-27 06:53:11.363 4182-4182/ D/Camera: setPreviewTexture failed
2020-01-27 06:53:11.368 4182-4182/ D/Camera: Rotate 0
2020-01-27 06:53:11.369 4182-4182/ D/Camera: setDisplayOrientation Failed: set display orientation failed
2020-01-27 06:53:11.371 4182-4182/ D/Camera: setPreviewTexture failed
2020-01-27 06:53:12.680 4182-4182/ D/Camera: Rotate 0
2020-01-27 06:53:12.691 4182-4182/ E/Camera: Error 2
2020-01-27 06:53:12.729 4182-4182/ I/Choreographer: Skipped 87 frames! The application may be doing too much work on its main thread.
2020-01-27 06:53:12.851 4182-4262/ I/OpenGLRenderer: Davey! duration=1608ms; Flags=1, IntendedVsync=15568971643421, Vsync=15570446219645, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=15570459148001, AnimationStart=15570459500626, PerformTraversalsStart=15570461186751, DrawStart=15570496844172, SyncQueued=15570546182510, SyncStart=15570546388427, IssueDrawCommandsStart=15570562532470, SwapBuffers=15570576764930, FrameCompleted=15570579908513, DequeueBufferDuration=7076000, QueueBufferDuration=956000,
2020-01-27 06:53:35.328 4182-4262/ W/libEGL: EGLNativeWindowType 0xd48dd008 disconnect failed
2020-01-27 06:53:36.017 4182-4182/ I/Choreographer: Skipped 39 frames! The application may be doing too much work on its main thread.
2020-01-27 06:53:36.096 4182-4262/ D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
2020-01-27 06:53:36.175 4182-4182/ D/Camera: setPreviewTexture failed
2020-01-27 06:53:36.178 4182-4182/ D/Camera: Rotate 270
2020-01-27 06:53:36.179 4182-4182/ D/Camera: setDisplayOrientation Failed: set display orientation failed
2020-01-27 06:53:36.181 4182-4182/ D/Camera: setPreviewTexture failed
2020-01-27 06:53:36.978 4182-4182/ D/Camera: Rotate 270
2020-01-27 06:53:36.990 4182-4182/ E/Camera: Error 2
2020-01-27 06:53:37.040 4182-4182/ I/Choreographer: Skipped 58 frames! The application may be doing too much work on its main thread.
2020-01-27 06:53:37.160 4182-4262/ I/OpenGLRenderer: Davey! duration=1105ms; Flags=1, IntendedVsync=15593784036511, Vsync=15594767087327, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=15594770152361, AnimationStart=15594770423902, PerformTraversalsStart=15594772051694, DrawStart=15594807059573, SyncQueued=15594846584202, SyncStart=15594846778160, IssueDrawCommandsStart=15594869251079, SwapBuffers=15594887089997, FrameCompleted=15594889647331, DequeueBufferDuration=7349000, QueueBufferDuration=1031000,
2020-01-27 06:53:51.816 4182-4262/ W/libEGL: EGLNativeWindowType 0xd48dd008 disconnect failed
2020-01-27 06:53:52.497 4182-4182/ I/Choreographer: Skipped 39 frames! The application may be doing too much work on its main thread.
2020-01-27 06:53:52.568 4182-4262/ D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
2020-01-27 06:53:52.655 4182-4182/ D/Camera: setPreviewTexture failed
2020-01-27 06:53:52.659 4182-4182/ D/Camera: Rotate 0
2020-01-27 06:53:52.660 4182-4182/ D/Camera: setDisplayOrientation Failed: set display orientation failed
2020-01-27 06:53:52.661 4182-4182/ D/Camera: setPreviewTexture failed
2020-01-27 06:53:53.166 4182-4182/ D/Camera: Rotate 0
2020-01-27 06:53:53.174 4182-4182/ E/Camera: Error 2
2020-01-27 06:53:53.209 4182-4182/ I/Choreographer: Skipped 38 frames! The application may be doing too much work on its main thread.
2020-01-27 06:53:53.333 4182-4262/ I/OpenGLRenderer: Davey! duration=781ms; Flags=1, IntendedVsync=15610280644733, Vsync=15610924712509, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=15610938505568, AnimationStart=15610938769527, PerformTraversalsStart=15610940187027, DrawStart=15610980021989, SyncQueued=15611021218452, SyncStart=15611021401618, IssueDrawCommandsStart=15611042124829, SwapBuffers=15611058239997, FrameCompleted=15611062475581, DequeueBufferDuration=8643000, QueueBufferDuration=1439000,
2020-01-27 06:54:33.415 4182-4262/ W/libEGL: EGLNativeWindowType 0xd48dd008 disconnect failed
2020-01-27 06:54:34.104 4182-4182/ I/Choreographer: Skipped 41 frames! The application may be doing too much work on its main thread.
2020-01-27 06:54:34.172 4182-4262/ D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
2020-01-27 06:54:34.250 4182-4182/ D/Camera: setPreviewTexture failed
2020-01-27 06:54:34.252 4182-4182/ D/Camera: Rotate 270
2020-01-27 06:54:34.254 4182-4182/ D/Camera: setDisplayOrientation Failed: set display orientation failed
2020-01-27 06:54:34.256 4182-4182/ D/Camera: setPreviewTexture failed
2020-01-27 06:54:34.761 4182-4182/ D/Camera: Rotate 270
2020-01-27 06:54:34.774 4182-4182/ E/Camera: Error 2
2020-01-27 06:54:34.805 4182-4182/ I/Choreographer: Skipped 38 frames! The application may be doing too much work on its main thread.
2020-01-27 06:54:34.942 4182-4262/ I/OpenGLRenderer: Davey! duration=794ms; Flags=1, IntendedVsync=15651876176648, Vsync=15652520244424, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=15652534305206, AnimationStart=15652534506748, PerformTraversalsStart=15652537321040, DrawStart=15652583784419, SyncQueued=15652629034174, SyncStart=15652629455049, IssueDrawCommandsStart=15652650115843, SwapBuffers=15652667089970, FrameCompleted=15652670663762, DequeueBufferDuration=9324000, QueueBufferDuration=1607000,
2020-01-27 07:03:10.639 4182-4262/ W/libEGL: EGLNativeWindowType 0xd48dd008 disconnect failed
As can be seen from the log, when the orientation changes, surfaceChanged callback gets called twice. The first time, I get the setDisplayOrientation failed. I'm not sure why I'm getting setPreviewTexture failed because I'm not even using TextureView. I also don't know why I'm getting Error 2 for the camera either. I have tried several solutions that I found here and elsewhere to no avail. Here's the code in question:
#Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
Display display;
int rotation;
int degrees = 0;
int result;
// If the holder is null, then just return.
if (mHolder.getSurface() == null) {
return;
}
// Stop the preview.
try {
if (isPreviewRunning) {
mCamera.stopPreview();
isPreviewRunning = false;
}
} catch (Exception e) {
Log.d("Camera", "Stop Preview Failed: " + e.getMessage());
}
// Check the device orientation.
display = ((WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
rotation = display.getRotation();
switch (rotation) {
case Surface.ROTATION_0:
Log.d("Camera", "Rotate 0");
degrees = 0;
break;
case Surface.ROTATION_90:
Log.d("Camera", "Rotate 90");
degrees = 90;
break;
case Surface.ROTATION_180:
Log.d("Camera", "Rotate 180");
degrees = 180;
break;
case Surface.ROTATION_270:
Log.d("Camera", "Rotate 270");
degrees = 270;
break;
}
if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
result = (cameraInfo.orientation + degrees) % 360;
result = (360 - result) % 360; // compensate the mirror
} else { // back-facing
result = (cameraInfo.orientation - degrees + 360) % 360;
}
// Not sure why this fails. No reason given.
try {
mCamera.setDisplayOrientation(result);
} catch (Exception e) {
Log.d("Camera", "setDisplayOrientation Failed: " + e.getMessage());
}
// Restart the preview with the new changes.
try {
mCamera.setPreviewDisplay(holder);
mCamera.startPreview();
isPreviewRunning = true;
} catch (IOException e) {
Log.d("Camera", e.getMessage());
}
}
Despite the errors, it does work. So should I just ignore the errors or continue to try to fix them? I am writing for API level 19. I know that Camera was depreciated in API 21, but older devices are still out there and I want this code to run on those as well. As for the research, there seems to be two main solutions. I have tried both and they do not work. The one with the getParameters is telling me that getParameters failed that it returned null, which should not happen, but it does.
Research:
As for the research that I have done trying to fix this problem...
https://www.codeproject.com/Questions/626862/Android-Camera-setDisplayOrientation-Failed
Textureview/Surface view for Camera preview - Android
Problem with camera when orientation changes
Android Camera setDisplayOrientation does not work
android camera setDisplayOrientation(90) fails in different devices
Set display orientation failed

Related

Permission denied for Android Studio

I have a permission denied problem when I run the app in my android studio. Before that, I need to declare that my group mates can run the code and pop out the data but me, we all use the same code and version but I use a mac that they use the win system.
Below is the logcat info:
Late-enabling -Xcheck:jni
E/ample.inclass0: Unknown bits set in runtime_flags: 0x8000
W/ample.inclass0: Unexpected CPU variant for X86 using defaults: x86
D/libEGL: Emulator has host GPU support, qemu.gles is set to 1.
W/RenderThread: type=1400 audit(0.0:660): avc: denied { write } for name="property_service" dev="tmpfs" ino=857 scontext=u:r:untrusted_app:s0:c151,c256,c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0
W/libc: Unable to set property "qemu.gles" to "1": connection failed; errno=13 (Permission denied)
D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
W/ample.inclass0: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
W/ample.inclass0: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
W/System.err: java.net.SocketException: socket failed: EPERM (Operation not permitted)
W/System.err: at java.net.Socket.createImpl(Socket.java:492)
W/System.err: at java.net.Socket.getImpl(Socket.java:552)
W/System.err: at java.net.Socket.setSoTimeout(Socket.java:1180)
W/System.err: at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.kt:293)
W/System.err: at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:207)
W/System.err: at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:226)
W/System.err: at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:106)
W/System.err: at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:74)
W/System.err: at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:255)
W/System.err: at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32)
W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
W/System.err: at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
W/System.err: at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
W/System.err: at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
W/System.err: at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
W/System.err: at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:517)
W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
W/System.err: at java.lang.Thread.run(Thread.java:919)
D/HostConnection: HostConnection::get() New Host Connection established 0xdb7e2040, tid 5252
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache ANDROID_EMU_sync_buffer_data GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 0 0
D/EGL_emulation: eglCreateContext: 0xf1f7e5c0: maj 3 min 0 rcv 3
D/EGL_emulation: eglMakeCurrent: 0xf1f7e5c0: ver 3 0 (tinfo 0xe6d24dd0)
W/Gralloc3: mapper 3.x is not supported
D/HostConnection: createUnique: call
D/HostConnection: HostConnection::get() New Host Connection established 0xdb7e3800, tid 5252
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache ANDROID_EMU_sync_buffer_data GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0
D/eglCodecCommon: allocate: Ask for block of size 0x1000
D/eglCodecCommon: allocate: ioctl allocate returned offset 0x3ff807000 size 0x2000
D/EGL_emulation: eglMakeCurrent: 0xf1f7e5c0: ver 3 0 (tinfo 0xe6d24dd0)
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 1 0
Below is the AndroidMainfest file:
For toolsLtargetApi="31" I tried to delete and run nothing changed
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.inclass07">
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<application
android:allowBackup="true"
android:dataExtractionRules="#xml/data_extraction_rules"
android:fullBackupContent="#xml/backup_rules"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/Theme.InClass07"
tools:targetApi="31">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Could anyone give me some suggestions to solve the issue? Any help is appreciated.
I am not sure if this will work for everyone, but I solved my problem by changing the Emulator.
Previously, I used the Nexus 5X Q(API29), but now I switched to the Nexus 5X API33 and doing so solved my problem.
I also tried others with API33 and they work just fine.

Retrieve Data from multiple documents from Firestore Database

Unable to fetch a value from the Firestore database. Trying to retrieve the value of the mobile number as and when the value of flat and block matches the entry in the database. Below is the code I am using. I have also attached the issues that are registered in LogCat file. Please check and help.
public class Test extends AppCompatActivity {
Button btn;
private FirebaseFirestore firestore;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test);
firestore = FirebaseFirestore.getInstance();
btn = (Button) findViewById(R.id.button3);
btn.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
getmobile();
//makecall();
}
});
}
private void makecall(){
Intent intent = new Intent(Intent.ACTION_CALL_BUTTON);
intent.setData(Uri.parse("tel:9890910640"));
startActivity(intent);
}
private void getmobile() {
firestore.collection("users").get().addOnSuccessListener(new OnSuccessListener<QuerySnapshot>() {
#Override
public void onSuccess(QuerySnapshot documentSnapshots) {
String a = "101";
String b = "F1A";
for(DocumentSnapshot document: documentSnapshots){
if(document.getString("flat")==a&&document.getString("block")==b){
String mobilefromdatabase = document.get("mobile").toString();
Toast.makeText(Test.this, "mobile" + mobilefromdatabase, Toast.LENGTH_LONG).show();
break;
}
}
}
});
}
}
Logcat Details
05-05 03:59:26.721 8805-8805/? E/libprocessgroup: failed to make and chown /acct/uid_10058: Read-only file system
05-05 03:59:26.721 8805-8805/? W/Zygote: createProcessGroup failed, kernel missing CONFIG_CGROUP_CPUACCT?
05-05 03:59:26.722 8805-8805/? I/art: Not late-enabling -Xcheck:jni (already on)
05-05 03:59:26.770 8805-8805/com.example.myrwaapp I/MultiDex: VM with version 2.1.0 has multidex support
05-05 03:59:26.770 8805-8805/com.example.myrwaapp I/MultiDex: Installing application
05-05 03:59:26.770 8805-8805/com.example.myrwaapp I/MultiDex: VM has multidex support, MultiDex support library is disabled.
05-05 03:59:26.842 8805-8805/com.example.myrwaapp V/FA: Registered activity lifecycle callback
05-05 03:59:26.857 8805-8831/com.example.myrwaapp W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
05-05 03:59:26.861 8805-8805/com.example.myrwaapp I/FirebaseInitProvider: FirebaseApp initialization successful
05-05 03:59:26.907 8805-8834/com.example.myrwaapp W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
05-05 03:59:26.925 8805-8834/com.example.myrwaapp I/FirebaseAuth: [FirebaseAuth:] Preparing to create service connection to gms implementation
05-05 03:59:26.986 8805-8805/com.example.myrwaapp W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.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
05-05 03:59:27.010 8805-8805/com.example.myrwaapp V/FA: onActivityCreated
05-05 03:59:27.047 8805-8805/com.example.myrwaapp I/art: Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$2>
05-05 03:59:27.047 8805-8805/com.example.myrwaapp I/art: Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$2>
05-05 03:59:27.048 8805-8830/com.example.myrwaapp V/FA: App measurement collection enabled
05-05 03:59:27.049 8805-8830/com.example.myrwaapp V/FA: App measurement enabled for app package, google app id: com.example.myrwaapp, 1:649640616763:android:9025242f82dd4767798d1e
05-05 03:59:27.052 8805-8830/com.example.myrwaapp I/FA: App measurement initialized, version: 21028
05-05 03:59:27.052 8805-8830/com.example.myrwaapp I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
05-05 03:59:27.052 8805-8830/com.example.myrwaapp I/FA: To enable faster debug mode event logging run:
adb shell setprop debug.firebase.analytics.app com.example.myrwaapp
05-05 03:59:27.052 8805-8830/com.example.myrwaapp D/FA: Debug-level message logging enabled
05-05 03:59:27.077 8805-8830/com.example.myrwaapp V/FA: Connecting to remote service
05-05 03:59:27.089 8805-8830/com.example.myrwaapp V/FA: Connection attempt already in progress
05-05 03:59:27.143 8805-8830/com.example.myrwaapp V/FA: Activity resumed, time: 8622127
05-05 03:59:27.145 8805-8830/com.example.myrwaapp I/FA: Tag Manager is not found and thus will not be used
05-05 03:59:27.151 8805-8838/com.example.myrwaapp D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
05-05 03:59:27.154 8805-8805/com.example.myrwaapp D/Atlas: Validating map...
05-05 03:59:27.159 8805-8830/com.example.myrwaapp V/FA: Connection attempt already in progress
05-05 03:59:27.159 8805-8830/com.example.myrwaapp V/FA: Connection attempt already in progress
05-05 03:59:27.188 8805-8838/com.example.myrwaapp I/OpenGLRenderer: Initialized EGL, version 1.4
05-05 03:59:27.188 8805-8838/com.example.myrwaapp W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
05-05 03:59:27.215 8805-8838/com.example.myrwaapp D/EGL_emulation: eglCreateContext: 0xa2003100: maj 2 min 0 rcv 2
05-05 03:59:27.240 8805-8838/com.example.myrwaapp D/EGL_emulation: eglMakeCurrent: 0xa2003100: ver 2 0 (tinfo 0xb4233e90)
05-05 03:59:27.243 8805-8838/com.example.myrwaapp D/OpenGLRenderer: Enabling debug mode 0
05-05 03:59:27.294 8805-8838/com.example.myrwaapp D/EGL_emulation: eglMakeCurrent: 0xa2003100: ver 2 0 (tinfo 0xb4233e90)
05-05 03:59:27.738 8805-8830/com.example.myrwaapp D/FA: Connected to remote service
05-05 03:59:27.738 8805-8830/com.example.myrwaapp V/FA: Processing queued up service tasks: 4
05-05 03:59:32.795 8805-8830/com.example.myrwaapp V/FA: Inactivity, disconnecting from the service
05-05 03:59:38.884 8805-8830/com.example.myrwaapp V/FA: Recording user engagement, ms: 11740
05-05 03:59:38.886 8805-8830/com.example.myrwaapp V/FA: Connecting to remote service
05-05 03:59:38.892 8805-8830/com.example.myrwaapp V/FA: Activity paused, time: 8633867
05-05 03:59:38.894 8805-8805/com.example.myrwaapp V/FA: onActivityCreated
05-05 03:59:38.913 8805-8830/com.example.myrwaapp V/FA: Connection attempt already in progress
05-05 03:59:38.913 8805-8830/com.example.myrwaapp V/FA: Activity resumed, time: 8633895
05-05 03:59:38.926 8805-8830/com.example.myrwaapp V/FA: Connection attempt already in progress
05-05 03:59:38.926 8805-8830/com.example.myrwaapp V/FA: Connection attempt already in progress
05-05 03:59:38.993 8805-8838/com.example.myrwaapp D/EGL_emulation: eglMakeCurrent: 0xa2003100: ver 2 0 (tinfo 0xb4233e90)
05-05 03:59:39.034 8805-8838/com.example.myrwaapp D/EGL_emulation: eglMakeCurrent: 0xa2003100: ver 2 0 (tinfo 0xb4233e90)
05-05 03:59:39.051 8805-8838/com.example.myrwaapp D/EGL_emulation: eglMakeCurrent: 0xa2003100: ver 2 0 (tinfo 0xb4233e90)
05-05 03:59:39.177 8805-8838/com.example.myrwaapp D/EGL_emulation: eglMakeCurrent: 0xa2003100: ver 2 0 (tinfo 0xb4233e90)
05-05 03:59:39.222 8805-8830/com.example.myrwaapp D/FA: Connected to remote service
05-05 03:59:39.222 8805-8830/com.example.myrwaapp V/FA: Processing queued up service tasks: 4
05-05 03:59:39.224 8805-8838/com.example.myrwaapp D/EGL_emulation: eglMakeCurrent: 0xa2003100: ver 2 0 (tinfo 0xb4233e90)
05-05 03:59:39.335 8805-8838/com.example.myrwaapp D/EGL_emulation: eglMakeCurrent: 0xa2003100: ver 2 0 (tinfo 0xb4233e90)
05-05 03:59:44.247 8805-8830/com.example.myrwaapp V/FA: Inactivity, disconnecting from the service
05-05 03:59:48.704 8805-8838/com.example.myrwaapp D/EGL_emulation: eglMakeCurrent: 0xa2003100: ver 2 0 (tinfo 0xb4233e90)
05-05 03:59:48.871 8805-8849/com.example.myrwaapp W/DynamiteModule: Local module descriptor class for providerinstaller not found.
05-05 03:59:48.877 8805-8849/com.example.myrwaapp I/DynamiteModule: Considering local module providerinstaller:0 and remote module providerinstaller:0
05-05 03:59:48.877 8805-8849/com.example.myrwaapp W/ProviderInstaller: Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.
05-05 03:59:48.881 8805-8849/com.example.myrwaapp W/ResourcesManager: Asset path '/system/framework/com.android.media.remotedisplay.jar' does not exist or contains no resources.
05-05 03:59:48.881 8805-8849/com.example.myrwaapp W/ResourcesManager: Asset path '/system/framework/com.android.location.provider.jar' does not exist or contains no resources.
05-05 03:59:48.942 8805-8849/com.example.myrwaapp W/linker: libconscrypt_gmscore_jni.so: unused DT entry: type 0x6ffffffe arg 0x13dc
05-05 03:59:48.942 8805-8849/com.example.myrwaapp W/linker: libconscrypt_gmscore_jni.so: unused DT entry: type 0x6fffffff arg 0x2
05-05 03:59:48.948 8805-8849/com.example.myrwaapp V/NativeCrypto: Registering com/google/android/gms/org/conscrypt/NativeCrypto's 284 native methods...
05-05 03:59:48.963 8805-8820/com.example.myrwaapp I/art: Background sticky concurrent mark sweep GC freed 976(49KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 8MB/8MB, paused 5.861ms total 31.265ms
05-05 03:59:48.992 8805-8849/com.example.myrwaapp I/art: Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.org.conscrypt.Java7ExtendedSSLSession>
05-05 03:59:48.992 8805-8849/com.example.myrwaapp I/art: Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.org.conscrypt.Java7ExtendedSSLSession>
05-05 03:59:48.992 8805-8849/com.example.myrwaapp I/art: Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.org.conscrypt.Java8ExtendedSSLSession>
05-05 03:59:48.992 8805-8849/com.example.myrwaapp I/art: Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.org.conscrypt.Java8ExtendedSSLSession>
05-05 03:59:49.002 8805-8849/com.example.myrwaapp I/ProviderInstaller: Installed default security provider GmsCore_OpenSSL
First of all, String comparison in Java, should not be performed using == operator, as it will always compare the address of the objects from the memory and not the actual values. String comparison should be done using equals() method.
Moreover, if you need an AND operation, you should not get all documents that exist within the users collection and make the comparison on the client. For that, you should use a query that looks exactly like this:
String a = "101";
String b = "F1A";
FirebaseFirestore rootRef = FirebaseFirestore.getInstance();
CollectionReference usersRef = rootRef.collection("users");
Query query = usersRef.whereEqualTo("flat", a).whereEqualTo("block", b);
query.get().addOnSuccessListener(/* ... */);
In this way, you are going to get only the documents where the flat property holds the value of 101 AND the value of block holds F1A. As I think that only one apartment has that constraint, you'll be billed with only one read operation.

Unable to write data to firebase android studio

I am unable to write any data to my firebase database, however it is connected. My rules of both read and write are set to true, and I added the required SDK's but I still cannot add data.
Button RegisterBttn;
EditText userEmail, userPassword, userName;
//Firebase setup
FirebaseDatabase mydatabase;
DatabaseReference users;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register_page);
RegisterBttn = (Button) findViewById(R.id.registerBttn);
//Firebase
mydatabase = FirebaseDatabase.getInstance();
users = mydatabase.getReference("Users");
userEmail = (EditText) findViewById(R.id.emailRegisterText);
userPassword = (EditText) findViewById(R.id.passwordRegisterText);
userName = (EditText) findViewById(R.id.nameRegisterText);
RegisterBttn.setOnClickListener(new View.OnClickListener(){
#Override
public void onClick(View v){
final User user = new User(userName.getText().toString(),
userPassword.getText().toString(),
userEmail.getText().toString());
users.addListenerForSingleValueEvent(new ValueEventListener() {
#Override
public void onDataChange(#NonNull DataSnapshot dataSnapshot) {
if(dataSnapshot.child(user.getUserName()).exists()) {
Toast.makeText(RegisterPage.this, "The Username already exists", Toast.LENGTH_SHORT).show();
}
else{
users.child(user.getUserName()).setValue(user);
// Log.i("Info", "Button Pressed");
Toast.makeText(RegisterPage.this, "Registered successfully", Toast.LENGTH_SHORT).show();
}
}
#Override
public void onCancelled(#NonNull DatabaseError databaseError) {
// Toast.makeText(RegisterPage.this, "Error registering", Toast.LENGTH_SHORT).show();
}
});
}
});
}
}
I have a seperate class for "User", containing username, pass and email.
I am using Realtime DB. The rules are:
{
"rules": {
".read": true,
".write": true
}
}
Here is the Logcat:
2020-04-11 23:30:54.483 25114-25114/? I/xample.fitnote: Not late-enabling -Xcheck:jni (already on)
2020-04-11 23:30:54.563 25114-25114/? E/xample.fitnote: Unknown bits set in runtime_flags: 0x8000
2020-04-11 23:30:54.571 25114-25114/? W/xample.fitnote: Unexpected CPU variant for X86 using defaults: x86
2020-04-11 23:30:55.411 25114-25114/com.example.fitnotes V/FA: Registered activity lifecycle callback
2020-04-11 23:30:55.412 25114-25114/com.example.fitnotes I/FirebaseInitProvider: FirebaseApp initialization successful
2020-04-11 23:30:55.440 25114-25114/com.example.fitnotes W/RenderThread: type=1400 audit(0.0:124): avc: denied { write } for name="property_service" dev="tmpfs" ino=620 scontext=u:r:untrusted_app:s0:c134,c256,c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0
2020-04-11 23:30:55.456 25114-25156/com.example.fitnotes D/libEGL: Emulator has host GPU support, qemu.gles is set to 1.
2020-04-11 23:30:55.456 25114-25156/com.example.fitnotes W/libc: Unable to set property "qemu.gles" to "1": connection failed; errno=13 (Permission denied)
2020-04-11 23:30:55.669 25114-25156/com.example.fitnotes D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
2020-04-11 23:30:55.694 25114-25156/com.example.fitnotes D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
2020-04-11 23:30:55.696 25114-25156/com.example.fitnotes D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
2020-04-11 23:30:55.700 25114-25114/com.example.fitnotes V/FA: onActivityCreated
2020-04-11 23:30:55.806 25114-25114/com.example.fitnotes W/xample.fitnote: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
2020-04-11 23:30:55.806 25114-25114/com.example.fitnotes W/xample.fitnote: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
2020-04-11 23:30:55.945 25114-25167/com.example.fitnotes D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2020-04-11 23:30:56.021 25114-25153/com.example.fitnotes W/xample.fitnote: Verification of java.lang.Long com.google.android.gms.measurement.internal.zzap.zzbz() took 116.979ms
2020-04-11 23:30:56.201 25114-25154/com.example.fitnotes D/HostConnection: HostConnection::get() New Host Connection established 0xdbf3f320, tid 25154
2020-04-11 23:30:56.209 25114-25154/com.example.fitnotes D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_3_0
2020-04-11 23:30:56.225 25114-25154/com.example.fitnotes W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2020-04-11 23:30:56.227 25114-25154/com.example.fitnotes D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 0 0
2020-04-11 23:30:56.227 25114-25154/com.example.fitnotes D/EGL_emulation: eglCreateContext: 0xdbf1a120: maj 3 min 0 rcv 3
2020-04-11 23:30:56.229 25114-25154/com.example.fitnotes D/EGL_emulation: eglMakeCurrent: 0xdbf1a120: ver 3 0 (tinfo 0xdbf0f1a0)
2020-04-11 23:30:56.253 25114-25154/com.example.fitnotes W/Gralloc3: mapper 3.x is not supported
2020-04-11 23:30:56.266 25114-25154/com.example.fitnotes D/HostConnection: createUnique: call
2020-04-11 23:30:56.267 25114-25154/com.example.fitnotes D/HostConnection: HostConnection::get() New Host Connection established 0xdbf3f460, tid 25154
2020-04-11 23:30:56.267 25114-25154/com.example.fitnotes D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_3_0
2020-04-11 23:30:56.268 25114-25154/com.example.fitnotes D/eglCodecCommon: allocate: Ask for block of size 0x1000
2020-04-11 23:30:56.268 25114-25154/com.example.fitnotes D/eglCodecCommon: allocate: ioctl allocate returned offset 0x3ffff6000 size 0x2000
2020-04-11 23:30:56.294 25114-25154/com.example.fitnotes D/EGL_emulation: eglMakeCurrent: 0xdbf1a120: ver 3 0 (tinfo 0xdbf0f1a0)
2020-04-11 23:30:56.313 25114-25153/com.example.fitnotes V/FA: App measurement collection enabled
2020-04-11 23:30:56.314 25114-25153/com.example.fitnotes V/FA: App measurement enabled for app package, google app id: com.example.fitnotes, 1:247538218926:android:4af44b308740275bc97a3f
2020-04-11 23:30:56.323 25114-25153/com.example.fitnotes I/FA: App measurement initialized, version: 21028
2020-04-11 23:30:56.323 25114-25153/com.example.fitnotes I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
2020-04-11 23:30:56.324 25114-25153/com.example.fitnotes I/FA: To enable faster debug mode event logging run:
adb shell setprop debug.firebase.analytics.app com.example.fitnotes
2020-04-11 23:30:56.324 25114-25153/com.example.fitnotes D/FA: Debug-level message logging enabled
2020-04-11 23:30:56.328 25114-25154/com.example.fitnotes D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 1 0
2020-04-11 23:30:56.675 25114-25125/com.example.fitnotes I/xample.fitnote: Background concurrent copying GC freed 12091(2542KB) AllocSpace objects, 9(244KB) LOS objects, 49% free, 1893KB/3787KB, paused 11.909ms total 108.785ms
2020-04-11 23:30:56.824 25114-25153/com.example.fitnotes V/FA: Connecting to remote service
2020-04-11 23:30:56.864 25114-25153/com.example.fitnotes V/FA: Connection attempt already in progress
2020-04-11 23:30:56.868 25114-25153/com.example.fitnotes V/FA: Activity resumed, time: 23076629
2020-04-11 23:30:56.881 25114-25153/com.example.fitnotes I/FA: Tag Manager is not found and thus will not be used
2020-04-11 23:30:56.919 25114-25153/com.example.fitnotes V/FA: Connection attempt already in progress
2020-04-11 23:30:56.920 25114-25153/com.example.fitnotes V/FA: Connection attempt already in progress
2020-04-11 23:30:56.920 25114-25153/com.example.fitnotes D/FA: Connected to remote service
2020-04-11 23:30:56.921 25114-25153/com.example.fitnotes V/FA: Processing queued up service tasks: 4
2020-04-11 23:31:00.791 25114-25114/com.example.fitnotes W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy#1e91d36
2020-04-11 23:31:00.799 25114-25153/com.example.fitnotes V/FA: Recording user engagement, ms: 4674
2020-04-11 23:31:00.815 25114-25114/com.example.fitnotes V/FA: onActivityCreated
2020-04-11 23:31:00.928 25114-25153/com.example.fitnotes V/FA: Activity paused, time: 23081303
2020-04-11 23:31:01.142 25114-25154/com.example.fitnotes D/EGL_emulation: eglMakeCurrent: 0xdbf1a120: ver 3 0 (tinfo 0xdbf0f1a0)
2020-04-11 23:31:01.170 25114-25154/com.example.fitnotes D/EGL_emulation: eglMakeCurrent: 0xdbf1a120: ver 3 0 (tinfo 0xdbf0f1a0)
2020-04-11 23:31:01.209 25114-25154/com.example.fitnotes D/EGL_emulation: eglMakeCurrent: 0xdbf1a120: ver 3 0 (tinfo 0xdbf0f1a0)
2020-04-11 23:31:01.271 25114-25153/com.example.fitnotes V/FA: Activity resumed, time: 23081552
2020-04-11 23:31:03.148 25114-25114/com.example.fitnotes I/AssistStructure: Flattened final assist data: 3084 bytes, containing 1 windows, 18 views
2020-04-11 23:31:06.509 25114-25153/com.example.fitnotes V/FA: Inactivity, disconnecting from the service
2020-04-11 23:31:10.941 25114-25114/com.example.fitnotes I/AssistStructure: Flattened final assist data: 3132 bytes, containing 1 windows, 18 views
2020-04-11 23:31:14.486 25114-25114/com.example.fitnotes I/Info: Button Pressed
2020-04-11 23:31:14.486 25114-25114/com.example.fitnotes I/Info: uu

Can we program the app to restart on its own? [duplicate]

This question already has answers here:
How do I programmatically "restart" an Android app?
(31 answers)
Closed 3 years ago.
My app doesn't function as intended after fresh installation on the device. The user has to manually close the app and start it again for proper functionality. A quick fix is needed, something as simple as the app restarting on its own after first launch (this only has to happen 1 time).
05/22 19:44:57: Launching app
$ adb install-multiple -r -t C:\Users\Gregory\AndroidStudioProjects\GAaudioTransform\app\build\intermediates\split-apk\debug\slices\slice_6.apk C:\Users\Gregory\AndroidStudioProjects\GAaudioTransform\app\build\intermediates\split-apk\debug\slices\slice_4.apk C:\Users\Gregory\AndroidStudioProjects\GAaudioTransform\app\build\intermediates\split-apk\debug\dep\dependencies.apk C:\Users\Gregory\AndroidStudioProjects\GAaudioTransform\app\build\intermediates\resources\instant-run\debug\resources-debug.apk C:\Users\Gregory\AndroidStudioProjects\GAaudioTransform\app\build\intermediates\split-apk\debug\slices\slice_9.apk C:\Users\Gregory\AndroidStudioProjects\GAaudioTransform\app\build\intermediates\split-apk\debug\slices\slice_8.apk C:\Users\Gregory\AndroidStudioProjects\GAaudioTransform\app\build\intermediates\split-apk\debug\slices\slice_2.apk C:\Users\Gregory\AndroidStudioProjects\GAaudioTransform\app\build\intermediates\split-apk\debug\slices\slice_3.apk C:\Users\Gregory\AndroidStudioProjects\GAaudioTransform\app\build\intermediates\split-apk\debug\slices\slice_5.apk C:\Users\Gregory\AndroidStudioProjects\GAaudioTransform\app\build\intermediates\split-apk\debug\slices\slice_1.apk C:\Users\Gregory\AndroidStudioProjects\GAaudioTransform\app\build\intermediates\split-apk\debug\slices\slice_7.apk C:\Users\Gregory\AndroidStudioProjects\GAaudioTransform\app\build\intermediates\split-apk\debug\slices\slice_0.apk C:\Users\Gregory\AndroidStudioProjects\GAaudioTransform\app\build\intermediates\instant-run-apk\debug\app-debug.apk
Split APKs installed in 5 s 337 ms
$ adb shell am start -n "tk.gandriks.gaaudiotransform/tk.gandriks.gaaudiotransform.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet..Waiting for process to come online
Connected to process 11440 on device samsung-sm_g930f-ce05160561e0761105
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
E/Zygote: isWhitelistProcess - Process is Whitelisted
E/libpersona: scanKnoxPersonas
Couldn't open the File - /data/system/users/0/personalist.xml - No such file or directory
W/SELinux: SELinux selinux_android_compute_policy_index : Policy Index[2], Con:u:r:zygote:s0 RAM:SEPF_SM-G930F_8.0.0_0018, [-1 -1 -1 -1 0 1]
I/SELinux: SELinux: seapp_context_lookup: seinfo=untrusted, level=s0:c512,c768, pkgname=tk.gandriks.gaaudiotransform
I/zygote64: Late-enabling -Xcheck:jni
D/TimaKeyStoreProvider: TimaKeyStore is not enabled: cannot add TimaSignature Service and generateKeyPair Service
D/ActivityThread: Added TimaKeyStore provider
I/zygote64: no shared libraies, dex_files: 1
I/InstantRun: starting instant run server: is main process
D/OpenGLRenderer: HWUI GL Pipeline
D/ViewRootImpl#d597feb[MainActivity]: setView = DecorView#ed74148[MainActivity] TM=true MM=false
D/ViewRootImpl#d597feb[MainActivity]: dispatchAttachedToWindow
V/Surface: sf_framedrop debug : 0x4f4c, game : false, logging : 0
D/ViewRootImpl#d597feb[MainActivity]: Relayout returned: old=[0,0][0,0] new=[0,0][1440,2560] result=0x7 surface={valid=true 484328804352} changed=true
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Swap behavior 2
D/libGLESv1: STS_GLApi : DTS, ODTC are not allowed for Package : tk.gandriks.gaaudiotransform
D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000, [1440x2560]-format:1
D/OpenGLRenderer: eglCreateWindowSurface = 0x70c9e2df00
D/ViewRootImpl#d597feb[MainActivity]: MSG_RESIZED_REPORT: frame=Rect(0, 0 - 1440, 2560) ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1
D/ViewRootImpl#d597feb[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 1
V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo#56c3619 nm : tk.gandriks.gaaudiotransform ic=null
I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo#7e4d6de nm : tk.gandriks.gaaudiotransform ic=null
D/ViewRootImpl#c82cf8d[Toast]: setView = android.widget.LinearLayout{2fd8542 V.E...... ......I. 0,0-0,0} TM=true MM=false
V/Toast: Text: Qerm in android.widget.Toast$TN#7980953
D/ViewRootImpl#c82cf8d[Toast]: dispatchAttachedToWindow
V/Surface: sf_framedrop debug : 0x4f4c, game : false, logging : 0
D/ViewRootImpl#c82cf8d[Toast]: Relayout returned: old=[0,0][0,0] new=[373,2128][1066,2304] result=0x7 surface={valid=true 484137521152} changed=true
D/ViewRootImpl#c82cf8d[Toast]: MSG_RESIZED_REPORT: frame=Rect(373, 2128 - 1066, 2304) ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
D/ViewRootImpl#c82cf8d[Toast]: dispatchDetachedFromWindow
D/InputEventReceiver: channel 'd449b05 Toast (client)' ~ Disposing input event receiver.
channel 'd449b05 Toast (client)' ~NativeInputEventReceiver.
V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo#7c57290 nm : tk.gandriks.gaaudiotransform ic=null
I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
D/OpenGLRenderer: eglDestroySurface = 0x70c9e2df00
D/ViewRootImpl#d597feb[MainActivity]: Relayout returned: old=[0,0][1440,2560] new=[0,0][1440,2560] result=0x5 surface={valid=false 0} changed=true
D/ViewRootImpl#d597feb[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 0
The error in this log is the line:
E/Zygote: isWhitelistProcess - Process is Whitelisted
E/libpersona: scanKnoxPersonas
Couldn't open the File - /data/system/users/0/personalist.xml - No such file or directory
Even though there might be some answers to this question, from my(and probably most of the users) point of view this would be a terrible experience. Fix the original problem, any workaround that you do that results in app restarting itself will probably end in user uninstalling your app. Keep your app stable and users happy!

App crash on Facebook login using facebook4 plugin for phonegap on android

I have a phonegap hybrid app with Facebook connect plugin. First time when I login then the FB login works but after I logout and then again try to login via Facebook then the app crashes with the following Logcat results :
Plugin URL :
https://github.com/jeduan/cordova-plugin-facebook4
06-18 21:31:50.071 3129-3219/? E/Surface: getSlotFromBufferLocked: unknown buffer: 0x9b2370a0
06-18 21:31:50.096 3129-3129/? I/Choreographer: Skipped 39 frames! The application may be doing too much work on its main thread.
06-18 21:31:50.104 3129-3234/? D/EGL_emulation: eglMakeCurrent: 0x9e677300: ver 2 0 (tinfo 0xaa366e80)
06-18 21:31:50.356 3129-3129/? D/CordovaActivity: Incoming Result. Request code = 64206
06-18 21:31:50.356 3129-3129/? D/CordovaInterfaceImpl: Sending activity result to plugin
06-18 21:31:50.356 3129-3129/? D/ConnectPlugin: activity result in plugin: requestCode(64206), resultCode(-1)
06-18 21:31:50.372 3129-3129/? D/com.facebook.FacebookSdk: getGraphApiVersion: v3.0
06-18 21:31:50.372 3129-3129/? D/com.facebook.FacebookSdk: getGraphApiVersion: v3.0
06-18 21:31:50.378 3129-3129/? D/CordovaActivity: Resumed the activity.
06-18 21:31:50.379 3129-3129/? W/com.facebook.appevents.AppEventsLogger: activateApp events are being logged automatically. There's no need to call activateApp explicitly, this is safe to remove.
06-18 21:31:50.551 3129-3219/? E/Surface: getSlotFromBufferLocked: unknown buffer: 0x98eed520
06-18 21:31:51.043 3129-3129/? D/AndroidRuntime: Shutting down VM
--------- beginning of crash
06-18 21:31:51.044 3129-3129/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.sqlchild.app1, PID: 3129
java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.indexOf(int)' on a null object reference
at libcore.net.UriCodec.decode(UriCodec.java:153)
at java.net.URLDecoder.decode(URLDecoder.java:60)
at org.apache.cordova.facebook.ConnectPlugin.makeGraphCall(ConnectPlugin.java:751)
at org.apache.cordova.facebook.ConnectPlugin.access$200(ConnectPlugin.java:55)
at org.apache.cordova.facebook.ConnectPlugin$2$1.onCompleted(ConnectPlugin.java:111)
at com.facebook.GraphRequest$1.onCompleted(GraphRequest.java:301)
at com.facebook.GraphRequest$5.run(GraphRequest.java:1380)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
06-18 21:31:51.052 1667-2063/? W/ActivityManager: Force finishing activity com.sqlchild.app1/.MainActivity
06-18 21:31:51.067 1259-1321/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 589824
[ 06-18 21:31:51.097 1667: 2063 D/ ]
HostConnection::get() New Host Connection established 0x9aa0cc00, tid 2063
[ 06-18 21:31:51.099 1667: 2063 W/ ]
Unrecognized GLES max version string in extensions: ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1
06-18 21:31:51.113 1259-1259/? E/EGL_emulation: tid 1259: eglCreateSyncKHR(1881): error 0x3004 (EGL_BAD_ATTRIBUTE)
06-18 21:31:51.199 1667-1667/? W/art: Long monitor contention event with owner method=void com.android.server.am.ActivityManagerService.crashApplication(com.android.server.am.ProcessRecord, android.app.ApplicationErrorReport$CrashInfo) from ActivityManagerService.java:12502 waiters=0 for 133ms
06-18 21:31:51.289 1667-1677/? I/art: Background partial concurrent mark sweep GC freed 36018(2MB) AllocSpace objects, 1(20KB) LOS objects, 33% free, 7MB/11MB, paused 3.358ms total 105.317ms
06-18 21:31:51.381 1667-1729/? I/OpenGLRenderer: Initialized EGL, version 1.4
06-18 21:31:51.390 1667-1729/? D/EGL_emulation: eglCreateContext: 0xa07fc120: maj 2 min 0 rcv 2
06-18 21:31:51.414 1667-1729/? D/EGL_emulation: eglMakeCurrent: 0xa07fc120: ver 2 0 (tinfo 0xa0ea42f0)
06-18 21:31:51.484 1667-1729/? D/EGL_emulation: eglMakeCurrent: 0xa07fc120: ver 2 0 (tinfo 0xa0ea42f0)
06-18 21:31:51.691 1667-3205/? I/AccountManagerService: getTypesVisibleToCaller: isPermitted? true
06-18 21:31:51.698 1667-1683/? W/ActivityManager: Activity pause timeout for ActivityRecord{21fdafb u0 com.sqlchild.app1/.MainActivity t8 f}
06-18 21:31:51.877 1667-3206/? W/art: Long monitor contention event with owner method=void com.android.server.am.ActivityStack$ActivityStackHandler.handleMessage(android.os.Message) from ActivityStack.java:283 waiters=0 for 175ms
06-18 21:31:51.896 1667-1683/? I/ActivityManager: Killing 2545:com.android.keychain/1000 (adj 15): empty #17
06-18 21:31:52.070 2029-2239/? D/EGL_emulation: eglMakeCurrent: 0xae594600: ver 2 0 (tinfo 0xae5924b0)
06-18 21:31:59.062 3129-3129/? I/Process: Sending signal. PID: 3129 SIG: 9
06-18 21:31:59.075 1667-1729/? D/EGL_emulation: eglMakeCurrent: 0xa07fc120: ver 2 0 (tinfo 0xa0ea42f0)
06-18 21:31:59.079 1667-1729/? E/Surface: getSlotFromBufferLocked: unknown buffer: 0x9e8d1360
06-18 21:31:59.128 1667-3206/? E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 104)
06-18 21:31:59.130 1667-1721/? W/InputDispatcher: channel '7f56d84 com.sqlchild.app1/com.sqlchild.app1.MainActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9
06-18 21:31:59.130 1667-1721/? E/InputDispatcher: channel '7f56d84 com.sqlchild.app1/com.sqlchild.app1.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
06-18 21:31:59.129 1667-3206/? W/InputMethodManagerService: Got RemoteException sending setActive(false) notification to pid 3129 uid 10061
06-18 21:31:59.132 1667-1721/? W/InputDispatcher: channel 'e76402c com.sqlchild.app1/com.facebook.FacebookActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9
06-18 21:31:59.133 1667-1721/? E/InputDispatcher: channel 'e76402c com.sqlchild.app1/com.facebook.FacebookActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
06-18 21:31:59.153 1667-3206/? E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 104)
06-18 21:31:59.168 1667-1680/? I/WindowState: WIN DEATH: Window{e76402c u0 com.sqlchild.app1/com.facebook.FacebookActivity}
06-18 21:31:59.169 1667-1680/? W/InputDispatcher: Attempted to unregister already unregistered input channel 'e76402c com.sqlchild.app1/com.facebook.FacebookActivity (server)'
06-18 21:31:59.174 1667-2280/? D/GraphicsStats: Buffer count: 3
06-18 21:31:59.207 1667-1681/? I/ActivityManager: Process com.sqlchild.app1 (pid 3129) has died
06-18 21:31:59.257 1667-3110/? I/WindowState: WIN DEATH: Window{7f56d84 u0 com.sqlchild.app1/com.sqlchild.app1.MainActivity}
06-18 21:31:59.257 1667-3110/? W/InputDispatcher: Attempted to unregister already unregistered input channel '7f56d84 com.sqlchild.app1/com.sqlchild.app1.MainActivity (server)'

Categories