ReVanced / revanced-patches

🧩 Patches for ReVanced
https://revanced.app
GNU General Public License v3.0
2.47k stars 287 forks source link

bug: Weird YouTube ReVanced crash by Selecting an account upon starting it up (Device Related issue?) #3704

Closed Daninnocent closed 1 month ago

Daninnocent commented 1 month ago

Bug description

Crashes on Startup upon clicking an account, as seen in the screenshot, i can't record it because my Screen Recorder just refuses to do so.

I've provided the crash logs for the patched app using LogFox with Shizuku permissions.

IMG_20240927_174355

  1. Downloaded Suggested Version (NO DPI)
  2. Selected the App on Storage
  3. Used the Default Patches
  4. Patched it and the process seemed to go Smoothly, without Errors
  5. Removed my Google account from MicroG using the built-in settings from my Device
  6. Reinstalled MicroG and Readded the account
  7. Opened the patched app and as described above, it happened

Error logs

FATAL EXCEPTION: BG Thread #6
Process: app.revanced.android.youtube, PID: 22538
android.database.sqlite.SQLiteCantOpenDatabaseException: Cannot open database '/data/user/0/app.revanced.android.youtube/no_backup/androidx.work.workdb': Directory /data/user/0/app.revanced.android.youtube/no_backup doesn't exist
    at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:252)
    at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:205)
    at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:505)
    at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:206)
    at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:198)
    at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:918)
    at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:898)
    at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:762)
    at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:751)
    at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:373)
    at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:316)
    at dlg.c(PG:1)
    at dlg.b(PG:147)
    at dlh.a(PG:5)
    at dka.q(PG:5)
    at dka.k(PG:1)
    at dka.s(PG:4)
    at bli.e(PG:4)
    at dxk.a(PG:8)
    at djk.invokeSuspend(PG:286)
    at bawb.resumeWith(PG:12)
    at bbba.run(PG:109)
    at dyk.run(PG:122)
    at qfb.run(PG:7)
    at albu.run(PG:50)
    at qes.run(PG:695)
    at java.lang.Thread.run(Thread.java:923)
    at qgl.run(PG:64)
    Suppressed: bbgb: [bbck{Cancelling}@9ae81c1, dyl@71c3d66]
Caused by: android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14 SQLITE_CANTOPEN): Could not open database
    at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method)
    at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:224)
    ... 27 more

Solution

No response

Additional context

Device Info: -Redmi Note 8 -Latest MIUI 12 Global ROM Android 11 -No Root -Bootloader Locked

It's weird because i have used ReVanced without issue before but for some reason when i went to reinstall it, this happens.

I have rebooted my device a couple of times, reinstalled, reset the apps also a couple of times, and yet to no avail.

Acknowledgements

LisoUseInAIKyrios commented 1 month ago

Try:

  1. Unstalling MicroG
  2. Clear ReVanced YT storage (or uninstall then reinstall)
  3. Launch RV YT
  4. Install MicroG (but do not add any accounts yet)
  5. Launch RV YT
  6. Verify app works (with no account)
  7. Log in from inside RV YT
Daninnocent commented 1 month ago

Try:

  1. Unstalling MicroG
  2. Clear ReVanced YT storage (or uninstall then reinstall)
  3. Launch RV YT
  4. Install MicroG (but do not add any accounts yet)
  5. Launch RV YT
  6. Verify app works (with no account)
  7. Log in from inside RV YT

Reinstalled MicroG, didn't add any accounts, Reinstalled Youtube ReVanced, and the crash still occured, now with no added accounts it seems to just crash for one second before it displays this.

Screensht_2024-09-28-13-10-07-754_app revanced android youtube

I could only add an account in the MicroG settings now.

LisoUseInAIKyrios commented 1 month ago

Try going to RV YT app info, and turn all app permissions to on. Do the same for MicroG.

I've seen Android 10 crash on YT startup if the permissions are not enabled.

Daninnocent commented 1 month ago

Try going to RV YT app info, and turn all app permissions to on. Do the same for MicroG.

I've seen Android 10 crash on YT startup if the permissions are not enabled.

Granted all the permissions for both of the apps, same thing happens.

LisoUseInAIKyrios commented 1 month ago

Try patching with only GmsCore support

Daninnocent commented 1 month ago

Try patching with only GmsCore support

I tried as you suggested, it happened again.

IMG_20240928_135932

I added the account the same way i had this issue btw, i added it through MicroG, somehow it prevents it from crashing for one second when i do, and also the crash logs appears to have the same issue with it being SQLite again very weird.

LisoUseInAIKyrios commented 1 month ago

Try patching older versions of YT (exclude app patches except GmsCore). Start with 18.49.37

LisoUseInAIKyrios commented 1 month ago

Also, make sure you have at least 1 GB of free storage on your device.

Daninnocent commented 1 month ago

Try patching older versions of YT (exclude app patches except GmsCore). Start with 18.49.37

Also, make sure you have at least 1 GB of free storage on your device.

Tried that with the newest version of ReVanced Manager, same result

I have 6 gb of free storage all this time I've been troubleshooting, so I don't think that's the culprit.

I really wanna try to give some insight on why this can happen, but i have no clue why it's happening, even more confusing is that i had tried the patched app yesterday and it worked fine, yes it was this current version btw, but for some odd reason the playback buffered infinitely and that's why i went to repatch and reinstall YT ReVanced and then here we are.

LisoUseInAIKyrios commented 1 month ago

try clearing app data, turning on airplane mode, and then launch the app.

Also try installing the unpatched YT APK and verify it works (you'll need to uninstall stock app if it's installed).

Try checking upstream MicroG repo to see if there's any bug reports that resemble this (even though this looks like a YT issue).

cyberboh commented 1 month ago

Try going to RV YT app info, and turn all app permissions to on. Do the same for MicroG.

I've seen Android 10 crash on YT startup if the permissions are not enabled.

I'm using android 10, no any crashes here except full screen ads sometimes appear.

@Daninnocent Where did you download microG?

Daninnocent commented 1 month ago

try clearing app data, turning on airplane mode, and then launch the app.

Also try installing the unpatched YT APK and verify it works (you'll need to uninstall stock app if it's installed).

Try checking upstream MicroG repo to see if there's any bug reports that resemble this (even though this looks like a YT issue).

Tried it, it didn't seem to spark up anything.

I can't Install the apk i downloaded because Xiaomi is stupid enough to make it a system app, i uninstalled the app using adb, and then install the stock apk i downloaded but that didn't seem to work, i think i need root for that idk though.

I'll see what i can find there.

Daninnocent commented 1 month ago

Try going to RV YT app info, and turn all app permissions to on. Do the same for MicroG. I've seen Android 10 crash on YT startup if the permissions are not enabled.

I'm using android 10, no any crashes here except full screen ads sometimes appear.

@Daninnocent Where did you download microG?

Downloaded it from here. Tried both the Normal and Huawei version, didn't seem to do anything that would fix it.

cyberboh commented 1 month ago

@Daninnocent try patch with revanced CLI, it should be ok

Daninnocent commented 1 month ago

@Daninnocent try patch with revanced CLI, it should be ok

I don't think this is a ReVanced Manager issue, i did the patch successfully and not only that i even tried pre-built apks and ran into the same issue even the crash log being the same, it's definitely something wrong with my device but i can't figure out what's wrong with it when it was okay before.

I also can't really use CLI right now because i don't have a PC with me, it's why most of the ADB work i did was using Shizuku.

cyberboh commented 1 month ago

@Daninnocent try patch with revanced CLI, it should be ok

I don't think this is a ReVanced Manager issue, i did the patch successfully and not only that i even tried pre-built apks and ran into the same issue even the crash log being the same, it's definitely something wrong with my device but i can't figure out what's wrong with it when it was okay before.

I also can't really use CLI right now because i don't have a PC with me, it's why most of the ADB work i did was using Shizuku.

Then i'm sure it's device/ROM issue. Try deactivate MIUI optimizations, then check if problem persist or gone.

Daninnocent commented 1 month ago

@Daninnocent try patch with revanced CLI, it should be ok

I don't think this is a ReVanced Manager issue, i did the patch successfully and not only that i even tried pre-built apks and ran into the same issue even the crash log being the same, it's definitely something wrong with my device but i can't figure out what's wrong with it when it was okay before. I also can't really use CLI right now because i don't have a PC with me, it's why most of the ADB work i did was using Shizuku.

Then i'm sure it's device/ROM issue. Try deactivate MIUI optimizations, then check if problem persist or gone.

Yeah well, i did try that and it didn't work.

oSumAtrIX commented 1 month ago

Does the unpatched app work, also clear both apps data in the settings.

Daninnocent commented 1 month ago

Does the unpatched app work, also clear both apps data in the settings.

I can't test it because the YouTube app is systemized in MIUI, i tried removing it in adb and installing it but it didn't seem to work.

cyberboh commented 1 month ago

Does the unpatched app work, also clear both apps data in the settings.

I can't test it because the YouTube app is systemized in MIUI, i tried removing it in adb and installing it but it didn't seem to work.

You can install it directly since it's unpatched app, means not tempered.

oSumAtrIX commented 1 month ago

If it's systemized or not doesn't matter, check if it works

Daninnocent commented 1 month ago

I'm convinced this is an issue going on with my device messing with the package data and it being all screwed up or something, i don't know i can't really specify why it's doing this, in the crash log, it's trying to open a directory but can't for some reason?

the '/data/user/0/app.revanced.android.youtube/no_backup/androidx.work.workdb': Directory

The thing is i've tried using Youtube ReVanced Extended which is a fork of YouTube ReVanced, and it didn't have this issue because I'm speculating that it uses a different package name, it didn't use 'app.revanced.android.youtube' and so it didn't have that directory issue i guess, maybe that's why it didn't crash?

My guess is my device screwed up the directory that being the '/data/user/0/app.revanced.android.youtube/' one

and that's why YouTube ReVanced won't load properly what a mess!

I could be wrong here, but this is all i can think of because of all the troubleshooting I've tried doing, when nobody is having this issue.

oSumAtrIX commented 1 month ago

Please reopen the issue once you have confirmed what I asked

sarusani commented 1 month ago

I have the same issue on Android 9. Worked fine with patch version v4.15.0. It broke when I updated to v4.16.0. I'm using the unpatched APK that worked with 4.15.

LisoUseInAIKyrios commented 1 month ago

@sarusani Un-patched YT has been sometimes crashing when changing accounts. I saw this on Un-patched 19.37, and it's not a revanced issue.

sarusani commented 1 month ago

Unpatched APK loads without issues. APK patched with 4.15 loads without issues. APK patched with 4.16 crashes after the ReVanced announcement screen. Pretty sure it's a problem with the latest patches...

oSumAtrIX commented 1 month ago

Please attach error logs captured with Logcat in a new issue. Google how to do that.

LisoUseInAIKyrios commented 1 month ago

@sarusani go to app info for both RV YT and MicroG, and turn on all permissions for both.

For some reason Android 8.0 simulator crashes on launch unless permissions are given. Excluding the announcement patch fixes it without first setting the permissions, but looking at the logs it's not clear why.

LZeugirdor commented 3 weeks ago

Can confirm I'm also having this issue, was fine the previous patch I had but now crashes on startup, have tried updating gmscore, clearing data in both apps, removing accounts and clearing data again. Nothing fixes it. This issue is only occurring in YouTube revanced, not YouTube music revanced.

LZeugirdor commented 3 weeks ago

@sarusani Un-patched YT has been sometimes crashing when changing accounts. I saw this on Un-patched 19.37, and it's not a revanced issue.

I'm also having this issue though and unpatched YouTube is perfectly fine for me. I don't think this is a YouTube issue itself.

LZeugirdor commented 3 weeks ago

I just found out something very interesting. I was patching it a couple of times before uninstalling the manager and reinstalling it. I got some OOM errors so I cleared the data and tried again.

The final file size was different, the first patch which had issues was 144.1 mb according to my phone. The second file without issues was 144.2. I'm annoyed because I forgot to copy the logs for both but after recompiling it works fine now. Not sure what the correlation is there.