Illegal Instruction loading OpenSSL on 32-bit Android - android

Using Delphi 11 and Indy 10, I am getting an error loading the OpenSSL libraries under Android32 on a Lenovo TB-X304F tablet running Android 8.1.0:
Project XXX raised exception class Illegal instruction (4).
There are other similar posts on StackOverflow, but none that offers a solution.
I don't get this error under Android64 on the same device. Nor, do I get the error on an Android 11 device running Android32 or Android64. All the devices I'm testing can run Android64, so I'm not sure how important this error is. But, if I am required to submit both 32-bit and 64-bit versions of my app to the Play Store, it seems likely both versions should run.
I am using OpenSSL 1.0.2g (I get the same error using OpenSSL 1.0.0).
I use IdOpenSSLSetLibPath() to let Indy know where the libraries are located.
In the debugger, the error appears to occur when I attempt to step over the initial begin of the function LoadSSLCryptoLibrary() in unit IdSSLOpenSSLHeaders.
Is there a work-around? Or, if this error is related to the version of the library, is there a version of OpenSSL eligible for the Play Store and more likely to run on the Lenovo with Android 8.1?

Related

Why is attaching gdbserver to a native android app failing?

I am developing a fully native application in using C++ and pure CMake as the build system - no Android Studio involved at all (proof of concept here)
The code builds, apk is generated and can be installed and run via ADB without issue but I cannot get gdbserver64 to attach to the process for debugging.
More details:
App is built against SDK/NDK API level 30
Attempting to debug on an Android 11 emulator instance without Google Play
I can run adb root just fine
Image already includes gdbserver and gdbserver64, attempting to use those
Developer options and USB debugging enebled in emulator
App has android:debuggable="true" in manifest
But every time I try gdbserver64 :5039 --attach $(pidof my.app.id)
I get /bin/sh: <app_pid>: inaccessible or not found
What am I missing? And no, I cannot just move to Android Studio - this is a cross platform project that needs to be buildable using only CMake.
According to my observation, this may be a bug of prebuilt gdbserver. It treats the parameter after --attach as a program name and tries to start it.
It's not really an answer, but in similar configuration to yours I got same error message and unable to overcome this. For me, switching to lldb helped, see e.g.

Lime 5.2.1 / Android 4.3 : dlopen fails on stpcpy

