ReVanced / revanced-manager

💊 Application to use ReVanced on Android
https://revanced.app
GNU General Public License v3.0
18.21k stars 748 forks source link

bug: patching failed [lateinit property targetXmlEditor has not been initialized] #455

Closed Marooned-MB closed 2 years ago

Marooned-MB commented 2 years ago

Type

Error while running the manager

Bug description

I have YT Vanced (which started to show ads so I've decided to try reVanced) and blocked/hidden original YT app. In reVanced manager I picked original YT app (v14.18.56), picked a few patches and got error (log attached)

Steps to reproduce

  1. install manager
  2. pick YT app and patches
  3. patch

Android version

Android 9, MIUI 12.0.2

Manager version

0.0.36

Target package name

com.google.android.youtube

Target package version.

v14.18.56

Installation type

Non-root

Patches selected.

Not sure, some of them, but after patching failed there was no way to check what I chose. Not sure yet what those patches mean. In Vanced they were just in options. Haven't seen reVanced yet to see how it works.

Device logs (exported using Manager settings).

Initializing installer
Creating working directory
Copying original apk
Unpacking input apk
Reading dex files
Decoding AndroidManifest.xml only, because resources are not needed
Merging integrations
Deleting existing resource cache directory
Decoding resources
Executing all patches
Executing 'resource-mapping' of type: resource
Executing 'integrations' of type: bytecode
[error] general-ads:kotlin.Unit
[error] video-ads:kotlin.Unit
Executing 'locale-config-fix' of type: resource
Executing 'bottom-controls-resource-patch' of type: resource
[error] downloads:kotlin.Unit
[error] seekbar-tapping:kotlin.Unit
[error] hide-crowdfunding-box:kotlin.Unit
[error] hide-create-button:kotlin.Unit
[error] hide-shorts-button:kotlin.Unit
[error] return-youtube-dislike:kotlin.Unit
Skipping 'resource-mapping' because it has already been applied
Executing 'player-controls-bytecode-patch' of type: bytecode
[error] sponsorblock:kotlin.Unit
[error] hide-watch-in-vr:kotlin.Unit
[error] hide-watermark:kotlin.Unit
[error] custom-playback-speed:kotlin.Unit
Skipping 'locale-config-fix' because it has already been applied
Skipping 'locale-config-fix' because it has already been applied
Skipping 'resource-mapping' because it has already been applied
Executing 'settings-resource-patch' of type: resource
[error] microg-support:kotlin.Unit
[error] minimized-playback:kotlin.Unit
[error] settings:kotlin.Unit
An error occurred! Aborting
Error:
kotlin.UninitializedPropertyAccessException: lateinit property targetXmlEditor has not been initialized
    at app.revanced.patches.youtube.misc.playercontrols.resource.patch.BottomControlsResourcePatch.close(BottomControlsResourcePatch.kt:83)
    at app.revanced.patcher.Patcher$executePatches$1.invokeSuspend(Patcher.kt:375)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlin.sequences.SequenceBuilderIterator.hasNext(SequenceBuilder.kt:127)
    at app.revanced.manager.flutter.MainActivity.runPatcher$lambda-19(MainActivity.kt:328)
    at app.revanced.manager.flutter.MainActivity.$r8$lambda$aEBH7QyMEVbzs_zgD8iozv3hwbI(Unknown Source:0)
    at app.revanced.manager.flutter.MainActivity$$ExternalSyntheticLambda4.run(Unknown Source:24)
    at java.lang.Thread.run(Thread.java:764)

Installer logs (exported using Installer menu option) [unneeded if issue is not during patching].

No response

Screenshots or videos

No response

Solution

No response

Additional context

No response

Acknowledgements

Ushie commented 2 years ago

Use the recommended package version, 14.18.56 is too old and not supported

Marooned-MB commented 2 years ago

So in order to have working reVanced one must install original YT app even if it's not used? Can it be uninstalled after patching to remove it from the system?

Ushie commented 2 years ago

Use APKMirror to download the latest supported YouTube version and select the APK from storage in ReVanced Manager, if further instructions are needed, join the discord server and read the pinned post in the #support channel

ghost commented 2 years ago

Failed patches should not crash patcher. An issue should be opened regarding this.