SethRobinson / proton

Proton SDK: Seth's GL/GLES messy multi-platform C++ game SDK. Can output to Windows, OS X, iOS, Android, Linux (Raspbian too), HTML5, Flash
Other
84 stars 16 forks source link

Easier way to change a project's bundle name with the new android build system? #17

Closed iProgramMC closed 1 year ago

iProgramMC commented 2 years ago

The current build system thing has a major flaw: all applications generated by it are called com.rtsoft.RTAndroidApp. This is OK-ish if you're only building one application using Proton SDK, but good luck building two or more with the same 'shared' files. Is this going to be changed?

SethRobinson commented 2 years ago

That's the beauty of the new system - just edit local.properties and change the app id there and the entire build will use it instead. Everything in shared can stay com.rtsoft.RTAndroidApp, it won't matter.

iProgramMC commented 2 years ago

I have tried this. The shared stuff stays as "Java_com_rtsoft_RTAndroidApp_XXX" and I get crashes due to missing functions unless I change the function name to "Java_com_iprogramincpp_myprojectnamehere" or whatever the new bundle name is.

That being said, I probably did something wrong. Not only did I change the local.properties file, I also changed the java files inside the local project AndroidGradle folder to have the package name the same as local.properties and there was the crash.

SethRobinson commented 2 years ago

Hmm - I suspect you might have changed one you shouldn't have maybe?

Make sure you DIDN'T change the ID in AndroidGradle\app\build.gradle, AndroidGradle\app\src\main\java\com\rtsoft\RTAndroidApp\Main.java or AndroidGradle\app\src\main\cpp\CMakeList.txt.

I was about to tell you to compile RTBareBones's android project as a test, but it looks like to me I might have made a mistake and it's not fully updated on github. (Sorry!)

Please try RTSimpleApp instead. If you search for where com.rtsoft.rtsimpleapp is you should see it's only in local.propertiesremovethispart (remove the _removethispart and edit in your keystore/password stuff, otherwise it can't produce a release bundle)

Dink, Mind Wall and Dungeon Scroll on the Play store are all using this build system, so in theory this should work. Let me know what happens, I'll update the docs to be better, this is my fault!

iProgramMC commented 2 years ago

Right, I use RTBareBones, and I have changed the folder structure from com/rtsoft/RTAndroidApp, but I will try both RTBareBones and RTSimpleApp just changing the package name in the local.properties.

SethRobinson commented 2 years ago

RTSimpleApp should compile and run without problems - but keep in mind if you DO change the package name, it HAS to match the package name in App.cpp as well. (AndroidUtils.cpp uses it when it does SetJavaPackageName(string(GetBundlePrefix())+string(GetBundleName())); )

look for:

const char GetBundleName() { const char bundleName = "rtsimpleapp"; return bundleName; }

and make sure that matches what you changed it to.

SethRobinson commented 2 years ago

I don't understand how I got a notification about a post here (the one with screenshots) that isn't actually in this thread, heh. Anyway, I've recently switched machines again so I'm going to go through the process of installing android studio etc and building these. If it's setup for FMOD in rtsimpleapp, yeah, that's a mistake, I'll switch it back to the default android audio system.

iProgramMC commented 2 years ago

Sorry. I deleted the comment because I messed up something

SethRobinson commented 2 years ago

I updated the gradle files for both sample projects. Removed fmod from rtsimpleapp, hopefully it works for ya now

ChristianIQ commented 2 years ago

okey