skip icon indicating copy to clipboard operation
skip copied to clipboard

Renaming the package of a generated app is difficult

Open marcprux opened this issue 11 months ago • 0 comments

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

marcprux avatar Jan 25 '25 16:01 marcprux