skip
skip copied to clipboard
Renaming the package of a generated app is difficult
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):
- Edit
Skip.envwith the change:ANDROID_PACKAGE_NAME = hello.skipxyz - Edit
Sources/HelloSkip/Skip/skip.ymland add the line underbuild:/contents::- 'group = "hello.skipxyz"' - Edit
Android/app/build.gradle.ktsand add the line in theandroidblock:group = "hello.skipxyz" - Edit
Android/src/main/kotlin/hello/skip/Main.ktand updatepackage 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)