DIT112-V19 / group-08

Autonomous parallel parking and obstacle avoidance Smartcar
MIT License
2 stars 4 forks source link

Creation of .travis.yml #99

Closed Arvin-Esfahani closed 5 years ago

Arvin-Esfahani commented 5 years ago

The .travis.yml is necessary for Travis CI and having a functional continuous implementation for this GitHub repository.

Description

Related issue(s)

98

platisd commented 5 years ago

I suggest you solve the entire issue in one pull request but if you prefer multiple smaller ones it's fine with me. Just let me know which way you prefer and I can approve the request.

Arvin-Esfahani commented 5 years ago

I was going to do it in smaller sections but I am sure it'd be better to follow your suggestion. So I will make a pull request when I have the proper .travis.yml file made.

platisd commented 5 years ago

The way I would do it is to have a pull request open, like this one, and push to the related branch so I see the status of the Travis job.

platisd commented 5 years ago

Let's troubleshoot here. Just write a comment here next time you need help and tag me. :+1: There are two errros:

  /home/travis/build/DIT112-V19/group-08/Android_Application_for_SmartCar/app/src/main/res/layout/activity_main_page.xml:54: Error: Corresponding method handler 'public void CruiseControl(android.view.View)' not found [OnClick]
          android:onClick="CruiseControl"

This one tells you that it cannot find any method to call named CruiseControl. With a quick look, I can indeed see that this is the case. I believe there used to be something but most likely not anymore. So it's probably safe to remove that line since it most likely doesn't do anything at the moment. Alternatively, ask the person who implemented this on what was the intention behind it.

Edit: Looking at 69315d4caa362af1acb48f3880732ad59263cf94 I can see that at the time there used to be a CruiseControl function but not anymore. Specifically, you are not using that particular layout file. So for now, you can just remove that line so to stop the linter from complaining.

  /home/travis/build/DIT112-V19/group-08/Android_Application_for_SmartCar/app/src/main/AndroidManifest.xml:11: Error: Permission is only granted to system apps [ProtectedPermissions]
      <uses-permission android:name="android.permission.BLUETOOTH_PRIVILEGED" />

Here the error message is also pretty clear. You are asking for the BLUETOOTH_PRIVILEGED permission but that is only for system apps. So, unless you are running things on a rooted phone or something you are not being granted this permission anyway. Therefore, I would bet it's safe to remove this line all together.

Alternatively, if you don't want to fix the code, you can always silence the errors by adding the following lines inside the android structure in build.gradle:

      lintOptions {
          abortOnError false
      }
Arvin-Esfahani commented 5 years ago

I am currently facing what seems to be a bug with travis ci or openssl in general on windows. I am trying to sign and create the apk while avoiding publicly holding my api keys. to do that the widely proposed solution was to encrypt the key file with openssl, hold the key and secret of the encryption as environmental variables in Travis CI and then decrypt use and destroy the decrypted key on each run. But for some reason the decryption simply doesn't work. After some googling I found out it's a problem on Windows. Have you encountered this or do you have a workaround? If not I have no choice but to install linux.

platisd commented 5 years ago

Travis CI runs on Ubuntu 16.04 by default, so I am not sure how Windows is relevant. I will have a look later, but, do you really need to sign the APK? I mean, it's of course cool to do so, more "professional" and all that, but for the context of this story I personally do not consider it necessary.

Arvin-Esfahani commented 5 years ago

The issues seem to be that the encryption done on windows causes a "bad decrypt" error when being decrypted by Travis CI. This is an example

Arvin-Esfahani commented 5 years ago

The issue seems to be that the encryption done on windows causes a "bad decrypt" error when being decrypted by Travis CI. This is an example

platisd commented 5 years ago

Very strange and old issue. Well, I am on Linux so if I can help you by running one command or so, let me know.

platisd commented 5 years ago

If following this tutorial does not work, then skip signing the .apk and just deploy the debug version.

platisd commented 5 years ago

Wait for the CI to finish and then click on the "Squash and merge" option, not on the "Merge pull request" to avoid spamming your git history with all those "Update .travis.yml" commits. :grin:

platisd commented 5 years ago

Looks like it worked and #98 is fixed! Great effort which I hope will be useful for you in the future! :+1: