Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: App update installation always fails on first try #2361

Closed
4 tasks done
JimKnoxx opened this issue Dec 23, 2024 · 11 comments
Closed
4 tasks done

bug: App update installation always fails on first try #2361

JimKnoxx opened this issue Dec 23, 2024 · 11 comments
Labels
Bug report Something isn't working

Comments

@JimKnoxx
Copy link

Bug description

I noticed for some time now, that the first time I am updating a already patched app, that the installation will fail. If I reselect the app and retry patching it works fine.
The log files shows two errors, hopefully they can help narrow down the problem!

I added the Log from the ReVanced Manager as a file, because the text is too long. I only copied the errors to the patch log part of this form.
revanced-manager_logcat_20241223125625606308.log

Version of ReVanced Manager and version & name of app you are patching

Manager v1.23.2
YouTube v19.47.53 (happend to older versions too)

Installation method

None

ReVanced Manager logs

Full log see as file above (too long for gitlab to be happy with)

First error:
12-23 12:53:14.001 22427 22427 V AconfigFlags: Read Aconfig default flag value com.google.pixel.camera.services.flags.camera_client_tracking_service_enabled = true
12-23 12:53:14.001 22427 22427 V AconfigFlags: Read Aconfig default flag value com.google.pixel.camera.services.flags.overlay_camera_callback_enabled = true
12-23 12:53:14.001 22427 22427 V AconfigFlags: Read Aconfig default flag value com.google.pixel.iwlan.flags.dummy_fake_flag = false
12-23 12:53:14.007 22427 22427 E AconfigFlags: Failed to read Aconfig values from /system_ext/etc/aconfig_flags.pb
12-23 12:53:14.007 22427 22427 E AconfigFlags: java.io.FileNotFoundException: /system_ext/etc/aconfig_flags.pb: open failed: ENOENT (No such file or directory)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at libcore.io.IoBridge.open(IoBridge.java:574)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at java.io.FileInputStream.<init>(FileInputStream.java:179)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at java.io.FileInputStream.<init>(FileInputStream.java:133)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at com.android.internal.pm.pkg.component.AconfigFlags.<init>(AconfigFlags.java:75)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at com.android.internal.pm.pkg.parsing.ParsingPackageUtils.<clinit>(ParsingPackageUtils.java:296)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at com.android.internal.pm.parsing.PackageParser2.<init>(PackageParser2.java:99)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at android.content.pm.PackageManager.getPackageArchiveInfo(PackageManager.java:8816)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at android.content.pm.PackageManager.getPackageArchiveInfo(PackageManager.java:8790)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at fr.g123k.deviceapps.DeviceAppsPlugin.getAppFromStorage(SourceFile:260)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at fr.g123k.deviceapps.DeviceAppsPlugin.onMethodCall(SourceFile:113)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(SourceFile:267)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(SourceFile:292)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0(SourceFile:319)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at io.flutter.embedding.engine.dart.DartMessenger.$r8$lambda$BqGJF3aBeRT05gDeKMoHH6eOjH0(SourceFile:0)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(SourceFile:0)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at android.os.Handler.handleCallback(Handler.java:991)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at android.os.Handler.dispatchMessage(Handler.java:102)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at android.os.Looper.loopOnce(Looper.java:232)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at android.os.Looper.loop(Looper.java:317)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at android.app.ActivityThread.main(ActivityThread.java:8787)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at java.lang.reflect.Method.invoke(Native Method)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:591)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:871)
12-23 12:53:14.007 22427 22427 E AconfigFlags: Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at libcore.io.Linux.open(Native Method)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at libcore.io.BlockGuardOs.open(BlockGuardOs.java:274)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:8673)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	at libcore.io.IoBridge.open(IoBridge.java:560)
12-23 12:53:14.007 22427 22427 E AconfigFlags: 	... 22 more
12-23 12:53:14.010 22427 22427 V AconfigFlags: Read Aconfig default flag value android.location.motionstate.release_motion_state_feature_flag = false
12-23 12:53:14.011 22427 22427 V AconfigFlags: Read Aconfig default flag value com.android.bluetooth.hal.flags.pixel_bluetooth_hr_mode = false

