Sl4A crashes on every script - android

There was time, when SL4A worked fine on my ICS phone (rooted, ofk). Than a factory reset happend; after it everything works just fine, except problem with SL4A.
I install SL4A; it can run shell scripts.
Than I install Python for Android or Perl for Android. I can run Python or Perl scripts. Nice.
Then I reboot. After reboot any attempt to do anything with SL4A (run script or start private server(any port)) results in
Unfortunately, SL4A has stopped.
Then it crashes second time, even if I have not launched it again manually.
Forever. (Till another clean install).
It occurs with all versions of SL4A and Python apk.
Here is full log(careful: 5k+ lines of text), and here is piece of log, filtered to warnings.
You can see, that first error, that looks relevant, in all cases is
E/sl4a.SimpleServer:156(2564): Failed to start server.
I have no idea what happens.
This is not quite programming question, so would have asked it at android.stackexchange, but it looks that they don't even have special tag for sl4a, so I posted it here.
Thanks in advance.

Go to apps in settings and Force Stop + clear the data. This usually fixes it for me. Seems to be a bug somewhere.

I did have problems with my andriod version.
Installing both SL4A and python from here fixed this.
More details on the original post, over here:
https://groups.google.com/forum/#!topic/android-scripting/tOovx2HprQk

Related

Errors when using buildozer to compile kivy/python 3.7 app into android apk on OSX - Silex & pypandoc

I've made an app using kivy and python 3.7, on OSX. It runs quite well within the PyCharm environment. However, buildozer keeps throwing up errors when I try to compile the app with buildozer.
I have installed the latest buildozer using the pip3.7 command. I have even updated python-for-android to test it out. I am also currently using the Android NDK r19c, although I have tried it with r17c and r20. Neither have worked.
Originally, I had errors relating to the use of pip, instead of pip3.7, since buildozer would try to use python 2.7 in some areas. This was solved by uninstalling buildozer etc. and reinstalling with pip3.7. Those errors have gone but at the moment, I seem to be getting new errors, related to 'Silex' and pypandoc, which is strange since I don't believe buildozer even uses those.
The error codes have too many characters to allow me to post them directly here, so please see the error codes as a page on my website. The links are below:
https://apilotslens.com/buildozer-silex-error
I then install the most recent version of Silex, which stops this error coming. However, a new error comes, relating to pypandoc:
https://apilotslens.com/buildozer-pypandoc-error
Even when I install pypandoc, the error keeps appearing.
I am very confused at this point. I have supposedly done everything by the book, so that buildozer will compile my APK. I really hope someone can help me. As far as I am aware, Buildozer doesn't even use Silex or pypandoc, so why would they be appearing? They haven't even been mentioned before. I really want to get this sorted soon.
Thanks in advance!
I'm pretty sure I haven't touched the file manually at all. The only thing I have tried is a clean: buildozer android clean but that hasn't got it working.
This only cleans the build, not the full cache. Delete /Users/JGolding/Desktop/FlightPlanningApp/PythonCode/Drafts/Draft1/.buildozer and try again.
Wait, do you mean shlex or silex?
It should read import shlex. Your file reads import silex.
Here's the link to the toolchain.py file you mentioned:
This looks good except for the shlex->silex change.
I thought I'd try uninstalling and reinstalling buildozer (pip3.7 uninstall buildozer) but interestingly, it says Can't uninstall 'buildozer'. No files were found to uninstall.
This is something unrelated arising from your pip invocation targeting the wrong directory or something.
I then install the most recent version of Silex, which stops this error coming. However, a new error comes, relating to pypandoc:
This is also unrelated, it's just that the silex module doesn't support python 3. The silex module was always a red herring, it's just the letter switch in your copy of toolchain.py that is wrong.
Note that if you read the error, it isn't complaining about pypandoc but about SyntaxError: Missing parentheses in call to 'print'..

Bash on Ubuntu on Windows, Compile AOSP

