1
votes

I have a Xamarin Forms application and I've been using AppCenter to build and distribute my app.

This app connects to an external API, that has QA / Dev environments. To change the API URL, I've created a pre-build script on AppCenter and put it in the root of each project (iOS / Android). In the AppCenter, it identifies the pre-build script, but it seems to not be executed (I couldn't see in the Output logs any of the Echo messages of the script).

The script is quite similar to this, but my "AppConstant" class is inside a Helper folder in the Shared Project and I'm getting the path of this class like this: APP_CONSTANT_FILE=$APPCENTER_SOURCE_DIRECTORY/Root/Root/Root/Helpers/Endpoints.cs and I have added at the top of the script an echo "Running pre-build bash script..." to at least display something to make sure the script was executed, but nothing =/

The reason for adding Root/Root/Root is because of this comment and I have created the Environment Variable on AppCenter too.

I couldn't see any issues so far, could anybody give me a hand on that?

1
Please add your script here. If it does not run that mean you might have some prob in the script itself. I have it fully working on my app. - Umar3x
@Umar3x the script is quite the same to the one I have put a link for, the difference is instead of Root, I added the namespace of the project and the class that have the constant property has a different name. I could figure it out by recreating the script file in a mac computer, it was something related to encoding of the file. - Maturano

1 Answers

1
votes

I could find out why the script was not being executed. It was because of the Encoding of the shell script file.

I had created the file in a Windows computer and I read that App Center runs the script in a UNIX environment (I could see some strange characters in the Output Log), so I created from scratch the file in a Mac computer and App Center started to execute.