Unity3D build error : Failed to compile resources - android

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? -> �

Related

Error in Building a Xamarin Project for Android

I have downloaded a sample project from here: https://learn.microsoft.com/it-it/samples/xamarin/xamarin-forms-samples/webservices-azurenotificationhub/
In the building I got the error:
Failed to create JavaTypeInfo for class: Android.Support.V4.View.Accessibility.AccessibilityManagerCompat/IAccessibilityStateChangeListenerImplementor due to MAX_PATH: System.IO.DirectoryNotFoundException:
I use Visual Studio 2019.
Thank you in advance,
Piero Sbressa
So this is definitely related to the MAX_PATH problem on Windows. This is a long dicussion about this here . Hopefully according to microsoft support team they are planing solve this issue and removing MAX_PATH as limit.
I would suggest to move your project to a "shorter" path.
I did not found an alternative. You can follow the discussion, hopefully they fix this issue.
I got the same exception, when I built the mobile application first. Error code was XA4209 and suggested to: The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
After I changed the number of characters in the path, everything worked fine.
you can do a number of things ,
best to move the directory closer to root say your drive name is C the closer to "c:" the shorter the path the less likely this error will appear.
you could change the output path to be in a folder with shorter path , u find that in android project properties > build > output path
you can also change one of the parent folders name to be shorter , in my case i had a path 261 character long, i litteraly deleted one letter in a parent folder and fixed the issue.

Proguard 6 new "-android" option

