skiptools / skiptools/skip

Renaming the package of a generated app is difficult

Open
#323 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Swift
Stars
3.2k
Forks
106
Avg merge
6d 13h
Merged PRs (30d)
1

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the package rename using Skip.env, Sources/HelloSkip/Skip/skip.yml, Android/app/build.gradle.kts, and Android/src/main/kotlin/hello/skip/Main.kt. Trace how these generated files derive the package and dependency names, then verify that changing the app package no longer causes the reported build failure or Android launch crash.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin, swift
Domain
build-system, mobile-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.