rules_android icon indicating copy to clipboard operation
rules_android copied to clipboard

mobile-install not fully open sourced

Open Bencodes opened this issue 1 year ago • 6 comments

The studio-deployer that drives mobile-install V3 hasn't been open sourced yet as a standalone tool which causes mobile-install to just crash when it's invoked.

Bencodes avatar Aug 21 '24 17:08 Bencodes

This is blocking us as well. @ahumesky @ted-xie help? :)

oliviernotteghem avatar Aug 21 '24 18:08 oliviernotteghem

There is this guide for extracting the studio deployer from an Android Studio installation, but I haven't updated it to work with the new rules_android releases yet.

Beyond that, it's a fairly complex dependency that another team at Google is working on releasing -- there's been a fair amount of progress in the past few weeks, so at this point it's just a waiting game.

ted-xie avatar Aug 21 '24 18:08 ted-xie

@ted-xie : lib/3rd-party-rt.jar is not distributed in recent version of Android Studio. We use Jellyfish BTW (but it has been removed in Iguana too). Please advise.

oliviernotteghem avatar Aug 22 '24 00:08 oliviernotteghem

On my machine, I installed Hedgehog locally in order to craft the workaround for the missing deployer jar -- it only took a few minutes to install IIRC. The jar itself can be used for pretty much any rules_android or SDK version. If it's a significant blocker for you I can look into updating the direction for Jellyfish and possibly other Studio versions.

ted-xie avatar Aug 22 '24 14:08 ted-xie

@ted-xie that's fine. Wanted to check with you first re: compatibility of the jars.

oliviernotteghem avatar Aug 22 '24 18:08 oliviernotteghem

Followed steps in the doc. Here is the error I am getting with a tiny sample app. Using recent rules_android (~1 month behind HEAD)

INFO: Invocation ID: 4f7e92df-59ad-4d39-84c8-4aa15c5d3cae
ERROR: /Users/oliviern/.bazelcache/workspace/91a99194e71852b0e089ca5cc1c48073/external/rules_android/tools/android/BUILD:157:8: Executing genrule @@rules_android//tools/android:java8_legacy_dex failed: (Exit 1): bash failed: error executing Genrule command (from target @@rules_android//tools/android:java8_legacy_dex)
  (cd /Users/oliviern/.bazelcache/workspace/91a99194e71852b0e089ca5cc1c48073/execroot/_main && \
  exec env - \
    PATH=/bin:/usr/bin:/usr/local/bin \
  /bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh; bazel-out/xplat-opt-exec/bin/external/rules_android/tools/android/build_java8_legacy_dex --output bazel-out/xplat-fastbuild/bin/external/rules_android/tools/android/java8_legacy.dex.zip')
# Configuration: 4cb980a246440b3b2afd620b350b47e62938c9a28716c89e381943e9e3c69316
# Execution platform: //:xplat
/Users/oliviern/.bazelcache/workspace/91a99194e71852b0e089ca5cc1c48073/execroot/_main/bazel-out/xplat-opt-exec/bin/external/rules_android/tools/android/d8: Cannot locate runfiles directory. (Set $JAVA_RUNFILES to inhibit searching.)
Aspect @@rules_android//mobile_install:mi.bzl%MIASPECT of //experimental/sample/simple/app:app failed to build

oliviernotteghem avatar Aug 22 '24 23:08 oliviernotteghem

Quick update on this: The deployer jar has been released on Maven (https://maven.google.com/web/index.html#com.android.tools.apkdeployer:apkdeployer:8.8.0-alpha04). I'm working on integrating and testing this for OSS mobile-install.

ted-xie avatar Oct 01 '24 18:10 ted-xie

Great! Let's make sure we test both linux and mac os :)

oliviernotteghem avatar Oct 02 '24 09:10 oliviernotteghem

https://github.com/bazelbuild/rules_android/pull/262/files integrates the new apk deployer dependency. I verified it works for installing the basic app on Mac and Linux.

ted-xie avatar Oct 10 '24 20:10 ted-xie