Skip to content

Renaming the package of a generated app is difficult #323

@marcprux

Description

@marcprux

If you want to change the package name of a Skip app from "hello.skip" to "hello.skipxyz", you need to perform the following 4 steps (see attached screenshot):

  1. Edit Skip.env with the change: ANDROID_PACKAGE_NAME = hello.skipxyz
  2. Edit Sources/HelloSkip/Skip/skip.yml and add the line under build:/contents:: - 'group = "hello.skipxyz"'
  3. Edit Android/app/build.gradle.kts and add the line in the android block: group = "hello.skipxyz"
  4. Edit Android/src/main/kotlin/hello/skip/Main.kt and update package hello.skipxyz, as well as importing the (auto-named and unchangeable) app module name: import hello.skip.*

Failure to do all of these will typically result in either a build error like:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all dependencies for configuration ':app:debugCompileClasspath'.
   > Could not find hello.skip:HelloSkip:.
     Required by:
         project :app

or a crash on launch like:

01-25 11:31:31.511 27349 27349 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "hello.skipxyz.AndroidAppMain" on path: DexPathList[[zip file "/data/app/~~fw-W-ujTxVW3iNG3EXBXeA==/skip.hello.App-Z2ec3q7jlZqMiDzywvUcuw==/base.apk"],nativeLibraryDirectories=[/data/app/~~fw-W-ujTxVW3iNG3EXBXeA==/skip.hello.App-Z2ec3q7jlZqMiDzywvUcuw==/lib/arm64, /data/app/~~fw-W-ujTxVW3iNG3EXBXeA==/skip.hello.App-Z2ec3q7jlZqMiDzywvUcuw==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
01-25 11:31:31.511 27349 27349 E AndroidRuntime: 	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
01-25 11:31:31.511 27349 27349 E AndroidRuntime: 	at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions