' A library uses the same package as this project' error when compiling for andr

designpeg

  • *
  • Posts: 731
When I try to compile for android, I get a " A library uses the same package as this project" error, anyone know the cause of this, or a way to correct it?

Justin

  • *
  • Posts: 4716
Are you using old extensions? Have you tried a clean build?
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

designpeg

  • *
  • Posts: 731
I've tried a clean build but that makes no difference. I do have quite a few extensions, but I'm pretty sure they're up to date. I suspected it could have been caused by byRobin's replay extension, but I didn't want to start removing the blocks if it turned out not to be the cause.

Justin

  • *
  • Posts: 4716
Previously, it was common for extensions to use something like package="::APP_PACKAGE::" inside the AndroidManifest.xml file. This would give the extension the same package name as the game itself. This is no longer allowed by the android build system, so each extension's AndroidManifest.xml file should have a unique identifier there, similar to how the game has com.yourcompany.gamename (until you change it to something else).

Stencyl's built-in extensions, as an example.
AdMob: package="com.byrobin.admobex"
Google Play Games: package="com.stencyl.extension.google"
Native: package="com.androidnative"
Purchases: package="com.stencyl.extension.purchases"

Note: Stencyl's built-in extensions can be found at [Stencyl install]/plaf/haxe/extensions for you to inspect them. And of course, your own extensions are at [stencylworks]/engine-extensions. If the extension has native Android capabilities, the AndroidManifest.xml file is found at [extension]/dependencies/[some identifier]/AndroidManifest.xml.
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

designpeg

  • *
  • Posts: 731
ok great, I'll check through them. Am I correct in thinking that a line like the one below could be the cause of the problem, and in this case I should replace  package="::APP_PACKAGE::" with something else, eg. com.gameanalytics.sdk ?

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="::APP_PACKAGE::" android:versionCode="::APP_BUILD_NUMBER::" android:versionName="::APP_VERSION::" android:installLocation="::ANDROID_INSTALL_LOCATION::">

designpeg

  • *
  • Posts: 731
great, that worked! thanks

Justin

  • *
  • Posts: 4716
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)