How to build/run on Android?

Having some trouble building a new project on Android.

I tried following run instructions on github and in the docs, so I tried to run and compile, I also tried the latest Android Studio (Android Studio 4.2, and API 31); the project wouldn’t sync until I installed and then downgraded NDK and CMake. Now the project will sync, but it won’t build. Just looking the path of least resistance to getting Android working.

I’m not sure the status of cocos run. Can you use Android Studio for everything?

Sounds like you have not got your compile not set up right. try the tuturals from

Sonar Systems

he has videos on youtube Windows , Mac , Linux

I am now trying to use Android Studio for everything. I’ve installed ndk and cmake through android studio sdkmanager, and then downgraded the versions, so now at least the project will sync. Currently I’m getting the error:

CMake Error: CMake was unable to find a build program corresponding to “Ninja”. CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.

I don’t really know a lot about build stuff and I’m going down a rabbit hole of putting hack on top of hack to try and get it working… just looking for an easy way to get Android up and running. Given the above link, is visual studio a better choice to build Android? That video also seems a bit out of date

Can you have a look here: Android · GitBook

Yes I did follow this doc, I think it may be a bit out of date though, it refers to Android Studio 2.3+, where the latest version is 4.2, and things have changed a lot in that time. I’m sure people must have it working, but there isn’t any recent guide that I could find.

yeah yeah Did you hit the gradel Upgade becose that messes up the build, Its annying but make new project and do the fist build . Then I know its tempting but sometimes android studio says hays I got an upgrade but don’t do it will reconfiigger project and wont find ninja. only way round it for me was to make new Project and bung my Classis back in. I found best is to crate new project, compile then add my class’s and zip it up that way if compile rconfigtgers something wrong, You can unzip back.

I have followd his guids and mannged to get it woking on Windws, Mac and Linux, this shold be the new ones because we dont use the “ANT+” mudule anymore. but look at his Lerning pages he poted quit a lot.