Error(1,1)illegalcharacter #39;ufeff#39; when compiling on android studio(在 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'
错误位置指的是
包 com.bla.blabla;
package com.bla.blabla;
请帮帮我,谢谢
推荐答案
这是与BOM(Byte Order Mark)字符有关的问题.字节顺序标记BOM 是用于定义文本文件字节顺序的 Unicode 字符,位于文件的开头.Eclipse 不允许在文件开头使用此字符,因此您必须删除它.为此,请使用富文本编辑器,例如 Notepad++,并使用编码UTF-8 without BOM"保存文件.这应该可以解决问题.
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'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 android studio 上编译时出现错误(1,1)非法字符 'ufeff'
基础教程推荐
- 如何使用 Java 创建 X509 证书? 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- 降序排序:Java Map 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01