I have build.xml and when i try to use ant
d:\project_foldr\ant all
in cmd,I get
BUILD FAILED
Error reading project file d:\project_foldr\build.xml: Invalid byte 1 of 1-byte utf-8 sequence.
I googled this and got that the document isn't actually encoded in UTF-8,How can I rectify this?
Use a suitable editor, e.g. Notepad++. Here you can convert between several encodings. It seems that your file contains some 'special' characters (non ascii, like "ü") and is saved in some local encoding and not as utf8. Make sure that in your editor utf8 is the default encoding for all Java/ant files.
Related
I use UltimateMobile plugin and uniwebview plugin ,maybe they are conflict.
when I build ,Unity3d console say :
Failed to compile resources with the following parameters:
-bootclasspath
"C:/Program Files/Java/android-sdk-windows\platforms\android-27\android.jar" -d
"C:\Game\3drq\superblocks\Temp\StagingArea\bin\classes"
-source 1.6 -target 1.6 -encoding UTF-8
"android\support\v4\Manifest.java"
"android\support\v4\R.java"
"com\cheerflame\superblocks\Manifest.java"
"com\cheerflame\superblocks\R.java"
"com\google\android\gms\Manifest.java"
"com\google\android\gms\R.java"
"com\google\android\gms\ads\Manifest.java"
"com\google\android\gms\ads\R.java"
"com\google\android\gms\ads\impl\Manifest.java"
"com\google\android\gms\ads\impl\R.java"
"com\google\android\gms\analytics\Manifest.java"
"com\google\android\gms\analytics\R.java"
"com\google\android\gms\appinvite\Manifest.java"
"com\google\android\gms\appinvite\R.java"
"com\google\android\gms\auth\Manifest.java"
"com\google\android\gms\auth\R.java"
"com\google\android\gms\auth\api\Manifest.java"
"com\google\android\gms\auth\api\R.java"
"com\google\android\gms\base\Manifest.java"
"com\google\android\gms\base\R.java"
"com\google\android\gms\drive\Manifest.java"
"com\google\android\gms\drive\R.java"
"com\google\android\gms\games\Manifest.java"
"com\google\android\gms\games\R.java"
"com\google\android\gms\gcm\Manifest.java"
"com\google\android\gms\gcm\R.java"
"com\google\android\gms\iid\Manifest.java"
"com\google\android\gms\iid\R.java"
"com\google\android\gms\plus\Manifest.java"
"com\google\android\gms\plus\R.java"
"com\stansassets\androidnative\Manifest.java"
"com\stansassets\androidnative\R.java"
"com\stansassets\billing\Manifest.java"
"com\stansassets\billing\R.java"
"com\stansassets\googleplay\Manifest.java"
"com\stansassets\googleplay\R.java"
"com\stansassets\mnp\Manifest.java"
"com\stansassets\mnp\R.java"
"com\stansassets\social\Manifest.java"
"com\stansassets\social\R.java"
����: C:\Program Files\Java\android-sdk-windows\platforms\android-27\android.jar(java/lang/Object.class):
���汾 52 �� 51 ��, �˱�����֧�����µ����汾�����������˱�������
����: C:\Program Files\Java\android-sdk-windows\platforms\android-27\android.jar(java/lang/String.class):
���汾 52 �� 51 ��, �˱�����֧�����µ����汾��
���������˱�������
����:
C:\Program Files\Java\android-sdk-windows\platforms\android-27\android.jar(java/lang/AutoCloseable.class):
���汾 52 �� 51 ��, �˱�����֧�����µ����汾��
���������˱�������
3 ������
why there are so many messy code?
I build the project in another computer,it's fine and can be built to a apk file.
I don't understand ,please help me. thanks !
You should downgrade to JDK 8. According to this SO answer which has a similar error message to your question:
As of Unity 2017, Unity is incompatible with JDK 9. You need to
continue to use JDK 1.8 for the time being.
(Note: there is also an active issue on the Unity Issue Tracker for JDK 9 that seems to be related. It's not the exact same error message, but others are commenting there with your error message as well.)
(EDIT: The question's error message shows "android-27", so this may not be the actual solution. I'm leaving this here for now as a solution attempt, and because one of the most common reasons for this error message, in general, is the JDK version.)
(Also, to give one possible explanation for "why there are so many messy code?": the little question mark with the black box has to do with strings and character encodings. It likely has something to do with the asker's computer language being set to another language like Chinese. I'm not sure about the exact cause in this case, but see The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!) for more background information about the black box question mark characters:
And in fact now that you’re thinking of things in terms of platonic
ideal letters which are represented by Unicode code points, those
unicode code points can be encoded in any old-school encoding scheme,
too! For example, you could encode the Unicode string for Hello
(U+0048 U+0065 U+006C U+006C U+006F) in ASCII, or the old OEM Greek
Encoding, or the Hebrew ANSI Encoding, or any of several hundred
encodings that have been invented so far, with one catch: some of the
letters might not show up! If there’s no equivalent for the Unicode
code point you’re trying to represent in the encoding you’re trying to
represent it in, you usually get a little question mark: ? or, if
you’re really good, a box. Which did you get? -> �
I am retrieving Logcat of Android device from command line by using adb logcat command. I have no idea of Android device logs encoding (actually trying to find this information for last 3 months) - as there can be many languages in device logs e.g Chinese, Japanese, Arabic or special characters like Emoji or © and more.
My Python3 script looks as follows:
import subprocess
ADB_LOCATION = "/Users/F1sherKK/Library/Android/sdk/platform-tools/adb"
ADB_DEVCE = "-s emulator-5554"
ADB_LOGCAT = "logcat"
LOGCAT_MONITOR_CMD = "{} {} {}".format(ADB_LOCATION, ADB_DEVCE, ADB_LOGCAT)
with subprocess.Popen(LOGCAT_MONITOR_CMD, shell=True,
stdout=subprocess.PIPE, bufsize=1,
universal_newlines=True, encoding='utf-8') as p:
for line in p.stdout:
line_cleaned = line.strip()
# do something with Logcat line
But at some point this line crashes:
for line in p.stdout:
With following error:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position
89: invalid start byte
I am not sure anymore where is the error. I think that I am using wrong encoding as I don't know encoding of Android Logcat. Tried various common encodings like UTF-32, UTF-16 or ASCII but it always crashes.
How to fix this or at least make partially work - e.g. make it ignore characters it cannot decode?
Better late than never:
The "problem" is that you have non-decodable bytes in the logcat output. There's nothing wrong from the Python perspective, it's just invalid data.
As far as I can tell, adb logcat output should never be non-decodable bytes. If you're seeing bytes that can't be decoded by UTF-8, then your logcat data is probably just corrupt and your best bet is to clear it and try again:
$ adb logcat -c
I am doing some reverse engineering to get the .dll of a game.
I have tried following the instruction to decrypt the assembly-Csharp.dll using gcore but when I try to open the file and recover it on winhex it says
"9 file headers were found but 0 files were retrieved"
Is there any useful software you guys know?
I am trying to write an errorformat to detect errors when compiling android applications using the new gradle build system (http://tools.android.com/tech-docs/new-build-system).
errorformat=%f:%l:\ error:\ %m
This errorformat catches the XML errors but in gradle the filename that comes in the output is not the original source filename, instead it is a temporary build file:
/home/user/Studio/myapp/build/res/all/debug/layout/add_child_dialog.xml:7: error: Error parsing XML: unbound prefix
The original source file is:
/home/user/Studio/myapp/res/layout/add_child_dialog.xml:7: error: Error parsing XML: unbound prefix
As you can see the error shows a file inside the build folder and it contains the build type (debug) in it.
I read the quickfix-window help and found ways to modify the quickfix output using the QuickfixCmdPost and quickfix BufReadPost auto-commands but these take effect after the quickfix window is parsed by the errorformat. As result I can see the correct source file on the quickfix window but vim still jumps to the wrong file.
Is there a way to modify the file (%f) after it is parsed by errorformat?
Is there a way to tell gradle to print the original source file and not the build one?
You could either transform the quickfix list on QuickFixCmdPost (using getqflist() and setqflist(), with the correct file in the filename attribute), or append a script to 'makeprg' that transforms the output (e.g. using sed).
But I agree with you that the tool output is wrong and should be fixed (to state the original files, not temporary copies), instead of working around this in Vim.
I'm trying to analyse compiled Dalvik code, but I found a problem. Here is a specification of .dex format. I can get header of the file, but I couldn't understand what is going on next - when I use dexdump I have classes right next to header:
class_defs_off : 61836 (0x00f18c)
data_size : 368612
data_off : 72312 (0x011a78)
Class #0 header:
class_idx : 62
access_flags : 1536 (0x0600)
But when I look at my bytecode there is something other. I can't understand what going next to header. According to specification it is string_idi's, but I'm not sure. What is the real structure of .dex files?
Baksmali can dump the contexts of an existing dex file, in a format similar to the hex dump of dx. (The advantage is that it can dump an existing dex file)
baksmali classes.dex -D out.dump
The spec you refer to does in fact accurately portray how dex files are structured. (Note: I wrote that document.)
Dexdump doesn't output the full contents of a dex file in order, which explains some of your confusion. The dx tool can output an annotated listing of dex file contents when it generates a dex file. You might find this useful. Sorry, I don't remember the options offhand, but it'll be something like --dex --dump-to=file.txt --dump-bytes.
I hope this helps.