3

Every time I'm adding an activity or fragment android studio automatically reformat build.gradle file and messes up my dependencies even if nothing have been added.

it's very annoying because every time I have to reverse the changes from my VCS. I've tried to stop disable code formatting as mentioned in this answer without much luck.

Community
  • 1
  • 1
humazed
  • 74,687
  • 32
  • 99
  • 138
  • Make sure to be using ' not " in your compile statements – Chris Nevill Jul 06 '17 at 11:17
  • If using strings I had some success with compile myString + '' where '' is an empty string using commas – Chris Nevill Jul 06 '17 at 11:18
  • 1
    I don't understand exactly what you mean please elaborate more. what exactly do you mean by: Make sure to be using ' not " in your compile statements example please! – humazed Jul 06 '17 at 11:28
  • So I'm assuming you are or were seeing the issue where the compile lines in the build.gradle fine had their line breaks removed - resulting in multiple compile statements on a single line – Chris Nevill Jul 06 '17 at 11:50
  • 1
    As per the answer below this appears to be a bug in Android Studio. I'm saying that by changing for example compile "com.j256.ormlite:ormlite-android:5.0" to compile 'com.j256.ormlite:ormlite-android:5.0' This appears to resolve the issue. – Chris Nevill Jul 06 '17 at 11:52

1 Answers1

2

As far as I know there is no solution to this issue. There's still an open bug on AOSP issue tracker. Make sure you vote for it.

mVck
  • 2,910
  • 2
  • 18
  • 20