chdir / aria2-android

This repository is obsolete. Much better frontends for aria2 have been written and can be found in F-Droid
GNU General Public License v3.0
66 stars 15 forks source link

Can't start on shield TV #8

Closed shadimostafa closed 4 years ago

shadimostafa commented 6 years ago

The server stops as soon as I start it.. How can I check for errors? The toast doesn't show any errors. I also have terminal emulator installed but I don't know how to start aria2 from there. I'm willing to provide all the help necessary.

Shield TV SW Version 6.1(24.32.406.402) Build NRD90M. 2427173_992.1219

Alexander-- commented 6 years ago

I don't own Shield TV. Several people reported that aria2 works fine on other Android TV models, but for some reason Shield TV is problematic.

Please make sure, that "aria2" -> "Notify when stopped" is checked. This will enable status bar notification upon aria2 termination. When aria2 stops, look at that notification: Is there something useful there under "aria2 failed to start"?

"The toast does not show any errors" — have you enabled "aria2" -> "Show aria2 output" checkbox? Does the toast contain anything at all?

Terminal Emulator integration can be enabled from "Frontend" section after installing Android Terminal Emulator from Google Play. But it might not be able to help if the "Show aria2 output" toast contains nothing at all. When the integration is enabled, a new tab of Android Terminal Emulator is created to show aria2 output. It is mutually exclusive with "Show aria2 output" (since terminal emulator consumes all output itself).

Try to look at LogCat. There are multiple online tutorials how to use LogCat on Android. This can be done by connecting to your TV via USB/Wi-Fi or by installing a specialized app (works only on rooted devices). If you don't want to root, enabling debugging and using USB/Wi-Fi to view LogCat is the easiest way.

If you have a couple of spare minutes to help me with debugging the issue, you are welcome in chat: https://gitter.im/aria2-android/Lobby.

shadimostafa commented 6 years ago

I have "Show aria2 output" enabled already and the taost only contains the following messages:

[NOTICE] IPv4 RPC: listening on TCP port 6800 ... [NOTICE] Serialized session to '/storage/emulated/0/Android/data/net.sf.aria2/files/.aria2.session.gz' successfully.

Then terminates.. when I check the location in the notice I see the .aria2.session.gz 0 byte file created there.

I've installed terminal emulator from the button in the app and enabled the integration checkbox.. but the "Notices" stop showing in the toast after that and I don't see any terminal windows showing! I tried opening the terminal window from the button inside the app and it shows "foster $" in the terminal without displaying logs or anything even when I try to start the service once again after the terminal app opens.

My device isn't rooted and I might not be ready to root it yet as I'd like to receive the updates smoothly for the time being. I can adb to the device if that would help with debuging.

Btw I've sideloaded another aria2 app from playstore "com.gianlu.aria2android" and it worked fine on my Shield TV.. Actually after starting the "gianlu" service your app shows an error that it can't start the service on TCP port 6800 which seems normal.

Please tell me how can I provide more help to debug the problem using adb. I just might take sometime to reply as I might get a little busy sometimes :)

On Sat, Nov 4, 2017 at 1:55 PM, Alexander-- notifications@github.com wrote:

I don't own Shield TV. Several people reported that aria2 works fine on other Android TV models, but for some reason Shield TV is problematic.

Please make sure, that "aria2" -> "Notify when stopped" is checked. This will enable status bar notification upon aria2 termination. When aria2 stops, look at that notification: Is there something useful there under "aria2 failed to start"?

"The toast does not show any errors" — have you enabled "aria2" -> "Show aria2 output" checkbox? Does the toast contain anything at all?

Terminal Emulator integration can be enabled from "Frontend" section after installing Android Terminal Emulator from Google Play. But it might not be able to help if the "Show aria2 output" toast contains nothing at all. When the integration is enabled, a new tab of Android Terminal Emulator is created to show aria2 output. It is mutually exclusive with "Show aria2 output" (since terminal emulator consumes all output itself).

Try to look at LogCat. There are multiple online tutorials how to use LogCat on Android. This can be done by connecting to your TV via USB/Wi-Fi or by installing a specialized app (works only on rooted devices). If you don't want to root, enabling debugging and using USB/Wi-Fi to view LogCat is the easiest way.

