core icon indicating copy to clipboard operation
core copied to clipboard

android deployment fails with INSTALL_FAILED_NO_MATCHING_ABI

Open twjobs2005 opened this issue 1 year ago • 1 comments

Describe the bug

Building on a Fedora Silverblue (linux, intel) system, targetting a Moto G6 with Android version 9, kernel 3.18.120...2020 .. FAILS with INSTALL_FAILED_NO_MATCHING_ABIS


Build machine (Linux Desktop):

$ uname -a Linux fedora 6.11.8-200.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Nov 14 20:38:18 UTC 2024 x86_64 GNU/Linux


Building on Linux, trying to deploy on real android device...

$ core install android xcrun xcodebuild -version /tmp/gomobile-work-1036905224/lib/arm64-v8a/libCogent_Core_Gui.so: no symbols

adb install -r /var/home/.../bin/android/Cogent Core Gui.apk Performing Streamed Install

adb: failed to install /var/home/.../bin/android/Cogent Core Gui.apk: Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]

core install failed: install: failed to run "adb install -r /var/home/.../bin/android/Cogent Core Gui.apk: exit status 1"

How to reproduce

just try to build this on linux (amd64) and deploy on Moto G6 (Android 9, arm?). It runs locally on the linux desktop, but not on the android device. Are there any target flags that I need to provide? (Love the project by the way!)

$ cat main.go
package main

import "cogentcore.org/core/core"

func main() {
	b := core.NewBody()
	core.NewButton(b).SetText("Hello, World!")
	b.RunMainWindow()
}

Example code

No response

Relevant output

No response

Platform

Android

twjobs2005 avatar Dec 21 '24 22:12 twjobs2005

Thank you for reporting this. This error message indicates that the architecture it is compiling for does not match the architecture of the Android device. The default target architecture is arm64, so I would just try these commands until one of them works:

core install android/arm
core install android/amd64
core install android/386

I will update the documentation to clarify the architecture behavior when compiling for mobile. Please also note that core build android makes a fat apk with all architectures included by default.

kkoreilly avatar Dec 21 '24 22:12 kkoreilly