lal
lal copied to clipboard
Run as an Adroid Application
I was trying to integrate the server into an android app by generating a library and starting the server through JNI call which is exposed over cgo. Inorder to build the server as a library I was using; CGO_ENABLED=1 GOOS=android GOARCH=arm64 CC=/home/dev/Android-SDK/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android33-clang go build -buildmode=c-shared -o libfoo.so main.go as a result the server gets called but somehow it crashes and the android subsystem repeatedly tries to reinitialize the server library. Do you have any clue what the problem might be?
Sorry, I'm not good at Android apps. Maybe upload the error log to let us have a look.
Adb logcat results
W ResourcesOffloading: An exception occurred : W ResourcesOffloading: java.io.EOFException W ResourcesOffloading: at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2751) W ResourcesOffloading: at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1378) W ResourcesOffloading: at java.io.ObjectInputStream.readObject(ObjectInputStream.java:427) W ResourcesOffloading: at android.app.ResourcesOffloading$ResourcesOffloadingRunnable.run(ResourcesOffloading.java:82) W ResourcesOffloading: at java.lang.Thread.run(Thread.java:920) D LoadedApk: LoadedApk::makeApplication() appContext.mOpPackageName=com.example.myapplication appContext.mBasePackageName=com.example.myapplication D NetworkSecurityConfig: No Network Security Config specified, using platform default D NetworkSecurityConfig: No Network Security Config specified, using platform default D ActivityThread: handleBindApplication() -- D OpenGLRenderer: RenderThread::requireGlContext() D MdnieScenarioControlService: packageName : com.example.myapplication className : com.example.myapplication.MainActivity V MdnieScenarioControlService: setUIMode from UI function(3) D OpenGLRenderer: RenderThread::setGrContext() D AppCompatDelegate: Checking for metadata for AppLocalesMetadataHolderService : Service not found I GenerationRegistry: mBackingStore.isClosed() : false D ActivityManagerPerformance: AMP_release() ACT_RESUME I HYPER-HAL: [RequestManager.cpp]releaseLocked(): Released ID : 485638 I EDEN : [Exynos][EDEN][v1.6.22][SERVICE] processAliveMointorMain:253: Try to check pid=(30609)... E audit : type=1400 audit(1683551645.325:197829): avc: denied { read } for pid=17824 comm="e.myapplication" name="somaxconn" dev="proc" ino=13964411 scontext=u:r:untrusted_app:s0:c14,c256,c512,c768 tcontext=u:object_r:proc_net:s0 tclass=file permissive=0 SEPF_SM-G973F_12_0001 audit_filtered E audit : type=1300 audit(1683551645.325:197829): arch=c00000b7 syscall=56 success=no exit=-13 a0=ffffffffffffff9c a1=40003a0b00 a2=80000 a3=0 items=0 ppid=537 pid=17824 auid=4294967295 uid=10014 gid=10014 euid=10014 suid=10014 fsuid=10014 egid=10014 sgid=10014 fsgid=10014 tty=(none) ses=4294967295 comm="e.myapplication" exe="/system/bin/app_process64" subj=u:r:untrusted_app:s0:c14,c256,c512,c768 key=(null) E audit : type=1327 audit(1683551645.325:197829): proctitle="com.example.myapplication" V MdnieScenarioControlService: mAclOffEnabled : false mAclPreviewState : false mAclCompensationState : false I ActivityManager: Process com.example.myapplication (pid 17824) has died: fg TOP (493,2129) I libprocessgroup: Successfully killed process cgroup uid 10014 pid 17824 in 0ms I Zygote : Process 17824 exited cleanly (1)
Sorry, I don't have a clue.