Second error:
12-23 12:55:49.919 30095 30095 W sh      : type=1400 audit(0.0:50772): avc:  denied  { read } for  name="/" dev="dm-12" ino=2 scontext=u:r:untrusted_app:s0:c204,c257,c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0 app=app.revanced.manager.flutter
12-23 12:55:49.943 30095 30095 W sh      : type=1400 audit(0.0:50773): avc:  denied  { read } for  name="/" dev="dm-12" ino=2 scontext=u:r:untrusted_app:s0:c204,c257,c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0 app=app.revanced.manager.flutter
12-23 12:55:50.896 22427 22427 E DartMessenger: Uncaught exception in binary message listener
12-23 12:55:50.896 22427 22427 E DartMessenger: java.io.FileNotFoundException: /data/user/0/app.revanced.manager.flutter/files/lastPatchedApp.apk: open failed: ENOENT (No such file or directory)
12-23 12:55:50.896 22427 22427 E DartMessenger: 	at libcore.io.IoBridge.open(IoBridge.java:574)
12-23 12:55:50.896 22427 22427 E DartMessenger: 	at java.io.FileInputStream.<init>(FileInputStream.java:179)
12-23 12:55:50.896 22427 22427 E DartMessenger: 	at app.revanced.manager.flutter.MainActivity.installApk(SourceFile:388)
12-23 12:55:50.896 22427 22427 E DartMessenger: 	at app.revanced.manager.flutter.MainActivity.configureFlutterEngine$lambda$19(SourceFile:191)
12-23 12:55:50.896 22427 22427 E DartMessenger: 	at app.revanced.manager.flutter.MainActivity.$r8$lambda$C3cUe_dHEdP1GsfFm3c8DvZ_hqc(SourceFile:0)
12-23 12:55:50.896 22427 22427 E DartMessenger: 	at app.revanced.manager.flutter.MainActivity$$ExternalSyntheticLambda5.onMethodCall(SourceFile:0)
12-23 12:55:50.896 22427 22427 E DartMessenger: 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(SourceFile:267)
12-23 12:55:50.896 22427 22427 E DartMessenger: 	at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(SourceFile:292)
12-23 12:55:50.896 22427 22427 E DartMessenger: 	at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0(SourceFile:319)
12-23 12:55:50.896 22427 22427 E DartMessenger: 	at io.flutter.embedding.engine.dart.DartMessenger.$r8$lambda$BqGJF3aBeRT05gDeKMoHH6eOjH0(SourceFile:0)
12-23 12:55:50.896 22427 22427 E DartMessenger: 	at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(SourceFile:0)
12-23 12:55:50.896 22427 22427 E DartMessenger: 	at android.os.Handler.handleCallback(Handler.java:991)
12-23 12:55:50.896 22427 22427 E DartMessenger: 	at android.os.Handler.dispatchMessage(Handler.java:102)
12-23 12:55:50.896 22427 22427 E DartMessenger: 	at android.os.Looper.loopOnce(Looper.java:232)
12-23 12:55:50.896 22427 22427 E DartMessenger: 	at android.os.Looper.loop(Looper.java:317)
12-23 12:55:50.896 22427 22427 E DartMessenger: 	at android.app.ActivityThread.main(ActivityThread.java:8787)
12-23 12:55:50.896 22427 22427 E DartMessenger: 	at java.lang.reflect.Method.invoke(Native Method)
12-23 12:55:50.896 22427 22427 E DartMessenger: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:591)
12-23 12:55:50.896 22427 22427 E DartMessenger: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:871)
12-23 12:55:50.896 22427 22427 E DartMessenger: Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
12-23 12:55:50.896 22427 22427 E DartMessenger: 	at libcore.io.Linux.open(Native Method)
12-23 12:55:50.896 22427 22427 E DartMessenger: 	at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
12-23 12:55:50.896 22427 22427 E DartMessenger: 	at libcore.io.BlockGuardOs.open(BlockGuardOs.java:274)
12-23 12:55:50.896 22427 22427 E DartMessenger: 	at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
12-23 12:55:50.896 22427 22427 E DartMessenger: 	at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:8673)
12-23 12:55:50.896 22427 22427 E DartMessenger: 	at libcore.io.IoBridge.open(IoBridge.java:560)
12-23 12:55:50.896 22427 22427 E DartMessenger: 	... 18 more
12-23 12:56:20.927 22427 22427 D VRI[MainActivity]: visibilityChanged oldVisibility=true newVisibility=false

Patch logs

Acknowledgements

  • I have checked all open and closed bug reports and this is not a duplicate.
  • I have chosen an appropriate title.
  • All requested information has been provided properly.
  • The bug is only related to ReVanced Manager.
@JimKnoxx JimKnoxx added the Bug report Something isn't working label Dec 23, 2024
@KobeW50
Copy link
Contributor

KobeW50 commented Dec 23, 2024

Is it #2224? Please provide the exact installation failure error

@pramodhrachuri
Copy link