I'm trying to build an empty HaxePunk project for Android to test the build chain, and while I'm never getting any error, all my attemps have crashed at run time with the same error message :
Error: dlopen failed: cannot locate symbol "stpcpy" referenced by libzlib.so...
I am running the executable on a pretty old phone with Android 4.3 on it ; a Sony Xperia M.
I have been doing a bit of research, and so far I mostly see the same things being repeated : update your NDK (I've been using the latest one from the android dev website and not the one lime setup android downloads), build for previous API versions (which I am also doing with <config:android target-sdk-version="18" /> in my project.xml file). So I don't know what I'm doing wrong, if anything.
Another thing I found is that I'm using the git version of HXCPP, and when I built the Android libs with neko build.n android in the project subdir, it was using -DHXCPP_ANDROID_PLATFORM=26 whereas the Lime build of my project is using -DHXCPP_ANDROID_PLATFORM=9, so that can't be good. However, I don't really know much about Android at all, but I have read that the SDK version and Android platform are two different things, or so I've read.
Any help with this will be much appreciated.
EDIT : Okay so something weird happened : up until now I was trying to install the APK manually by copying it to my phone's files and launching it from there, which kept crashing. I tried lime test android once without changing anything at all and it worked fine, and from then I could manually install the APK like I used to, and the error never happened again. I can't replicate it, but it's still an open case.

Exporting a build from Unity to Android fails

I'm new to coding and to Unity. I've followed the step-by-step found in this google page. I have installed all the SDKs and the latest versions of Unity and Android Studio for mac OS.
Everything goes according to plan and I get to the final "run and build". It connects fine to my Note 3 and runs almost to the end when I get the following errors:
Error message window
Assets/GoogleVR/Scripts/VRDevices/GvrDevice.cs(99,10): warning CS0618: `UnityEngine.GL.IssuePluginEvent(int)' is obsolete: `IssuePluginEvent(eventID) is deprecated. Use IssuePluginEvent(callback, eventID) instead.'
and
CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details. /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java
-Xmx2048M -Dcom.android.sdkmanager.toolsdir="/Users/Bruno.Vilela/Library/Android/sdk/tools"
-Dfile.encoding=UTF8 -jar "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar"
-
I have tried all that I am able to and have found no way around this. I am simply not versed enough in C# to debug this on my own. Any help will be greatly appreciated!!
SPECS:
Macbook Pro running OS X 10.10.5
Unity 5.3.4f1 Personal
Android Studio 2.1.1
Galaxy Note 3 running Android 5.0
Cheers!!
-BV
This might be caused due to having duplication jar files in your project. check if that is true, try removing any duplication and building the project again.
some similar reference : http://answers.unity3d.com/questions/765961/multiple-plugin-conflict.html

Is the Terminal IDE app for android compatible with Lollipop?

I just ordered a Nexus 9 and will be using it to program. Has anyone tried to run Terminal IDE on Nexus 9 or any other devices using Android 5.0 Lollipop?
The "links" browser included with Terminal IDE ran fine on my Nexus 5 under KitKat, but it crashes with the PIE error mentioned under Lollipop. Other than that, Terminal IDE has performed flawlessly for me, for about a year now. Sorry--forgot to add: Terminal IDE under Lollipop is "stopped" if started with the Android keyboard, or Android keyboard option is toggled. It will resume running if the Terminal IDE keyboard option is toggled.
7175 recompiled all the Terminal IDE binaries statically, so they don't give the PIE error on Android 5+. http://forum.xda-developers.com/showpost.php?p=57292384&postcount=68 (dec 2014)
7175 recommends downloading the apk from the following dropbox, then unzipping (an apk is a zip) and copying across just the binaries you need (instead of sideloading the whole apk).
https://www.dropbox.com/s/h2d23ecbrt2akeu/terminalide-2.02-binary-mod-signed.apk?dl=0
I downloaded this, and its vim worked on my old 4.2.2 Android phone - but I haven't actually tried it on an Android 5+ phone! (I don't have one; I'm researching my upgrade path).
At lease one stackoverflow user uses it: Rejecting re-init on previously failed class error when loading a Class with dalvikvm
A question within an answer: Anyone know how to confirm these binaries are safe? Especially ssh - downloading a "secure" shell binary from an anonymous user defeats the purpose!
The background of the post seems 100% legit, and has 467 "thanks" (wait, that's for all 7175's posts; this particular one only got 2 "thanks"...) - presumably people who downloaded it, and found no problem. But the site seems dodgey (http://forum.xda-developers.com), with lots of ads and security warnings. Maybe they are recent, after these older posts, and xda used to be good?
Terminal IDE appeals to people who don't want to root their phones - who probably don't want to sideload apps, or download anonymous binaries off the internet. I think the Play store does some rudimentary verification, and the more people who use it, the more likely problems are found. So it would be reassuring if spartacusrex could release this on the Play store as an upgrade - or, 7175 release a new fork.... or someone else release one. Forking is one of the strengths of open source!
BTW: I feel really bad doubting 7175's kind and great work, but sadly, security is a real issue. :(
No, but termux seems like a good Terminal IDE replacement for Lollipop - and under active development. Has vim, ssh, git, gcc etc and a version of apt-get.
[It only works in Android 5+, so I haven't tried it yet myself.]
Edit: It looks like it's not working on all new devices, maybe a target SDK version incompatibility? Terminal IDE should work at least on some other devices since it uses statically compiled binaries to run different parts of it. Statically compiled binaries are PIE(position independent executable) safe which is a requirement in lollipop. I've been running it on a lollipop build with my Galaxy Nexus no problem.
EDIT2: Also there are a few binaries that are dynamically linked and are not PIE, so those won't work.
You have lot of options now:
* Termux
* GnuRoot apps
* UserLAnd
* KBox
Of course, it should be possible to build a great filesystem yourself with fakechroot, fakeroot or proot. Or a non-root package manager.
I remember seeing a project named like 'Gentoo prefix for Android non-root' on Sourceforge. I don't know if it is still at alpha stage...

An internal error occurred during: "Launching MyFirstApp". com/android/ide/eclipse/adt/internal/launchController

I just purchased a new laptop (Windows 8.1) and I'm testing it to see how it will perform with Android Development...so I downloaded and installed the Android SDK (ADT Bundle for Windows) from android.developers.com.
As a quick test I entered the sample app "MyFirstApp" on the android.developers site, created a AVD (Nexus_4) from the template of devices provided in AVD...and then attempted to run the app. Unfortunately this is where I get a "Problem Occured" popup with the following message:
"An internal error occurred during: "Launching MyFirstApp". com/android/ide/eclipse/adt/internal/launchController"
I checked other questions/responses posted...none of the others found seemed to apply to my situation.
BTW, after it didn't run with the Nexus_4 AVD..I tried it with another AVD template (Nexus Samsung) and got the same failure.
Adding more information:
I installed the 64-bit version of SDK...again running Windows 8.1.
Also here is the exception stack trace associated with Internal error message noted above.
java.lang.NoClassDefFoundError: com/android/ide/eclipse/adt/internal/launch/AndroidLaunchController
at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(LaunchConfigDelegate.java:114)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:855)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:704)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1047)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1251)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Regards,
Jet
I was hoping that I had made some silly mistake and someone would quickly recognize it and recommend an easy fix to my problem. Unfortunately I didn't get a response so I just tried repeating a number of my prior steps..1) Re-creating AVDs; 2) Reinstalling the entire SDK; 3) Installing Windows 8.1 updates;
Ultimately it is working now..but I'm not sure what the problem was or what the fix was but it is working now.
BTW, as noted above in my question I'm using the 64 bit version of SDK (and I'm using 64bit version of JDK).
Cheers,
Jet

Categories

Resources