From 1783102ada69747c12b61795a3187f40fa7ad7b4 Mon Sep 17 00:00:00 2001 From: Vulcan <93451215+trholding@users.noreply.github.com> Date: Fri, 3 Jan 2025 03:52:28 +0530 Subject: [PATCH 1/3] Fix INSTALL_FAILED_OLDER_SDK error when built with SDK 34 When building with SDK 34 the following error occurs on devices that need older SDKs: ``` Failure [INSTALL_FAILED_OLDER_SDK: Requires newer sdk version #34 (current version is #33)] Performing Streamed Install adb: failed to install cnfgtest.apk: Failure [INSTALL_FAILED_OLDER_SDK: Requires newer sdk version #34 (current version is #33)] make: *** [Makefile:191: push] Error 1 ``` This is resolved by setting ANDROIDVERSION=29 in the AndroidManifest.xml target which sets android:minSdkVersion to the lowest SDK version supported by rawdrawandroid. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 03af7e3..26cb5f3 100644 --- a/Makefile +++ b/Makefile @@ -176,7 +176,7 @@ manifest: AndroidManifest.xml AndroidManifest.xml : rm -rf AndroidManifest.xml PACKAGENAME=$(PACKAGENAME) \ - ANDROIDVERSION=$(ANDROIDVERSION) \ + ANDROIDVERSION=29 \ ANDROIDTARGET=$(ANDROIDTARGET) \ APPNAME=$(APPNAME) \ LABEL=$(LABEL) envsubst '$$ANDROIDTARGET $$ANDROIDVERSION $$APPNAME $$PACKAGENAME $$LABEL' \ From 39aac576296314cb9b4c98d7f9927f0c0d6abff2 Mon Sep 17 00:00:00 2001 From: Vulcan <93451215+trholding@users.noreply.github.com> Date: Fri, 3 Jan 2025 04:13:48 +0530 Subject: [PATCH 2/3] Fix `error: unknown target CPU 'intel'` x86 / x86_64 builds When building the x86 and / or x86_64 target(s) with SDK 34 and NDK 28.0.12674087, the following error occurs: ```error: unknown target CPU 'intel' note: valid target CPU values are: i386, i486, winchip-c6, winchip2, c3, i586, pentium, pentium-mmx, pentiumpro, i686, pentium2, pentium3, pentium3m, pentium-m, c3-2, yonah, pentium4, pentium4m, prescott, nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, rocketlake, icelake-server, tigerlake, sapphirerapids, alderlake, raptorlake, meteorlake, arrowlake, arrowlake-s, lunarlake, gracemont, pantherlake, sierraforest, grandridge, graniterapids, graniterapids-d, emeraldrapids, clearwaterforest, knl, knm, lakemont, k6, k6-2, k6-3, athlon, athlon-tbird, athlon-xp, athlon-mp, athlon-4, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, znver4, x86-64, geode make: *** [Makefile:138: makecapk/lib/x86/libcnfgtest.so] Error 1``` The fix is to omit -mtune flag or set -mtune=generic where generic is a better choice. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 26cb5f3..e7f65d8 100644 --- a/Makefile +++ b/Makefile @@ -107,8 +107,8 @@ TARGETS += makecapk/lib/arm64-v8a/lib$(APPNAME).so CFLAGS_ARM64:=-m64 CFLAGS_ARM32:=-mfloat-abi=softfp -m32 -CFLAGS_x86:=-march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32 -CFLAGS_x86_64:=-march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=intel +CFLAGS_x86:=-march=i686 -mtune=generic -mssse3 -mfpmath=sse -m32 +CFLAGS_x86_64:=-march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=generic STOREPASS?=password DNAME:="CN=example.com, OU=ID, O=Example, L=Doe, S=John, C=GB" KEYSTOREFILE:=my-release-key.keystore From 3658d3201b0d1847c0168de83d01cbb4d85dfe8c Mon Sep 17 00:00:00 2001 From: Salih Date: Fri, 3 Jan 2025 18:08:59 +0300 Subject: [PATCH 3/3] Optimized flag for compiler I should was first edit this, my mistake i saw your code and edited Charles's project --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index e7f65d8..cfa7fcf 100644 --- a/Makefile +++ b/Makefile @@ -107,8 +107,16 @@ TARGETS += makecapk/lib/arm64-v8a/lib$(APPNAME).so CFLAGS_ARM64:=-m64 CFLAGS_ARM32:=-mfloat-abi=softfp -m32 +#--------------------------------------------------------------- +#general usage CFLAGS_x86:=-march=i686 -mtune=generic -mssse3 -mfpmath=sse -m32 CFLAGS_x86_64:=-march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=generic + +#optimized code for your computer +#if your computer doesnt support 32 bit or 64 bit you can change march as -march=native (i suppose) +#CFLAGS_x86 := -march=i686 -mtune=native -m32 +#CFLAGS_x86_64 := -march=x86-64 -mtune=native +#--------------------------------------------------------------- STOREPASS?=password DNAME:="CN=example.com, OU=ID, O=Example, L=Doe, S=John, C=GB" KEYSTOREFILE:=my-release-key.keystore