voula_d
Topic Author
Posts: 17
Joined: 16 Feb 2023, 17:40

Building a WPF app to Android

06 Feb 2024, 17:34

Hello,
I have ported a WPF app to Noesis and I managed to build it for windows. I am now stuck on how to build the same app for Android. I tried using the instructions from this guide https://www.noesisengine.com/docs/Gui.C ... ng-android. Are these the steps I should be following? The instructions mention a makefile that gets generated. I was unable to find or generate a makefile.
I tried building from Visual studio and got to the point where the app built and was deployed to the emulator but never run. Could you please elaborate more on the build process? Is there a more detailed guide I can follow?
 
voula_d
Topic Author
Posts: 17
Joined: 16 Feb 2023, 17:40

Re: Building a WPF app to Android

06 Feb 2024, 17:50

I'm not sure this helps but trying to run the HelloWorld sample from VisualStudio on the Android emulator gives me the following error and stops:

Start debugging Android application ...
> am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.noesis.Samples.HelloWorld/crc64382e7c390968e9cf.MainActivity"
> Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.noesis.Samples.HelloWorld/crc64382e7c390968e9cf.MainActivity }
[ples.HelloWorl] Late-enabling -Xcheck:jni
[ples.HelloWorl] Unexpected CPU variant for X86 using defaults: x86_64
[ndk_translation] Initialized NDK translation (aarch64), version 0.2.3
[CompatibilityChangeReporter] Compat change id reported: 171979766; UID 10147; state: DISABLED
[ApplicationLoaders] Returning zygote-cached class loader: /system/framework/android.test.base.jar
[GraphicsEnvironment] ANGLE Developer option for 'com.noesis.Samples.HelloWorld' set to: 'default'
[GraphicsEnvironment] Neither updatable production driver nor prerelease driver is supported.
[NetworkSecurityConfig] No Network Security Config specified, using platform default
[NetworkSecurityConfig] No Network Security Config specified, using platform default
[debug-app-helper] Checking if libmonodroid was unpacked to /data/app/~~_ALl5-suICBaWDgsPdfMCg==/com.noesis.Samples.HelloWorld--jTm_922Znuptfatn70lpQ==/lib/arm64/libmonodroid.so
[debug-app-helper] Native libs extracted to /data/app/~~_ALl5-suICBaWDgsPdfMCg==/com.noesis.Samples.HelloWorld--jTm_922Znuptfatn70lpQ==/lib/arm64, assuming application/android:extractNativeLibs == true
[debug-app-helper] Setting up for DSO lookup in app data directories
[debug-app-helper] Added filesystem DSO lookup location: /data/app/~~_ALl5-suICBaWDgsPdfMCg==/com.noesis.Samples.HelloWorld--jTm_922Znuptfatn70lpQ==/lib/arm64
[debug-app-helper] Using runtime path: /data/app/~~_ALl5-suICBaWDgsPdfMCg==/com.noesis.Samples.HelloWorld--jTm_922Znuptfatn70lpQ==/lib/arm64
[debug-app-helper] checking directory: `/data/user/0/com.noesis.Samples.HelloWorld/files/.__override__/lib`
[ples.HelloWorld] type=1400 audit(0.0:176): avc: denied { getattr } for path="/dev/pmsg0" dev="tmpfs" ino=340 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:pmsg_device:s0 tclass=chr_file permissive=0 app=com.noesis.Samples.HelloWorld
[debug-app-helper] directory does not exist: `/data/user/0/com.noesis.Samples.HelloWorld/files/.__override__/lib`
[debug-app-helper] Checking whether Mono runtime exists at: /data/user/0/com.noesis.Samples.HelloWorld/files/.__override__/libmonosgen-2.0.so
[debug-app-helper] Checking whether Mono runtime exists at: /data/app/~~_ALl5-suICBaWDgsPdfMCg==/com.noesis.Samples.HelloWorld--jTm_922Znuptfatn70lpQ==/lib/arm64/libmonosgen-2.0.so
[debug-app-helper] Mono runtime found at: /data/app/~~_ALl5-suICBaWDgsPdfMCg==/com.noesis.Samples.HelloWorld--jTm_922Znuptfatn70lpQ==/lib/arm64/libmonosgen-2.0.so
[ples.HelloWorl] Attempt to remove non-JNI local reference, dumping thread
[monodroid] Creating public update directory: `/data/user/0/com.noesis.Samples.HelloWorld/files/.__override__`
[ples.HelloWorl] Attempt to remove non-JNI local reference, dumping thread
[monodroid-debug] Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=10.0.2.2:49189,embedding=1
[app_process64] * Assertion at /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mono/utils/mono-context.c:474, condition `fpctx->head.magic == FPSIMD_MAGIC' not met
[libc] Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 7949 (Finalizer), pid 7882 (ples.HelloWorld)
Could not connect to the debugger.
 
User avatar
jsantos
Site Admin
Posts: 3938
Joined: 20 Jan 2012, 17:18
Contact:

Re: Building a WPF app to Android

06 Feb 2024, 17:56

In the SDK Build directory (NoesisSDK/Build/) there are a few makefiles for Android. Just doing
make -f NoesisGUI-android-arm.mk CONFIG=Release
should build all the examples if you have all the dependencies installed as indicated.

PS: This is for the C++ SDK
 
User avatar
jsantos
Site Admin
Posts: 3938
Joined: 20 Jan 2012, 17:18
Contact:

Re: Building a WPF app to Android

06 Feb 2024, 18:00

For C# SDK you need to use this guide:
 
voula_d
Topic Author
Posts: 17
Joined: 16 Feb 2023, 17:40

Re: Building a WPF app to Android

07 Feb 2024, 14:49

Thanks for the quick response! Building the HelloWorld sample works and I am trying to deploy to an Android emulator. Still getting the error described above.
Is it possible to run the samples on an Android emulator? And, if it is, is there a specific configuration I must follow to set up the emulator?
 
User avatar
jsantos
Site Admin
Posts: 3938
Joined: 20 Jan 2012, 17:18
Contact:

Re: Building a WPF app to Android

08 Feb 2024, 13:44

We haven't tried the emulator recently but it should work. Make sure to use the right library for the architecture of the device you are trying to emulate (so arm instead of x86). This is different in comparison to iOS emulators.

Who is online

Users browsing this forum: Google [Bot] and 2 guests