Skip to content

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

@dfabulich

Description

@dfabulich

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions