premake / premake/premake-core

Issues with the Android module

Open
#1,256 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
3.6k
Forks
654
Avg merge
1d 1h
Merged PRs (30d)
13

Description

I've spent a bit of time trying to create an Android native app build for a small project I have. The way I've set up my premake.lua is as follows:

workspace("app")

configurations { "Debug", "Release" }
platforms { PlatformMSVC64, PlatformAndroidARM }
cppdialect("c++11")

filter { "platforms:"..PlatformMSVC64 }
    toolset("msc")
    vectorextensions ("sse4.1")
    architecture("x64")

filter { "platforms:"..PlatformAndroidARM }
    system("android")
    architecture("arm")
    vectorextensions("neon")

project ("app_main")
    kind("ConsoleApp")
    files
    {
        srcDir.."/*.cpp",
    }

    includedirs
    {
        srcDir.."/**.h"
    }
	
    filter { "platforms:"..PlatformAndroidARM }
        kind("SharedLib")
        files
        {
            "src/android/android_native_app_glue.h",
            "src/android/android_native_app_glue.c",
        }

project ("app_android")
    kind("AndroidProj")
    androidapplibname("app_main")
    files
    {
        "src/android/AndroidManifest.xml",
        "src/android/build.xml",
        "src/android/project.properties",
        "src/android/res/values/strings.xml",
    }
  1. The first thing I want to ask what the best place is to write a small tutorial for the Android module, as it's not really as straightforward as the other platform configurations, given the need for androidproj, etc. It's taken me a few hours of trying, restarting, etc to get it working.

  2. It seems like androidproj needs to have a reference to the dynamic library where main lives, I know how to do it through the UI but not through premake. I haven't been able to find what api I need to do this. Failure to put the reference produces an error, "Error installing the package. The package ABI 'unknown' is incompatible with the ABI 'armeabiv7a' of device" I figured out that links is the command in this case

  3. It also looks like the minute a project with an androidproj file lives alongside other configurations, the other configurations also run the apk process as part of their build. This is clearly unwanted behavior but I don't know how to exclude the androidproj.

Hopefully these are all simple matters that you've had experience with. Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the premake.lua configuration shown in the issue and inspect how AndroidProj is handled when it is declared alongside the MSVC configuration. Reproduce the generated build behavior for both platforms, then confirm that non-Android configurations no longer run the APK-related build steps.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, c, lua
Domain
build-system, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.