proton
proton copied to clipboard
Easier way to change a project's bundle name with the new android build system?
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?
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.
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.
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.properties_removethispart_ (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!
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.
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.
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.
Sorry. I deleted the comment because I messed up something
I updated the gradle files for both sample projects. Removed fmod from rtsimpleapp, hopefully it works for ya now
okey