If you have a couple of spare minutes to help me with debugging the issue, you are welcome in chat: https://gitter.im/aria2-android/Lobby.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/chdir/aria2-android/issues/8#issuecomment-341887955, or mute the thread https://github.com/notifications/unsubscribe-auth/ABbCcnq3ADBo8wPQhqyGkOdzawvwLj0Hks5szEKFgaJpZM4QRUaN .

Alexander-- commented 6 years ago

@shadimostafa

Yup, we all have our respective lives, which seems to negatively impact bugreport handling in small projects like this one.

I've installed terminal emulator from the button in the app and enabled the integration checkbox.. but the "Notices" stop showing in the toast after that and I don't see any terminal windows showing!

As I said, terminal integration is mutually exclusive with toast popup logging. It does not automatically open any terminal windows, — instead you are supposed to open the terminal emulator and switch to correct tab, which should be called "aria2". Alternatively, click on Terminal Emulator notification, which should open once aria2 starts with integration enabled.

I can adb to the device if that would help with debuging.

That's great! All you need is to adb shell on device and run

logcat

there. Or just run

adb logcat

from desktop (instead of the usual way you are using adb). This will show all LogCat logs at once. Some of the lines might give a clue towards solving this bug.

Btw I've sideloaded another aria2 app from playstore "com.gianlu.aria2android" and it worked fine on my Shield TV.

I will look into that. Can't promise anything, since the app's source code is nowhere to be found, but I will try.

shangke1988 commented 6 years ago

I meet the same problem in my moble phone Honor 8 with Android 7.0. I test the same apk in my old phone, it is work well. In Android 7 I haven't permission to access outside of /sdcard.

pac20 commented 6 years ago

shangke1988 Move the aria2-android to the memory card

HatCloud commented 6 years ago

I meet the same problem, and I get the logcat: 12-12 01:15:19.841 5559 12564 I aria2service: [/data/app/net.sf.aria2-1/lib/arm/libaria2_PIC_exec.so, -c, --enable-rpc, --referer=*, --bt-save-metadata=true, --rpc-allow-origin-all=true, --rpc-save-upload-metadata=true, --save-session-interval=10, -d, /storage/emulated/0/Download, --save-session, /storage/emulated/0/Download/.aria2.session.gz, --conf-path, /storage/emulated/0/Download/aria2.txt, --rpc-secret, abcdefg, --show-console-readout=true, --enable-color=false, --rpc-listen-all=true, --stop-with-process=5559] 12-12 01:15:20.668 1994 2148 D RootManager: Sending command(s): adb -s emulator-5554 shell id 12-12 01:15:20.659 2142 2142 W sh : type=1400 audit(0.0:3110): avc: denied { read } for name="/" dev="rootfs" ino=1 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0 12-12 01:15:20.669 1994 2148 D RootManager: Sending command(s): adb -s 127.0.0.1:5555 shell id 12-12 01:15:20.659 2142 2142 W sh : type=1400 audit(0.0:3111): avc: denied { read } for name="/" dev="rootfs" ino=1 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0 12-12 01:15:20.671 1994 2148 D RootManager: Sending command(s): adb connect 192.168.199.113 12-12 01:15:20.669 2142 2142 W sh : type=1400 audit(0.0:3112): avc: denied { read } for name="/" dev="rootfs" ino=1 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0 12-12 01:15:20.671 1994 2148 D RootManager: Sending command(s): adb -s 192.168.199.113:5555 shell id 12-12 01:15:20.672 1994 2149 D ShafaADB: connect no 12-12 01:15:20.669 2142 2142 W sh : type=1400 audit(0.0:3113): avc: denied { read } for name="/" dev="rootfs" ino=1 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0 12-12 01:15:20.672 1994 2148 D RootManager: Sending command(s): setprop persist.service.adb.enable 1 12-12 01:15:20.686 1994 2148 D ADBHelper: onUpdate setprop: failed to set property 'persist.service.adb.enable' to '1' 12-12 01:15:20.679 12892 12892 W setprop : type=1400 audit(0.0:3114): avc: denied { write } for name="property_service" dev="tmpfs" ino=2218 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0 12-12 01:15:20.691 1994 2148 D ADBHelper: onFinished 2156 12-12 01:15:20.691 1994 2148 D RootManager: Sending command(s): setprop service.adb.tcp.port 5555 12-12 01:15:20.705 1994 2148 D ADBHelper: onUpdate2 setprop: failed to set property 'service.adb.tcp.port' to '5555' 12-12 01:15:20.706 1994 2148 D ADBHelper: onFinished 2157 12-12 01:15:20.707 1994 2148 D RootManager: Sending command(s): start adbd 12-12 01:15:20.721 1994 2148 D ADBHelper: onUpdate3 start: must be root 12-12 01:15:20.722 1994 2148 D ADBHelper: onFinished 2158 12-12 01:15:20.722 1994 2148 D RootManager: Sending command(s): adb connect 127.0.0.1 12-12 01:15:20.834 8888 12404 W System.err: android.content.pm.PackageManager$NameNotFoundException: Download 12-12 01:15:20.834 8888 12404 W System.err: at android.app.ApplicationPackageManager.getPackageInfoAsUser(ApplicationPackageManager.java:147) 12-12 01:15:20.835 8888 12404 W System.err: at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:132) 12-12 01:15:20.835 8888 12404 W System.err: at com.estrongs.android.pop.app.c.ai.c(Unknown Source) 12-12 01:15:20.835 8888 12404 W System.err: at com.estrongs.android.pop.app.c.ai.a(Unknown Source) 12-12 01:15:20.835 8888 12404 W System.err: at com.estrongs.android.pop.app.scene.e.q.a(Unknown Source) 12-12 01:15:20.835 8888 12404 W System.err: at com.estrongs.android.scanner.c.m.run(Unknown Source) 12-12 01:15:20.836 8888 12404 W System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 12-12 01:15:20.836 8888 12404 W System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 12-12 01:15:20.836 8888 12404 W System.err: at java.lang.Thread.run(Thread.java:761) 12-12 01:15:20.837 8888 12404 W System.err: android.content.pm.PackageManager$NameNotFoundException: Download 12-12 01:15:20.837 8888 12404 W System.err: at android.app.ApplicationPackageManager.getPackageInfoAsUser(ApplicationPackageManager.java:147) 12-12 01:15:20.838 8888 12404 W System.err: at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:132) 12-12 01:15:20.838 8888 12404 W System.err: at com.estrongs.android.pop.app.c.ai.c(Unknown Source) 12-12 01:15:20.838 8888 12404 W System.err: at com.estrongs.android.pop.app.c.ai.a(Unknown Source) 12-12 01:15:20.838 8888 12404 W System.err: at com.estrongs.android.pop.app.scene.e.q.a(Unknown Source) 12-12 01:15:20.838 8888 12404 W System.err: at com.estrongs.android.scanner.c.m.run(Unknown Source) 12-12 01:15:20.839 8888 12404 W System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 12-12 01:15:20.839 8888 12404 W System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 12-12 01:15:20.839 8888 12404 W System.err: at java.lang.Thread.run(Thread.java:761) 12-12 01:15:20.840 8888 12404 W System.err: android.content.pm.PackageManager$NameNotFoundException: Download 12-12 01:15:20.840 8888 12404 W System.err: at android.app.ApplicationPackageManager.getPackageInfoAsUser(ApplicationPackageManager.java:147) 12-12 01:15:20.840 8888 12404 W System.err: at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:132) 12-12 01:15:20.841 8888 12404 W System.err: at com.estrongs.android.pop.app.c.ai.c(Unknown Source) 12-12 01:15:20.841 8888 12404 W System.err: at com.estrongs.android.pop.app.c.ai.a(Unknown Source) 12-12 01:15:20.841 8888 12404 W System.err: at com.estrongs.android.pop.app.scene.e.q.a(Unknown Source) 12-12 01:15:20.841 8888 12404 W System.err: at com.estrongs.android.scanner.c.m.run(Unknown Source) 12-12 01:15:20.842 8888 12404 W System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 12-12 01:15:20.842 8888 12404 W System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 12-12 01:15:20.842 8888 12404 W System.err: at java.lang.Thread.run(Thread.java:761) 12-12 01:15:21.383 2430 2706 I chromium: [2430:2706:INFO:mdns_app_filter.cc(2140)] MdnsAppFilter: responses sent in 94 seconds: 1 12-12 01:15:21.876 8888 12404 W System.err: android.content.pm.PackageManager$NameNotFoundException: Download 12-12 01:15:21.877 8888 12404 W System.err: at android.app.ApplicationPackageManager.getPackageInfoAsUser(ApplicationPackageManager.java:147) 12-12 01:15:21.877 8888 12404 W System.err: at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:132) 12-12 01:15:21.877 8888 12404 W System.err: at com.estrongs.android.pop.app.c.ai.c(Unknown Source) 12-12 01:15:21.877 8888 12404 W System.err: at com.estrongs.android.pop.app.c.ai.a(Unknown Source) 12-12 01:15:21.877 8888 12404 W System.err: at com.estrongs.android.pop.app.scene.e.q.a(Unknown Source) 12-12 01:15:21.878 8888 12404 W System.err: at com.estrongs.android.scanner.c.m.run(Unknown Source) 12-12 01:15:21.878 8888 12404 W System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 12-12 01:15:21.878 8888 12404 W System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 12-12 01:15:21.878 8888 12404 W System.err: at java.lang.Thread.run(Thread.java:761) 12-12 01:15:22.001 2430 2723 I chromium: [2430:2723:INFO:metrics_recorder.cc(196)] Cast v2 action(socket_id=6c48746d-1b65-31e7-7986-07e5a20ea301.7): CastV2.Connection.Connect.In 12-12 01:15:23.912 8888 12404 W System.err: android.content.pm.PackageManager$NameNotFoundException: Download 12-12 01:15:23.912 8888 12404 W System.err: at android.app.ApplicationPackageManager.getPackageInfoAsUser(ApplicationPackageManager.java:147) 12-12 01:15:23.913 8888 12404 W System.err: at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:132) 12-12 01:15:23.913 8888 12404 W System.err: at com.estrongs.android.pop.app.c.ai.c(Unknown Source) 12-12 01:15:23.913 8888 12404 W System.err: at com.estrongs.android.pop.app.c.ai.a(Unknown Source) 12-12 01:15:23.913 8888 12404 W System.err: at com.estrongs.android.pop.app.scene.e.q.a(Unknown Source) 12-12 01:15:23.914 8888 12404 W System.err: at com.estrongs.android.scanner.c.m.run(Unknown Source) 12-12 01:15:23.914 8888 12404 W System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 12-12 01:15:23.914 8888 12404 W System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 12-12 01:15:23.915 8888 12404 W System.err: at java.lang.Thread.run(Thread.java:761)

HatCloud commented 6 years ago

I'm a Android developer, I download source code and wanna debug it, but when I build project, there is a error: Error:Project :mobile declares a dependency from configuration 'compile' to configuration 'default' which is not declared in the descriptor for project :libtermexec.

If I wanna build it and contribute my code, what should I do additionally?

HatCloud commented 6 years ago

libtermexec module only include a file named "libtermexec.iml"

Alexander-- commented 6 years ago

@HatCloud have you properly cloned the repository? This project uses Git submodules, so you need to clone with --recursive flag (or enable submodules in whatever Git GUI you use). The appropriate command line commands are mentioned in README.

Alexander-- commented 6 years ago

@HatCloud Btw, it appears, that you have a rooted device (please correct me if I am wrong). Are you able to launch aria2c executable with command line printed to adb? E.g. if you enter the following into the root terminal:

/data/app/net.sf.aria2-1/lib/arm/libaria2_PIC_exec.so -c --enable-rpc --referer=* --bt-save-metadata=true --rpc-allow-origin-all=true --rpc-save-upload-metadata=true --save-session-interval=10 -d /storage/emulated/0/Download --save-session /storage/emulated/0/Download/.aria2.session.gz --conf-path /storage/emulated/0/Download/aria2.txt --rpc-secret abcdefg --show-console-readout=true --enable-color=false --rpc-listen-all=true

does it output anything helpful?

HatCloud commented 6 years ago

@Alexander-- No,my device is a unrooted shield TV. So I couldn't launch aria2c. And I build project success, I will debug it weekend.

Grepsy commented 6 years ago

Just a +1 here with the same issue on Shield TV. Any progress since last message? I'd be happy to help debug this, but don't want to root my brand new Shield just yet ;-)

Grepsy commented 6 years ago

I managed to run the command @Alexander-- posted to see the output in the terminal. (I found no way to use the terminal integration in the frontend section, the term. starts but no tab is created). What's funny is it actually starts without any issue and runs the server.

Sorry to attach a file like this, but don't know any other way to get this text out of the Shield. img_4521

For some reason the thumb is upside down, click it to get the normal one :/

