Reputation: 11863
I'm compiling using android tools without eclipse.
I compile launching "ant debug" from command line.
I have found many many instructions around the web about how to remove with annoying warning, but I haven't been able to make any of them work.
I've tried -D option, I've tried randomly tweaking build.* files, I've tried exporting an environment variable... nothing.
I guess some of these methods just don't work, and some others would work but I've been doing them incorrectly. Anything is possible and I can't stand it any more: any advice on how to do it?
Upvotes: 3
Views: 3946
Reputation: 21
Anyone who is looking for a solution, setting the following in the gradle.properties
solved it for me.
org.gradle.jvmargs='-Dfile.encoding=UTF-8'
Upvotes: 0
Reputation: 808
While it is certainly possible to tweak the system defaults in the Android SDK, such attempts may lead to unpredicted and non-standard behaviour of ANT. Some other bit of the system may expect the default behaviour of ANT or an update will undo your changes. Also if you attempt to compile the project on a different system such as a build server or a team member's computer, you will need to remember to tweak every system involved. As such system tweaks should be avoided and are not recommended.
ANT build process accepts per project overrides for system wide defaults. While it does require an additional file for every project, it is likely to give more consistent build behaviour on all development platforms and ease development, diagnostics and maintenance.
I am using ANT 1.8.4 and providing a build.properties file as suggested by Whome didn't work for me but it is a step in the right direction. I had to create an ant.properties
file (for every project) and provide overrides just as Whome suggested.
It is however a bad idea to provide these overrides in any other file, such as local.properties
or build.xml
files. These files are created and modified by the android tool.
I do recommend the reader to read the build.xml
file as it is well documented and provides excellent hints and instructions on how to use the Android ANT build system.
The next interesting bit of reading is the root ANT build script located in android-sdk/tools/ant/build.xml
. This file will list all overridable properties such as:
java.target=1.6
verbose=true
But the encoding is set just as it was previously suggested by Whome:
## Override default ANT properties
java.encoding=ISO-8859-1
Upvotes: 1
Reputation: 10400
I have android-10 SDK kit, this is how I fixed an encoding warning while building a project. * create c:/myproject/build.properties file * override default ANT variables
## Override default ANT properties
java.encoding=ISO-8859-1
Upvotes: 1
Reputation: 89
For the swedish character set, I did as fhucho suggested. But I had to use ISO-8859-1 instead of UTF-8. So maybe it is better to use ISO encodings instead.
Upvotes: 0
Reputation: 34560
I had the same problem. This is how I solved it:
When I launch ant release
, there is this line in the output: [setup] Importing rules file: tools/ant/ant_rules_r3.xml
. I edited ant_rules_r3.xml
and replaced "ascii" with "UTF8".
Upvotes: 3