Building with Expokit and MS Mobile Center


#1

I am currently trying MS Mobile Center as the solution to a problem on how to build detached iOS on Windows. I’ve started with Android though as I cannot get ios project on Windows. I already solved couple of problems on the way, but currently I cannot get through this one…

2017-08-31T20:25:59.7414100Z Execution failed for task ‘:app:exponentPrebuildStep’.
2017-08-31T20:25:59.7429660Z > A problem occurred starting process ‘command ‘./.expo-source/android/detach-scripts/prepare-detached-build.sh’’

Here are full logs for download … https://www.dropbox.com/sh/0r3ntg11f4sxue9/AABpIWA4x7GORPEOSfyugpnXa?dl=0

And here is a full project that I am trying to build … https://www.dropbox.com/s/kbpf5d4ae81yk9l/tracker.zip?dl=0 … which is result of running these commands:

create-react-native-app
yarn run eject (with expokit)
yarn add mobile-center
react-native link

Side note: It’s necessary to add exception to .gitignore for *.jar files as those are needed for build

Setting up Mobile Center is pretty straightforward, not really much of the settings to care about.


#2

What happens if you just go to a terminal and run ./.expo-source/android/detach-scripts/prepare-detached-build.sh with the same arguments given in the build hook?


#3

As I said, I am on Windows. I cannot run shell script :slight_smile: But thanks for quick answer. I hope there is some quick and dirty solution to this.


#4

Oh, there is actually *.bat file too. Well, I tried to run that, it essentially just runs exp prepare-detached-build --platform android but that does almost nothing except adding DEVELOPMENT_URL to ExponentBuildConstants.java.


#5

I also tried to run command that’s in previous step there… android/gradlew -p android clean :app:assembleRelease which ends up with different error message. Probably not related to Expo itself, but not sure what it means either :confused:

Compiling with JDK Java compiler API.
:mobile-center:compileReleaseJavaWithJavac FAILED
:mobile-center:compileReleaseJavaWithJavac (Thread[main,5,main]) completed. Took 1.165 secs.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:mobile-center:compileReleaseJavaWithJavac’.

Could not find tools.jar


#6

So I have finally managed to finish build for Android locally. However, the Mobile Center is still with the same error as described in the first post. I’ll try to communicate with maintainers of it, but it’s hard to say where is an actual problem. It’s a shame, it was looking like a good solution how to automate builds.


#7

@ben So I have finally figured it out. Digging deeper and looking what this prepare step actually does I found out that it only sets DEVELOPMENT_URL in some java file. Obviously, this is not needed when building release :slight_smile: So I simply removed this step from build.gradle and now it works. Yay!

Anyway, there is apparently some problem with Mobile Center and that it fails to run this detach script for some reason. Hopefully, I’ll get some answers from developers during the week.