0

I just upgrade to Android studio Gradle Plugin 3.0.1. Very strange thing happens that the character in strings.xml "\r"(ASCII carriage return) shows "r" when running apk. It works correctly in my older Android studio version 2.3.3.

My old buildToolsVersion is "25.0.2" and it has message that Gradle Plugin 3.0.1 supports minimum SDK 26.0.2. So buildToolsVersion is changed to "26.0.2". the source code is the same and i just tested in both sides of my two NB computers.

Is there a way to avoid this? Any suggestion is welcome. I don't want to remove all these "\r" for there're hundreds in 20 languages, and be afraid of other side effect.

Fisher
  • 488
  • 7
  • 24
  • 1
    Why you are using \r in xml, If you want to start new line use \n. Replace \r with unicode – USKMobility Dec 28 '17 at 09:53
  • "\r" is carriage return. I used "\r\n" before and it works fine. Now it shows "r" and new line. I need to know exact setting or compatibility problem to avoid unknown potential risk to release new apk. – Fisher Dec 28 '17 at 12:18

2 Answers2

1

It is because it is escape sequence , if u want to print \r then use \\r , it will display \r in output. Just try this.

0

Cost a few days to search and find no way in settings to avoid this. To change \r to 
 is low-impact, though I got to modify hundreds places.

Fisher
  • 488
  • 7
  • 24