Skip
Trans-Compile to Android

To build an Android App

I am reminded of the 1970s Rocky Horror Picture Show.

In just 7 days I can Make you a ... MAN.
-- Doctor Frank-N-Furter

Well, I love making things and when I saw a toot about Skip the Trans-Compiling Xcode "plug-in" to build and make Android Apps from Swift code... I was hooked.  I will try that.

My cohorts for my first iOS App, InspireMe! Cards always wanted a version for their phones running that rip-off OS on that also-ran hardware.  But I had made it clear - I was not the developer to create that app.  I tried to recruit some beginners who wanted to learn and build - but that path never worked - too much hard work I guess.

Skip's Hello World App running side by side.

Gradle needs a Java SDK

Skip - install & configure

Installing Skip is relatively easy.... getting all the toolchain links working - well that is an exercise in reading logs, finding failures, and downloading more stuff you must implicitly trust.  Then configuring the heck out of it.

It will make you reflect on just how valuable that $100 fee for Apple's Developer Ecosystem is worth.  Priceless!

Figure it out...

This is not a "How To" on installing & configuring Skip...  

I once had a job with the university that was largely reverse engineering various Software installation scripts and reworking them to run on our Sun SparkStation AFS system - project Mosaic.  The quirk there was that the replication system relied on write-once, read-only installations.  Most unix installs at the time enjoyed writing logs to the installation folders.  As well as many other poor practices.
I got out of that business many years ago... I hate to have to be the system administrator of my MacBook.  By extension, I hate Java installs.

Do not _skip_ the skip checkup

I don't know why after installing and configuring and compiling the Hello World App... when I ran the checkup script... it still had dependencies to download...  <frustration> increases++ </frustration>

A long proctologist exam

The customer experience is very important... did you ever read the studies about how to increase patient satisfaction with old-school colonoscopy exams?  Weirdly you increase the time...

Missing the Retrofit section

While Skip has a section on how much effort they have gone to ... to make Skip disappear into the background - I wish they had a section on how to retrofit an existing App into their complex system.

See Developing with Skip.

Guessing...

Start from a copy of their Hello Skipper App.  Then copy my existing Apps source code and resources into the existing Hello Skipper App one piece at a time...

At some point that is going to break something... there is little chance that I can drag & drop the files in a proper no dependency skipped way - is there?

The Problem with Multiple Responsibilities

I'm in Java land-HELL  and can't compile because it cannot find a resource that is the responsibility of yet another 3rd party that this compile is dependent upon.  This makes me sick to my senses.  It is the reason - I didn't go down the path of porting my App to Android in the first place.  Because it is a house of cards that collapses with the slightest breeze.

And in this particular case, I know what the problem is - I just do not know how to fix it.  I can get the detail logs - dumped to the screen, then sift through the logs to find the error.  And it almost tells me exactly but not quite how to fix it.

Done that - now what?

After you set the local.properties with ANDROID_HOME.  You think it's going to work so you try again.  But it does not work... same error.  Why did it not work... you cannot tell.  Is this a good situation to REBOOT the instance of the WORLD?

too much Java

We all know - too much Java will make you gittery and maybe even set off ANGER and FRuSTratiON!

I seem to have resolved my Skip compile failures by Removing one to many Java folders on my machine.  Seems that the classic "just set JAVA_HOME" was causing it's own set of dependency clashing failure modes.  I deleted all - but ONE - the (Apple Silicone M1 - Java 17) Java installs - removed all the ENV VARs that I tried to set.  And rebooted the World.  Because Env Var are tightly coupled with the start-up of terminals and shells.

Got out of the automobile on the right side - walked around to the left side and got back in.   And it worked!

I HATE Java

Learning Java and using Java as a solution is like the frogs in the pot of water - sitting on a fire... the pot is going to boil - but the frogs are staying in their safe spot.

Trust me - there are way better environments to program within - way better eco-systems to spend your time/energy maintaining and more fun places to play.  JUMP OUT!

Did you come here for Skip?

Yeah... me too.  Maybe I can get back to figuring out how to retrofit my iOS App into the Skip (Java infested waters) and out will pop an Android App...

I will let you know...

Here's a PLAN

Q: How do I get started porting my existing iOS App?

The short answer is that Skip, at this early stage, is best suited to new, greenfield apps. That doesn't mean that you can't bring over your existing SwiftUI and business logic, it just means that you'll need to migrate it yourself.

We'll be writing a blog post and more documentation on this topic soon. In short, we envision the path from an existing iOS app to a dual-platform iOS/Android app using Skip will look something like this:

Take it slowly and write lots of tests, and you'll be well on your way to to bringing your iOS app to Android and creating a genuinely native dual-platform application.


From:  Marc of SkipTools


Next Question

Q:  I see multiple folders that contain SwiftUI files in the Hello-Skip example;  where do I place a new Swift View?

You should implement everything app-related in the module(s) under the Sources/AppName/. Source code in the Darwin/Sources/ and Android/app/src/main/ folders are the app's Swift/Kotlin outermost "scaffolding" and are not transpiled by Skip, and will generally contain the nitty-gritty details of the deployment for the app on each platforms.

The Sources/AppName/ folder (and any other local or remote dependent modules you add to your Package.swift project) will be transpiled into Kotlin, and so run on both platforms. That is where you should do your app and model development. You generally only need to touch the platform-specific stuff when you have very platform-bespoke setup to perform, like requesting permissions or setting up the app's style and theme parameters.

Documentation on this topic is still forthcoming. Thanks for helping identify this deficiency, and we hope you continue to try out the Skip tech preview!

From Marc of SkipTools