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
Above are great solutions. However, if none of them works, try this one:
Open the file in Notepad++; Copy everything; Create a new file with the same name; Paste everything; Save it.
Now it is gone.
OPEN LOOPView.java File First
Convert Your UTF8 To ISO 8859-1 TO Solve your problem In andorid Studio
If UTf-8 not show in android studio bottom bar then ctl+shift+n open LoopView Class then so Bottom Bar
Note ISO-8859-1 Use this
If your error not resolved then Invalidate cache and Restart again and
gradlew clean npm start -- --reset-cache react-native run-android react-native run-ios
Solve Your issue permenantly
One Other Thing if issue still persist then com.wheel file copy into notepad++ and again copy and paste in your project
android {
compileOptions.encoding = 'ISO-8859-1'
}
In React-native change in index.js / android/index.js
import PropTypes from 'prop-types';
I was facing this error in intelliJ-2016.1.2.
Thank you @Darsh for your help, I did same thing, first changed to UTF-16 (i.e convert into UTF-16) and compiled the code. it didn't work, then again changed back to the UTF-8, this time it worked fine.
Thank you.
You can try to this method:
- Rename the class like class1.java
- Create a new class some renamed class like class.java
- Select all contain renamed file and copy into the new class.
This method work for me.
I tried several of the other answers here with no joy.
In the end I simply deleted the offending line and rewrote it directly into Android Studio
. The error disappeared.
Was this caused by me copying and pasting the line of code from youtube (or whatever random blog I was looking at at the time)?
Close android studio and reopen it. It works for me. Furthermore this could happen if you are copying a comment from youtube for example and pasting it into your project