在android studio上编译时出现错误(1,1)非法字符'\ ufeff' [英] Error(1,1)illegalcharacter '\ufeff' when compiling on android studio

查看:917
本文介绍了在android studio上编译时出现错误(1,1)非法字符'\ ufeff'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Eclipse项目源代码(我被告知在Android Studio上,也许他们只是混淆了),我开始将代码迁移到android studio指的是

I got an Eclipse project source code(I was told that on Android Studio, maybe they just confused), and I start to migrating the code to android studio refers to

http://developer.android.com/sdk /installing/migrate.html

但它不起作用。
所以我直接从路径导入项目并自动转移到android-studio项目,但是当我编译时仍然有问题。

But it doesn't work. so I import the project from path directly and it transfers to the android-studio project automatically, but still, something wrong when I am compiling.


错误:(1,1)错误:非法字符:'\ ufeff'

Error:(1, 1) error: illegalcharacter: '\ufeff'

错误位置是指


package com.bla.blabla;

package com.bla.blabla;

请帮助我,谢谢

推荐答案

这是与BOM(字节顺序标记)字符相关的问题。 字节顺序标记
BOM是一个Unicode字符,用于定义文本文件字节顺序,并在文件的开头。 Eclipse不允许在文件开头使用此字符,因此您必须将其删除。为此,请使用富文本编辑器(如Notepad ++),并使用无BOM的UTF-8编码保存文件。这应该可以消除这个问题。

That's a problem related to BOM (Byte Order Mark) character. Byte Order Mark BOM is a Unicode character used for defining a text file byte order and comes in the start of the file. Eclipse doesn't allow this character at the start of your file, so you must delete it. For this purpose, use a rich text editor, such as Notepad++, and save the file with encoding "UTF-8 without BOM." That should remove the problem.

这篇关于在android studio上编译时出现错误(1,1)非法字符'\ ufeff'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