13

I am trying to build an android project with Jenkins, but I have error:

23:15:39 Could not initialize analytics, treating as opt-out.
23:15:39 java.io.FileNotFoundException:   /var/jenkins_home/.android/analytics.settings (No such file or directory)

How to fix this?

Scott Stensland
  • 26,870
  • 12
  • 93
  • 104
Admiral Land
  • 2,304
  • 7
  • 43
  • 81

2 Answers2

10

You're affected by this bug. The work-around should be as easy as manually creating the ~/.android directory before starting the build.

sschuberth
  • 28,386
  • 6
  • 101
  • 146
  • For me, the build goes through successfully even after this error. It seems its trying to write something to that file but the folder doesn't exist. Do you know if it effects something in the build? Thanks – Shobhit Puri Nov 09 '16 at 17:25
  • Just follow the link to the bug from my answer. Looking at [this comment](https://code.google.com/p/android/issues/detail?id=223424#c7) indicates that analytics are disabled by default, which means to me they will still be disabled if writing the `analytics.settings` fails. So if you *want* analytics to be disabled, you are probably fine anyway. – sschuberth Nov 09 '16 at 18:49
  • Thanks. That for guiding me to the right direction. I have Firebase analytics in my project. However it has a `google-services.json` file, where it has a bool to enable/disable analytics. I have it enabled by default. I could find something related to `GoogleAnalytics` but not Firebase. It should almost be the same though. Thanks again! – Shobhit Puri Nov 09 '16 at 19:09
1

on ubuntu here is my solution ... no need to manually create dir ~/.android ... the system will auto create ~/.android once following is issued

see what architectures you currently have defined

dpkg --print-architecture
dpkg --print-foreign-architectures  #  see what you already have

typically on a 64 bit box you do not have 32 bit architecture enabled ... do that now

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386 -y

above will install the necessary 32 bit libraries needed by aapt which is a 32 bit binary bundled in the android tool stack which is failing to execute properly ... now it will

Scott Stensland
  • 26,870
  • 12
  • 93
  • 104