I am attempting to compile AOSP code using the new WSL (Windows Subsystem for Linux) aka Bash on Ubuntu on Windows. I have successfully setup my build environment and sync'd AOSP code.
I am unable to get "make" to complete a build for even just a single app.
Attached is a strace file. Make seems to hang when reading the file "build/core/clang/TARGET_arm.mk" (this file is initialized on line 1443 of the trace), although this file is successfully read several times prior to the hang.
Any ideas about what is causing make to hang? How can I dig deeper to find out what is causing the hang?
Ehm, yeah, that was the only thing I've wanted to do with the bash since 30th of March when it was announced. I tried it out by myself and I also read an article at xda-developers four months ago that it currently isn't possible to successfully compile Android using this subsystem due to some missing dependencies. There's currently no solution to do that. We have to hope for an update which gives us this awesome possibility. Even if it'll work some day you will have to expect twice the build time you have on a normal Ubuntu setup. Anyway, the bash development is progressing so I'm full of hope it'll work in some months...

Rebooting android using monkeyrunner

I have this application which I'm testing. I use a script which automatically installs the app but I also want to restart the device. This is important as after the installation I run a monkey-test on the device and all kind of quirks and bugs may arise. To get rid of these I want to restart the phone to get it into some kind of "known state". (These bugs are not only in the app as the phone has been known to suddenly shutdown during the tests)
My installation script is run with jython and I know of the device.reboot() command but this takes almost no time at all (which makes me suspicious) and doesn't work very well. I know there's three arguments: "bootloader", "recovery" and "None" but I can't find the impact these would have on the device.
So my question is, is device.reboot() the right command to use? If yes, what happens when I don't use any arguments with the device.reboot() command and what is the effects of the arguments.
It may be worth mentioning that I run the jython script from a batch command prompt in jenkins. So any batch commands using adb or similar would work just as fine.
device.reboot("None") works on my device

Android, ant, and Eclipse: it never reinstalls the APK on the emulator after rebuilding. How can I fix this?

I have been developing on Android with Eclipse for a while, and I recently switched over to using Ant for my build system. This gives me a number of useful advantages, but it seems to really badly break Eclipse's behavior with respect to building and the emulator.
My biggest problem right now is that, if I change something in my code and hit the "Run" or "Debug" buttons, it rebuilds the app like it's supposed to, but when it comes time to install the app and run it, I get the dreaded "Application already deployed. No need to reinstall." message, and it refuses to install it. Even if I do a "clean" and rebuild my app from scratch, it still doesn't recognize it as newer than the one installed on the emulator.
Of course, I can uninstall the app from my emulator first, but that's a huge PITA, because my app involves setting up a user account after initial install, and I don't want to have to do that every time I am testing a change. I can also force install from the command line through "adb -e install -r ...". That's what I'm doing now, but it's an extra step that shouldn't be necessary. I would really like to be able to take advantage of the "I" part of my IDE and actually compile, run, and install from it the way I am supposed to be able to.
How does the Android SDK in Eclipse decide whether the app needs to be reinstalled? Is there a timestamp on some particular file that it looks at? Is there a way I can force it to install every time?
There has to be a solution to this problem.
This works fine in my eclipse, and it always had. So I would suggest:
reinstall ADT plugin
reinstall eclipse altogether.
Or you can workaround this issue by adding extra step to your project with "adb -e install -r ..." command line (using ant build script).

Install an apk without starting the emulator

When developing on BlackBerry or iOS, you can deploy your application just by dropping the compiled code into a special directory, and when the simulator boots up it will check that directory and install any apps that it finds there. Is this possible for Android?
The reason this feature is desirable is because my build system deploys builds nightly. I want the emulator ready to go when my QA team gets in the next morning. To do that, I have to write a script that boots up the emulator, waits for it to start up, then calls adb install and finally shuts down the emulator. It would be great if I could just drop the .apk in a directory and have it ready to go the next time QA boots up the emulator.
Edit:
Someone asked for the script I described above. It's unfortunately written in Perl, but here it is: http://pastebin.com/6UcNgYRs
Edit 2:
I just found an awesome little command that can help you if you're trying to write a script like the one I mentioned above. You can have your script wait for the emulator to come online with the command $ adb wait-for-device!!
Is this possible for Android?
No, sorry. Nice idea, though.
You can just tell the QA people to use the install script as the emulator itself, just remove the "close the emulator" bit.

Categories

Resources