Unfortunately even when it runs Transdroid still fails to connect with an 'Internal error building request' message. The build-in frontend website does work.

Alexander-- commented 6 years ago

@Grepsy Thanks a lot. Now I know, that the binary is all right. Blindly recompiling the native code would have been massive pain.

I will make a build with super-verbose logging and post it shortly to aid further investigation.

bestlibre commented 6 years ago

I have the same problem with my LG G5 (Android 7.0). The command given above start fine, but if started from the GUI it stop immediatly. I have added the following option in aria2.txt

console-log-level=debug
log=/storage/3934-6530/Android/data/net.sf.aria2/files/Aria2Download/debug.log

and the resulting log is :

2018-03-28 10:31:41.235251 [INFO] [Context.cc:178] <<--- --- --- ---
2018-03-28 10:31:41.240521 [INFO] [Context.cc:179]   --- --- --- ---
2018-03-28 10:31:41.240558 [INFO] [Context.cc:180]   --- --- --- --->>
2018-03-28 10:31:41.240579 [INFO] [Context.cc:181] aria2 1.26.1
2018-03-28 10:31:41.240632 [INFO] [Context.cc:182] gcc 4.9.x 20150123 (prerelease)
  built by   x86_64-pc-linux-gnu
  targetting arm-unknown-linux-androideabi
  on         May  3 2017 19:35:00
2018-03-28 10:31:41.240658 [INFO] [Context.cc:183] Linux 3.18.31-perf-g7204140 #1 SMP PREEMPT Tue Nov 14 20:10:33 IST 2017 armv8l
2018-03-28 10:31:41.240681 [INFO] [Context.cc:184] zlib/1.2.3 OpenSSL/1.0.2k c-ares/1.10.1-DEV
2018-03-28 10:31:41.240697 [INFO] [Context.cc:185] Logging started.
2018-03-28 10:31:41.240724 [DEBUG] [Context.cc:215] Not setting rlimit NO_FILE: 1024 >= 1024
2018-03-28 10:31:41.240751 [INFO] [SocketCore.cc:1712] getifaddrs is not available. Assume IPv4 and IPv6 addresses are configured.
2018-03-28 10:31:41.243357 [INFO] [HttpListenCommand.cc:106] CUID#9 - Using port 6800 for accepting new connections
2018-03-28 10:31:41.243481 [NOTICE] [HttpListenCommand.cc:108] IPv4 RPC: listening on TCP port 6800
2018-03-28 10:31:41.243722 [INFO] [HttpListenCommand.cc:106] CUID#10 - Using port 6800 for accepting new connections
2018-03-28 10:31:41.243795 [NOTICE] [HttpListenCommand.cc:108] IPv6 RPC: listening on TCP port 6800
2018-03-28 10:31:41.248706 [INFO] [LibsslTLSContext.cc:276] System trusted CA certificates were successfully added.
2018-03-28 10:31:42.250031 [DEBUG] [WatchProcessCommand.cc:86] Checking proess 12612
2018-03-28 10:31:42.250225 [INFO] [WatchProcessCommand.cc:117] CUID#8 - Process 12612 is not running. Commencing shutdown.
2018-03-28 10:31:43.266382 [NOTICE] [MultiUrlRequestInfo.cc:342] Serialized session to '/storage/3934-6530/Android/data/net.sf.aria2/files/Aria2Download/.aria2.session.gz' successfully.

Hope it helps.

Alexander-- commented 6 years ago

@bestlibre

Thanks, looks like that have completely cleared this issue for me! The aria2 executable is launched with --stop-with-process argument as precaution. This is not strictly necessary (there is a much better precaution in place), but either way the PID check appears to be wrong — it terminates the aria2 binary when both graphical app and the service process are still running. I wonder, what caused such odd behavior. Either way, removing the argument should resolve the issue. I will post the update to beta channel ASAP.

Grepsy commented 6 years ago

Any updates on this?

Alexander-- commented 6 years ago

@Grepsy It looks like my "as soon as possible", really meant "sometime in few next years".

I don't personally use aria2 (or any other apps) on my Android phone anymore, so there is very little motivation to dig into it. I am currently looking for new maintainer for this project.

This does not mean, that this project is completely abandoned, but without outside help it's development is unlikely to progress much.

Grepsy commented 6 years ago

Alright, I understand, thanks for your reply.