TeamVanced / VancedManager

Vanced Installer
GNU General Public License v3.0
8.25k stars 1.14k forks source link

Root install hangs after downloading #422

Open jimbt opened 3 years ago

jimbt commented 3 years ago

Phone Specifications:

Please describe the problem you are having in as much detail as possible: The installation of YouTube Vanced stalls after downloading the apks. I let the progress bar cycle for at least 5 minutes. The Manager is unresponsive: the cancel button doesn't work and neither does the android back button. The Manager must be killed from the task list.

Steps to reproduce: Start a root mode install of YouTube Vanced. After the downloads are complete the progress bar will "cycle" but never complete. The Manager will be unresponsive.

Further details: No logs are available from Vanced Manager since it becomes unresponsive and the logs are apparently cleared when Manager is started. Please let me know how to capture any desired logs outside of Manager.

Related to #235.

X1nto commented 3 years ago

You can use adb to get logs from manager, there are plenty of guides on the internet

jimbt commented 3 years ago

Steps

vancedManager.logcat.log

X1nto commented 3 years ago

It looks like manager fails to get version code of stock youtube after installing it, I'll investigate the issue

yadav-hemant commented 3 years ago

Is it necessary to have the stock youtube installed for root version? I uninstalled the stock youtube and then tried to install vanced. I am getting the same issue

X1nto commented 3 years ago

Is it necessary to have the stock youtube installed for root version? I uninstalled the stock youtube and then tried to install vanced. I am getting the same issue

No it's not

bacitoto commented 3 years ago

Phone Specifications:

Same issue here.

LOGCAT

As a workaround I installed older stock YT, then newer version of vanced on top

X1nto commented 3 years ago

Please check on 2.6.0

mooms06 commented 3 years ago

Same issue on 2.6.0 with a Poco F3 on latest MIUI EU ROM (12.0.05), MIUI optimizations disabled.

As a workaround I installed older stock YT, then newer version of vanced on top

Thanks for the tip, I wasn't able to install and older version for some reason, but installing the same version as a split apk (YouTube 16.14.34 ) worked for men after that I was able to install the same version from Vanced Manager.

jimbt commented 3 years ago

Same apparent issue on 2.6.0.
vancedManager260.logcat.log

I've previously updated Magisk to 22.1 - I'll update the description.

X1nto commented 3 years ago

Stock installation is failing for whatever reasons, which aren't logged. It might be ROM related, so I doubt there's a fix. I'll investigate this further

nicolasmaia commented 3 years ago

This happened to me only after I deleted the YouTube app and tried to install Vanced.

My blind guess would be that the installer is trying to replace the YouTube system app and doesn't know what to do when it doesn't exist.

cl-ement05 commented 3 years ago

I tried to reproduce this issue on LineageOS 17.1 but everything works fine for me. Since no actual error is logged, it is hard to find out what's going wrong. If you have Android Studio installed (or any other IDE) and that you are familiar with building android apps,

  1. clone this repo
  2. open the file app/src/main/java/com/vanced/manager/utils/PackageHelper.kt
  3. Go to line 446 and change
    log(INSTALLER_TAG, "Unable to get package info")

    to

    log(INSTALLER_TAG, "Unable to get package info for package $pkg: $e")
  4. Build the app, run it on your phone and send logs again

If you don't want to go through all this, I built a manager apk with the change above. Note that you will have to uninstall original Vanced Manager to install my apk or run yours (except if you disabled signature verification in Lucky Patcher)

Bomfunk commented 3 years ago

I have the same issue with this setup:

Phone Specifications:

Even if I install the stock YouTube or YouTube Music, their versions are not shown in the manager, which makes me think that it's also an "unable to get package info" issue. On another device though (OnePlus 5 with LineageOS) the manager app works well in root mode. Is there any way I can help by gathering some info? That custom-built manager APK link doesn't work, unfortunately.

P.S. The non-root version works, but I would really wish to use the root version, specifically because non-root doesn't work with chromecast it seems.

cl-ement05 commented 3 years ago

@X1nto I think it would be great if https://github.com/YTVanced/VancedManager/blob/25f8f800eaa18b36f06d602f71aa2ce6aec88a69/app/src/main/java/com/vanced/manager/utils/PackageHelper.kt#L437 was changed to

log(INSTALLER_TAG, "Unable to get package info for package $pkg: $e")

like I mentioned before.

It would give more details when analyzing logs. (I don't want to create a pull request only for editing one line that's why I am asking you to do it lol)

cl-ement05 commented 3 years ago

@Bomfunk you can always try the custom manager APK you talked about : app-debug.zip

However please keep in mind what I said in my previous comment :

Note that you will have to uninstall original Vanced Manager to install my apk or run yours (except if you disabled signature verification in Lucky Patcher)

X1nto commented 3 years ago

@X1nto I think it would be great if

https://github.com/YTVanced/VancedManager/blob/25f8f800eaa18b36f06d602f71aa2ce6aec88a69/app/src/main/java/com/vanced/manager/utils/PackageHelper.kt#L437

was changed to

log(INSTALLER_TAG, "Unable to get package info for package $pkg: $e")

like I mentioned before.

It would give more details when analyzing logs. (I don't want to create a pull request only for editing one line that's why I am asking you to do it lol)

Yeah, seems like a nice idea

Bomfunk commented 3 years ago

@cl-ement05 Thank you - the debug app at your link actually gave an error instead of just hanging like the original one. The error was INSTALL_FAILED_VERSION_DOWNGRADE, which gave me a hint why this can be, which led to a complete issue resolution. So the issue was this: once youtube or youtube music is installed and then uninstalled, it remains installed in another user's space on the same device. I asked that user to log in and remove the stock apps, and after that even the original vanced manager worked like a charm.

Even if youtube seems to be uninstalled, it may still be seen in the "all apps" list. To fix the installation issue, one has to make sure it's not present in that list.

cl-ement05 commented 3 years ago

@Bomfunk oh nice. You're welcome then