Proguard 6 is out since February and provides some new features, among which the -android option
"A new option -android, to tune the optimizations for Android"
I would like to know more about this option, to understand what it really does in terms of optimization (& possibly obfuscation).
I search on guardsquare.com and Googled for it: I could only find a dead link about android on this page. Here is the link:
> android <- dead link
Target the processed class files at Android.
Where can I find clear and detailed explanations about this new option?
Thanks
I search on guardsquare.com and Googled for it: I could only find a dead link
We can always look at source code!
First, I downloaded a snapshot 6.3.3 sources from Sourceforge repository page.
After unpacking:
grep -R android core/src/ | wc -l
27
Only 27 mentions of 'android'. Let's go over the list:
maximum.inlined.code.length is set to 32 for Android — 4 times as much as JVM default
Additional inlining during some optimization stages (previously didn't work on Android, because it does not use preverification)
Replacing references to FloatMath with Math (not really that important of optimization...)
Resource charset set to UTF-8 (instead of system default charset)
Some legacy code for compatibility with Android Gradle plugin
ConfigurationLogger — as explained in documentation, "This class can be injected in applications to log information about reflection being used in the application code". The class supports Android-specific logging framework (aka android.util.Log)
5 and 6 aren't even related to the command-line -android option, — just some extra code, relevant for Android users.

Android kernel compile error gcc6 linaro 6

I'm trying to compile using Linaro 6 and I'm receiving this error which I believe have something do do with GCC 6? I'm very amateur with compiling kernels or coding for that matter, but I couldn't figure this out even search similar terms:
CC drivers/iommu/msm_iommu-v1.o
In file included from include/linux/io.h:22:0,
from drivers/iommu/msm_iommu-v1.c:20:
drivers/iommu/msm_iommu-v1.c: In function '__program_context':
drivers/iommu/msm_iommu_hw-v1.h:78:31: warning: result of '16777215 << 14' requires 39 bits to represent, but 'int' only has 32 bits [-Wshift-overflow=]
error, forbidden warning: msm_iommu_hw-v1.h:78
scripts/Makefile.build:308: recipe for target 'drivers/iommu/msm_iommu-v1.o' failed
this is my GitHUB:
https://github.com/mykesorrel/surnia_kernel
Looks like a bug with that iommu driver. It's trying to do a bit-shift into an int instead of a long, an int doesn't have enough bits to complete the operation. I'm guessing the -Wno-error isn't used, so all warnings are treated as errors.
This question will help you: How to compile without warnings being treated as errors?
What I personally do is update CFLAGS in my .bashrc (Assuming you're using Linux). This is what I use:
# Ensure C builds don't fail on warnings
export CFLAGS="-Wno-error"
export CXXFLAGS="-Wno-error"

ERROR: '__NDK_FPABI__' does not name a type

While compiling native code-base, I'm getting the following error -
<NDK-HOME>/platforms/android-17/arch-arm/usr/include/jni.h:235:68: error: expected ';' at end of member declaration
<NDK-HOME>/platforms/android-17/arch-arm/usr/include/jni.h:235:70: error: '\__NDK_FPABI__' does not name a type
...
With tons of repetitions.
Platform related details are as below -
Native OS: Windows 7 (64 bit) with Cygwin64
NDK Version: r9c
A similar problem has been reported here. However, even after modifying LOCAL_CFLAGS, I couldn't find the intermediate files as suggested.
Was wondering if some of you have faced this problem already and if so, do you guys have a work-around for this?
Alright, finally got rid of these __NDK_FPABI__ errors and my native code compiled just fine. Indeed, there were subtle hints in the intermediate files (*.i and *.ii) as suggested by Andrew in the link on my previous post; these are usually related to finding appropriate headers. Once relevant changes were made, things worked like a charm.
Few things I learned while debugging this issue -
The problem was related to header files. Certain headers were being picked up from /usr/include which otherwise should have been picked up from $NDK_HOME/platform/$ANDROID_VERSION/$ARCH/usr/include. Making necessary changes in the Android makefile fixed the issue for me.
Always resist the temptation of adding hot-fixes to NDK files. This will make your life a lot easier in the long run.
One should look for the intermediate files (*.i, *.ii, *s and few others) in $PROJECT_ROOT, instead of $PROJECT_ROOT/jni (assuming native code lies there).
The latest release of NDK, namely ndk-r9d fixes some of the issues with __NDK_FPABI__ related errors.
Hope this helps!

Too many methods error

Apparently I have too many apache poi jars which return too many methods and go above the limit when I try to read and write an xlsx file. Below is the error I get
trouble writing output: Too many methods: 66024; max is 65536. By package:
13 java.lang
1 java.lang.reflect
5 java.util
1 javax.xml.namespace
66 org.apache.xmlbeans
19 org.apache.xmlbeans.impl.values
1 org.apache.xmlbeans.impl.xb.xmlschema
2500 org.openxmlformats.schemas.drawingml.x2006.chart
1430 org.openxmlformats.schemas.drawingml.x2006.chart.impl
8767 org.openxmlformats.schemas.drawingml.x2006.main
5258 org.openxmlformats.schemas.drawingml.x2006.main.impl
86 org.openxmlformats.schemas.drawingml.x2006.picture
33 org.openxmlformats.schemas.drawingml.x2006.picture.impl
Is there a way around this? I don't want to delete any libraries and yet my project is not compiling. Please help.
Found the issue!
It's Apache POI's XSSF incompatibility with Android! Actually Apache is pretty okay but when Android converts your Java code into Dalvik Executable files it has a method limit of 65536 which the libraries of Apache POI when they handle XSSF exceed. Hence the error. It has nothing to do with lines. :) I had only 75 rows and 7 columns. More information on this can be found at http://mail-archives.apache.org/mod_mbox/poi-dev/201110.mbox/%3CCA+JOeWNWinmNmEtHs5VK+KEc_6BzAG_=LfpdXqsDsnjJKR2X7Q#mail.gmail.com%3E.
short answer:
just remove the unnecessary jar files. e.g. from the list you gave, I saw there are '8767' methods from org.openxmlformats.schemas.drawingml.x2006.main , if it's not necessary, just remove this jar file and you life will be easier.
Detailed answer:
On titanium official Jira , this bug is still "reopened", created 1 year ago. I don't think they are releasing a new version tomorrow. ( https://jira.appcelerator.org/browse/TIMOB-18082 )
Removing the unnecessary jar files will cause the runtime error, however, since they are unnecessary, runtime error won't occur without them.
read the comments, also refer to here: ADT: fail to build when there are too many packages and classes
and here: Can we create multi dex support builds in Titanium android?

Categories

Resources