Skip to content

Conversation

@armanhossiny
Copy link
Contributor

Description
A fresh Android build of the HelloCpp template fails to compile because AppActivity
uses methods that require AppCompatActivity, but AxmolActivity does not extend it,
and the template is missing the androidx.appcompat dependency. So the Android
template does not build out of the box.

AxmolActivity does not extend AppCompatActivity / missing appcompat dependency
@rh101
Copy link
Contributor

rh101 commented Nov 5, 2025

A new project created from the template using Axmol v2.9.1 shows no errors when building with Android Studio 2025.2.1, so are you sure there isn't an issue specific to your dev environment?

@armanhossiny
Copy link
Contributor Author

environment
engine_version=2.9.1
project_type=cpp
package_name=dev.axmol.hellocpp
min_sdk=23
ndk=r28b+

@halx99
Copy link
Collaborator

halx99 commented Nov 5, 2025

only axmol v3 depends on androidx.appcompat

@rh101
Copy link
Contributor

rh101 commented Nov 5, 2025

environment engine_version=2.9.1 project_type=cpp package_name=dev.axmol.hellocpp min_sdk=23 ndk=r28b+

OK, I see now, but the statement "template does not build out of the box." is not quite correct. Generating a new project from the template, and building it, has no issues at all.

You have modified min_sdk and ndk values, and that may be what is causing issue for you, so wouldn't you class that as being project-specific? It doesn't seem like a template issue at all.

@armanhossiny
Copy link
Contributor Author

My project won't build at all with Axmol 3.

This build error is not related to min_sdk or the NDK version. I have already tested different version for both, and the issue still persists.

When building the project, I get the following compilation errors:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':HelloCpp2.9.1:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler output below.

warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] source value 8 is obsolete and will be removed in a future release

J:\HelloCpp2.9.1\proj.android\app\src\dev\axmol\app\AppActivity.java:35: error: cannot access AppCompatActivity
public class AppActivity extends AxmolActivity {
                                   ^
  class file for androidx.appcompat.app.AppCompatActivity not found

warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.

J:\HelloCpp2.9.1\proj.android\app\src\dev\axmol\app\AppActivity.java:46: error: cannot find symbol
    if (!isTaskRoot()) {
         ^
  symbol:   method isTaskRoot()
  location: class AppActivity

J:\HelloCpp2.9.1\proj.android\app\src\dev\axmol\app\AppActivity.java:56: error: cannot find symbol
    WindowManager.LayoutParams lp = getWindow().getAttributes();
                                    ^
  symbol:   method getWindow()
  location: class AppActivity

J:\HelloCpp2.9.1\proj.android\app\src\dev\axmol\app\AppActivity.java:58: error: cannot find symbol
    getWindow().setAttributes(lp);
    ^
  symbol:   method getWindow()
  location: class AppActivity

4 errors
3 warnings

* Try:
> Check your code and dependencies to fix the compilation error(s)
> Run with --scan to generate a Build Scan (powered by Develocity).

@rh101
Copy link
Contributor

rh101 commented Nov 6, 2025

My project won't build at all with Axmol 3.

To clarify, which branch are you using, dev or release/2.x?

Also, which version of Android Studio are you using?

@armanhossiny
Copy link
Contributor Author

Android Studio Otter | 2025.2.1
using branch release/2.x

@rh101
Copy link
Contributor

rh101 commented Nov 6, 2025

Using Android Studio 2025.2.1, and building a new project created from the branch releases/2.x, there are no errors at all, whether building a debug or release version.

I suggest you delete or rename or you current axmol folder, and re-clone the repo from Github, then switch to the releases/2.x branch. Redo the setup process, such as running ./setup.ps1 etc.., then create a new project, and build it as-is in Android Studio, without modifying anything in the project.

@rh101
Copy link
Contributor

rh101 commented Nov 17, 2025

@armanhossiny Is there any reason that this issue is still open? The Android build works without the changes in this PR, so this may indicate a problem in your development environment.

@halx99 Is there any issue with the Android build?

@halx99 halx99 closed this Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants