skiptools / skiptools/skip

app build fails when android phone with USB debugging enabled is attached and app was installed from app store

Open
#635 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

As soon an android phone with USB debugging enabled attached and the app installed from the app store, the Skip-Lite build process in XCode and Terminal xcodebuild fails. Seen with two different phones and can be reproduced each time.

Cause: When an app is installed from the app store it can't be replaced by a developer version app. The same situation with the app originally installed as developer version completes fine.

Thanks to the detailed output from the xcodebuild on the command I could see the cause now, but within XCode it is nearly impossible to find out why it failed to build.

As it's correct to fail here, the solution would be to just forward the error message better to Xcode so it is visible for the user.

xcodebuild` -workspace Project.xcworkspace -scheme "My App" -destination 'generic/platform=iOS Simulator' -skipPackagePluginValidation

Resolve Package Graph

Resolved source packages:
  skip-lib: https://source.skip.tools/skip-lib.git @ 1.3.8
  skip-model: https://source.skip.tools/skip-model.git @ 1.7.1
  [...]: /Users/[...]
  skip-unit: https://source.skip.tools/skip-unit.git @ 1.5.0
  skip: https://source.skip.tools/skip.git @ 1.7.2
  skip-ui: https://source.skip.tools/skip-ui.git @ 1.49.0
  skip-foundation: https://source.skip.tools/skip-foundation.git @ 1.3.11

ComputePackagePrebuildTargetDependencyGraph

Prepare packages

Compile plug-in “skipstone” in package “skip”
[...]
> Task :skipstone:[...]:bundleLibCompileToJarDebug
> Task :app:compileDebugKotlin
> Task :app:compileDebugJavaWithJavac
> Task :app:dexBuilderDebug
> Task :app:processDebugJavaRes
> Task :app:mergeProjectDexDebug
> Task :app:mergeDebugJavaResource
> Task :app:mergeDebugGlobalSynthetics
> Task :app:mergeLibDexDebug
> Task :app:packageDebug
> Task :app:createDebugApkListingFileRedirect

> Task :app:installDebug
Installing APK 'app-debug.apk' on 'Pixel 3 - 12' for :app:debug
Unable to install /Users/[...]/.build/Android/app/outputs/apk/debug/app-debug.apk
com.android.ddmlib.InstallException: INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package[...] signatures do not match previously installed version; ignoring!
error: com.android.ddmlib.InstallException: INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package [...] signatures do not match previously installed version; ignoring!
	at com.android.ddmlib.IDeviceSharedImpl.installRemotePackage(IDeviceSharedImpl.java:344)
	at com.android.ddmlib.IDeviceSharedImpl.installPackage(IDeviceSharedImpl.java:367)
	at com.android.ddmlib.internal.DeviceImpl.lambda$installPackage$33(DeviceImpl.java:1470)
[...]
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:166)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.Error: /Users/[...]/Build/Intermediates.noindex/[...].build/Debug-iphonesimulator/[...] App.build/skip-gradle.log.txt:386:0: error: The gradle command failed. Review the log for details and consult https://skip.dev/docs/faq for common solutions. Command: gradle -p ../Android launchDebug
execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
[...]
	at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)
	at java.base@21.0.10/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base@21.0.10/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base@21.0.10/java.lang.Thread.run(Thread.java:1583)

> Task :app:installDebug FAILED
w: Detected multiple Kotlin daemon sessions at 

[Incubating] Problems report is available at: file:///Users/[...]/.build/Android/[...]/reports/problems/problems-report.html

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:installDebug'.
error: Execution failed for task ':app:installDebug'.
> java.util.concurrent.ExecutionException: com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package [...] signatures do not match previously installed version; ignoring!

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights from a Build Scan (powered by Develocity).
> Get more help at https://help.gradle.org.

BUILD FAILED in 1m 35s
145 actionable tasks: 51 executed, 94 up-to-date
note: Gradle FAILED: 
/Users/[...]/Debug-iphonesimulator/[...]build/skip-gradle.log.txt:386:0: error: The gradle command failed. Review the log for details and consult https://skip.dev/docs/faq for common solutions. Command: gradle -p ../Android launchDebug

note: Run script build phase 'Run skip gradle' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target '[...]' from project '[...]')
** BUILD FAILED **

The following build commands failed:
	PhaseScriptExecution Run\ skip\ gradle /Users/[...].build/Script-499CD4452AC5B869001AE8D8.sh (in target '[...] App' from project '[...]')
	Building workspace Project with scheme [...] App
(2 failures)

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 failure with an app-store installation and USB debugging enabled, using the shown xcodebuild command. Start with the Run skip gradle build phase and the referenced skip-gradle.log.txt output; done means the existing INSTALL_FAILED_UPDATE_INCOMPATIBLE error is surfaced clearly in Xcode rather than only in the detailed build log.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.