SAP / PyRFC

Asynchronous, non-blocking SAP NW RFC SDK bindings for Python
http://sap.github.io/PyRFC
Apache License 2.0
512 stars 141 forks source link

Targeting Android - Issue with compilation #326

Open EuroV8 opened 1 year ago

EuroV8 commented 1 year ago

Hello, I am trying to compile a mobile app targeting Android with buildozer (the app is built using the Kivy framework), and I'm using (obviously) pyrfc inside.

And I'm getting this error: ld: error: /usr/local/sap/nwrfcsdk/lib/libsapnwrfc.so is incompatible with aarch64linux ld: error: /usr/local/sap/nwrfcsdk/lib/libsapucum.so is incompatible with aarch64linux clang-14: error: linker command failed with exit code 1 (use -v to see invocation) error: command '/home/[username]/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++' failed with exit code 1 error: subprocess-exited-with-error

Maybe my question is dumb, or rhetorical, but could this be remedied by installing an SDK for the target platform (if it even exists for arm64?), or is it simply not possible to target android using pyrfc&nwrfcsdk?

I'm sorry if this is something quite obvious, but I am quite confused as to what I should/what I can do now, Thanks.

bsrdjan commented 1 year ago

SAP NWRFC SDK and PyRFC are not supported on Android platform, see the list of supported platforms: https://github.com/SAP/PyRFC#supported-platforms

Can you share some more info why would you need RFC connectivity from mobile Android device, direct to ABAP system? Mobile devices usually talk to some middleware, on-premise or cloud and the middleware is connected to ABAP backend. Would Android device in your scenario connect direct to ABAP backend and why?

EuroV8 commented 1 year ago

Thanks for your response. I'm evaluating the feasibility of creating an easily portable app that would be usable, among others, on Android devices, for things such as goods receipts and QI inspections, as a native Android app. I am aware that apps usually pass through webservices to achieve the same goals, I was trying to evaluate if such functionnalities are also achievable with Python. The app would then call appropriate BAPIs to perform the aforementionned tasks.

mpf82 commented 1 year ago

AFAIK, you may not distribute the SDK, see this docker container related discussion https://github.com/SAP/PyRFC/issues/194#issuecomment-691325370 ( Someone correct me if I'm wrong. )

So your users would have to somehow install the SDK themselves, ontop of your portable app, making it "less portable" (or at least less convenient).

bsrdjan commented 1 year ago

The scenario looks similar to SAP ITSmobile and makes sense I think. SAP ITSmobile is older technology, providing direct access to ABAP system SAP GUI, from mobile device web-browser. It is used in scenarios you mentioned and many others.

SAP NWRFC SDK is PyRFC dependency and installed separately. As @mpf82 explained, some mechanism is required to pull the SDK to Android mobile devices, but SDK does not work on Android.

These platforms are supported and Android is not planned in near future:

https://launchpad.support.sap.com/#/notes/2573790

EuroV8 commented 1 year ago

Again, thanks for your answers. My concerns were unfortunately correct, it's a shame that Android isn't supported, because it would make for a much easier framework for app development, at least for people with much less SAP experience such as myself. I will look into SAP's ITSMobile, my main goal was integrating a QR-Code reading functionnality using mobile devices' cameras, which wasn't very difficult to do with Python.