Здравствуйте, у меня проблема при запуске созданного приложения, что нужно сделать чтоб исправить?
Launching 'app' on My device API 29.
App restart successful without requiring a re-install.
$ adb shell am start -n "com.example.visourschatsfriends/com.example.visourschatsfriends.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 18630 on device 'My_device_API_29 [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/urschatsfriend: Long monitor contention with owner main (18630) at void android.content.res.AssetManager.nativeSetConfiguration(long, int, int, java.lang.String, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int)(AssetManager.java:-2) waiters=0 in void android.app.ActivityThread.updatePendingConfiguration(android.content.res.Configuration) for 382ms
I/FirebaseApp: Device unlocked: initializing all Firebase APIs for app [DEFAULT]
I/FirebaseInitProvider: FirebaseApp initialization successful
W/GooglePlayServicesUtil: Google Play Store is missing.
E/ActivityThread: Failed to find provider info for com.google.android.gms.chimera
W/DynamiteModule: Failed to retrieve remote module version.
D/libEGL: Emulator has host GPU support, qemu.gles is set to 1.
E/DynamiteModule: Failed to load IDynamiteLoader from GmsCore: Application package com.google.android.gms not found
I/DynamiteModule: Considering local module com.google.android.gms.measurement.dynamite:51 and remote module com.google.android.gms.measurement.dynamite:0
Selected local version of com.google.android.gms.measurement.dynamite
W/libc: Unable to set property "qemu.gles" to "1": connection failed; errno=13 (Permission denied)
E/DynamiteModule: Failed to load IDynamiteLoader from GmsCore: Application package com.google.android.gms not found
I/FirebaseAuth: [FirebaseAuth:] Preparing to create service connection to fallback implementation
V/FA: onActivityCreated
W/urschatsfriend: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
W/urschatsfriend: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
D/libEGL: loaded /vendor/lib64/egl/libEGL_emulation.so
D/libEGL: loaded /vendor/lib64/egl/libGLESv1_CM_emulation.so
D/libEGL: loaded /vendor/lib64/egl/libGLESv2_emulation.so
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.visourschatsfriends, PID: 18630
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.visourschatsfriends/com.example.visourschatsfriends.MainActivity}: java.lang.ClassCastException: androidx.constraintlayout.widget.ConstraintLayout cannot be cast to android.widget.RelativeLayout
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: java.lang.ClassCastException: androidx.constraintlayout.widget.ConstraintLayout cannot be cast to android.widget.RelativeLayout
at com.example.visourschatsfriends.MainActivity.onCreate(MainActivity.java:38)
at android.app.Activity.performCreate(Activity.java:7802)
at android.app.Activity.performCreate(Activity.java:7791)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
I/Process: Sending signal. PID: 18630 SIG: 9
W/RenderThread: type=1400 audit(0.0:66): avc: denied { write } for name="property_service" dev="tmpfs" ino=6722 scontext=u:r:untrusted_app:s0:c106,c256,c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0 app=com.example.visourschatsfriends
MainActivity}: java.lang.ClassCastException: androidx.constraintlayout.widget.ConstraintLayout cannot be cast to android.widget.RelativeLayout
Где-то в вашем лейауте для MainActivity (activity_main.xml) используется ConstraintLayout , который вы у себя в коде в MainActivity приводите/кастите к RelativeLayout . Смотрите что у вас в методе onCreate(MainActivity.java:38) на 38 строчке
Нет, но вы мне подсказали где искать ее, так что все равно помогли.При этом всем до этого у меня куча было ошибок, я их убирал, даже версию от 31 до 29 понижал, и вот теперь эта ошибка все поритила.Само приложение, запускается и потом вылетает, при этом в консоли выбивает эту ошибку что в описании.Вот так