bug: There is exception in CLI after using patcher 21.1.0-dev.3
Bug description
I want to patch YT 20.12.46 using patches 5.28.0. Updated CLI with patcher 21.1.0-dev.3 and Library 3.2.0-dev.1 but exception appear as shown in the log below
Error logs
Exception in thread "main" java.lang.NoSuchMethodError: 'void com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter.<init>(java.lang.String, com.google.common.collect.ImmutableSet, java.lang.String)'
at app.revanced.patches.youtube.misc.settings.SettingsPatchKt.settingsPatch$lambda$16$lambda$14(SettingsPatch.kt:250)
at app.revanced.patcher.patch.Patch.execute(Patch.kt:71)
at app.revanced.patcher.patch.BytecodePatch.execute$revanced_patcher(Patch.kt:160)
at app.revanced.patcher.Patcher$invoke$1.invokeSuspend$execute(Patcher.kt:84)
at app.revanced.patcher.Patcher$invoke$1.invokeSuspend$execute(Patcher.kt:72)
at app.revanced.patcher.Patcher$invoke$1.invokeSuspend(Patcher.kt:109)
at app.revanced.patcher.Patcher$invoke$1.invoke(Patcher.kt)
at app.revanced.patcher.Patcher$invoke$1.invoke(Patcher.kt)
at kotlinx.coroutines.flow.SafeFlow.collectSafely(Builders.kt:57)
at kotlinx.coroutines.flow.AbstractFlow.collect(Flow.kt:226)
at app.revanced.cli.command.PatchCommand$run$1$4.invokeSuspend(PatchCommand.kt:321)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:277)
at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:95)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:69)
at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:48)
at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
at app.revanced.cli.command.PatchCommand.run(PatchCommand.kt:320)
at picocli.CommandLine.executeUserObject(CommandLine.java:2030)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2465)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2457)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2419)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2277)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2421)
at picocli.CommandLine.execute(CommandLine.java:2174)
at app.revanced.cli.command.MainCommandKt.main(MainCommand.kt:12)
Solution
No response
Additional context
No response
Acknowledgements
- [x] I have checked all open and closed bug reports and this is not a duplicate.
- [x] I have chosen an appropriate title.
- [x] All requested information has been provided properly.
That's because you're using incompatible versions of smali
@oSumAtrIX I never changed the smali I only changed these line
revanced-patcher = "21.1.0-dev.3"
revanced-library = "3.2.0-dev.1"
Try build the CLI yourself and see. If you get same error as mine, then it's a bug.
But when I'm using patcher v22 (patches and patcher) branch, all is OK. I did not know what @LisoUseInAIKyrios magic did.
@oSumAtrIX This in not smali issue, the bug starting patcher 21.1.0-dev.2. Downgraded to patcher 21.1.0-dev.1 fixed the issue. But. still using patcher v22 branch worked.
I can reproduce the same issue.
revanced-patcher = "21.1.0-dev.3"
revanced-library = "3.2.0-dev.1"
Patching the latest dev branch:
INFO: Executing patches
Exception in thread "main" java.lang.NoSuchMethodError: 'void com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter.<init>(java.lang.String, com.google.common.collect.ImmutableSet, java.lang.String)'
at app.revanced.patches.youtube.misc.settings.SettingsPatchKt.settingsPatch$lambda$16$lambda$14(SettingsPatch.kt:250)
Patcher repo had an api dump error and the release was broken. All the commits from the past 6 months were only released yesterday.
The issue is here:
~~https://github.com/ReVanced/revanced-patches/blob/f15003a47beb0b839aeecfc4bc9f726735197bfd/gradle/libs.versions.toml#L5~~ https://github.com/ReVanced/revanced-patcher/blob/ead701bdaf51f30ccefe846471bc2d3b550b7bdb/gradle/libs.versions.toml#L11
Patcher needs Smali dependency bumped to smali = "3.0.9".
I already had to do this for V22 branch which is why it works.
Nice catch, can you reopen this topic, Liso?
I think this issue should be moved to Library repo, but I don't have permission to do that.
Actually, this might need to be in patcher repo.
There's a few old references to libraries that makes this confusing.
This is not a revanced issue. I already complained to google about this breaking API change. They said it's unfortunate but a real bug but they apply the ostrich algorithm in this case. Bumping smali everywhere should fix the issue, like i said
Smali was locked to some version due a bug everywhere in ReVanced, but they resolved this. We can bump it everywhere to fix the issue. However people that don't update manager and use the latest patches will get this error, breaking API changes like this cant be avoided. Manager does show an update dialog though when it is outdated so this should be fine