#2224 has been marked as spam and the thread has been locked. But I don't think the issue has been resolved. This just happened to me

@shurane
Copy link

shurane commented Feb 6, 2025

Just wondering, what phone model and Android version are you guys running? @JimKnoxx and @pramodhrachuri .

Looking at #2224, it seems like an issue that people with Samsung phones are running into. Could help to isolate and reproduce the issue.

@pramodhrachuri
Copy link

pramodhrachuri commented Feb 6, 2025

I am using a Pixel 7 with Android 15. I got a few more data points in the meantime.

  1. I had to factory reset my phone due to some unrelated issues and reinstalled Revanced apps. Didn't face the problem. So, the phone mode or Android version is not the cause.
  2. I refaced this issue on my Galaxy Tab S10+. And the exact same behavior. Bugs out the 1st time and works the 2nd time.

I believe this happens only when we are trying to update the patched app. Let's say I already have Gmail-v1.2.3-revanced installed, and we try to patch+reinstall gmail-v1.2.3-revanced again, and this bug comes out.

This case is not unrealistic. There could be scenarios where patches for a specific app have been updated, but the base APK is the same.

Edit: do you know how to get this issue reopened?
should be even do it? Because I don't need a fix. I know I can just make it work by starting the compiling process again.

@JimKnoxx
Copy link
Author

JimKnoxx commented Feb 6, 2025

Also using a Pixel 7 with Android 15, not rooted.

I repatch YouTube whenever there is a new "ReVanced Patch Update", so that my YouTube has the newest features. So most times same APK, other patch version.

@pramodhrachuri
Copy link

I do the same haha. That's how I landed here.

It's a bit of a corner case but not unrealistic.

@shurane
Copy link

shurane commented Feb 6, 2025

@pramodhrachuri i wonder why it consistently bugs out the first time and works the second time on your Galaxy Tab. In #2224, it seems to be the opposite where the first time it succeeds, but the second time crashes.

So to be clear, it doesn't bug out at all on the Google Pixel 7? Even when trying to repatch the same APK with different patches?

The strange thing is that the flutter file picker selects the file, but seems to be passing a null pointer to the android activity that handles installing the file. Maybe similar to miguelpruivo/flutter_file_picker#397 or miguelpruivo/flutter_file_picker#1025

The behavior is flaky enough that it would be nice if it was fixed though.

@pramodhrachuri
Copy link

Image

I am able to replicate it in Pixel 7 too! Yay!

@shurane my apologies for the confusion. I meant 2nd time too. I used 'reinstall' instead of the number. Let me write it as a timeline instead.

  1. Long long time ago, I installed a patched app on both P7 and Tab. Everything went well.
  2. I wanted to update the patches. So, tried to reinstall (or install number 2) on P7. But failed. Then posted my 1st comment on this thread.
  3. Immediately repeated step 2 (3rd install) and it worked.
  4. A day later, observed the same step 2 and 3 on the Tab.
  5. Had to factory reset P7. 1st installed again on P7. Worked.
  6. Just a few minutes ago, I tried to reinstall (2nd install) the same app on P7 with exact same patches. No error.
  7. Repeated step 6 with different patch selection (3rd install). Failed. Attached the screenshot above.
  8. Repeated step 6 again. Worked.

@shurane
Copy link

shurane commented Feb 6, 2025

That's helpful, @pramodhrachuri

Actually just ran into this too on my phone, a Pixel 9 Pro with Android 16:

Image

So I guess I can see if I can get it to be more reproducible and get some logs out of it.

@shurane
Copy link

shurane commented Feb 8, 2025

Been thinking about this and reading through other bug reports on flutter_file_picker and reading through the Android source on similar packages like image_picker.

I think the reason for a sometimes null pointer error might be related to how Android handles intents/launching other activities. It's not guaranteed the current activity will stick around while the file/image/etc is being loaded from the file picker. So when the activity is paused or destroyed to save memory and then resumed later, it needs to restore its state somehow. flutter_file_picker may need a way to retrieve "lost data" in case the activity calling it gets destroyed. It seems like image_picker gives a way to do that here: https://pub.dev/packages/image_picker#handling-mainactivity-destruction.

Edit: I bet a way to simulate this is to have the Don't Keep Activities setting on in Developer Options.
I tried on my phone and it's not even able to return after selecting an APK to patch. Probably need to investigate more to see what's going on though.

@pramodhrachuri
Copy link

How about logging the reason for "Installation Cancelled"?

I'm not an Android dev. But to me it looks like "Installation Cancelled" message is a 'catch all errors' message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug report Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants