Error in Building a Xamarin Project for Android - 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.

Related

Any library to read mdict *.MDX files in android?

I have a .mdx file that infact is a dictionary database (some android apps like bluedict can read its data).
I have used Daemon.tools but it could not open it.
I was looking for any library or sources which helps me to read MDX dictionary files in Java, I have found some resources already such as KnIfER/mdict-java but it does not work in Android Studio (it has errors on accumulation_blockId_tree.xxing(new myCpr(position,1)).getKey().value line and it is connot resolve symbol 'value'). Does any one knows a good source about these files and possible libraries which could be used for it?.
Well, actually this is my java project.
the error mentioned is just a problem of jdk version. you can add <> parentheses after myCpr and convert return of xxing to type myCpr<Integer,Integer> .
But now, I have very much reduced usage of rbtree and use more binary list searching.have a look there.

System can't find specifed path ndkbuild in android

I want to build an ocr app in android.For that i am using tessaract library.I am following this turorial ocr tutoial it says follow below steps
Download the NDK & extract to C:\ drive-Done
Set NDK Path & Android SDK path to PATH variable in Enviorment Variable.-Done
Download tessaract library and extract it to C:-Done
open command line & go inside tessract folder ibn downloaded library.-
Write ndk-build-Not Done
When i write ndk-build it says the system can't find the specified path.
Please tell me how to resolve this issue.I have already spent lot of hard time on this.
Thanks in advance.
If you re-read the link you posted, you may notice this line from the author:
Attention: if you fail at any of the above steps, you are not ready for this shit yet. Better grab an introduction to android development course, read a book, then come back to this tutorial. You’ll just waste time and nerves and you’ll bitch about it in the comments that this crash, this doesn’t work. (PS. no, I will not send you the source code on your email, stop spamming k thx.)
You should seriously consider his advice - working with the Android NDK only gets more difficult from here.
You're probably getting that error message because cmd couldn't find the ndk-build program, which is located inside the root of android-ndk-r10e. Possible causes:
You made an error when editing your PATH variable - make sure each file path is separated by a semicolon and that you provided the full path to your NDK install.
Your PATH is too long - the max length is 260 characters. See this page for more info. tl;dr: prefix \?\ to your PATH to get around this length limit.
You had cmd open when you set the variables - try restarting the cmd
program or even restarting your machine.

missing a command building android kernel

I have been trying to build an android kernel for a certain device, the Huawei Vitria, they finally uploaded their kernel source about 2 months ago so I try to build it the normal way which fails so I fix the main errors I see and get the kernel to build finally but, then I notice one error while building. I look into this file and see that they are using a weird way of building I think instead of the normal defconfigs, using a generic defconfig then a configuration file to configure their devices ontop of that(they've done this before but not to this extent), which leads me to think I'm missing a command to select the device config ontop of the defconfig to set up the drivers, but don't know what command was used.
So might there be a way to find out the command by looking at these two files
https://raw.githubusercontent.com/KainXS/android_kernel_huawei_y301a2/jellybean/drivers/huawei/hsad/parse_product.pl
https://raw.githubusercontent.com/KainXS/android_kernel_huawei_y301a2/jellybean/drivers/huawei/hsad/parse_product_id.pl
thanks
I'm not sure how much help this is, but the first command seems to want to be called with a parameter of a path to an XML file.
./parse_product.pl /ab/cd/hw_xxy_configs.xml
PRODUCT: xxy
reads: '/ab/cd/hw_xxy_configs.xml'
It pulls out some data from that file and pastes it into a .c file which presumably goes into the build configuration.
So, you're looking for an XML file containing your product-name.
The second file calls the first repeatedly to generate a set of .c files. Now - this second script takes an XML file as an argument, but I'm afraid I can't tell what it might be called. The file looks like it should contain product names and board-ids if that is any help.

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!

Can't upload APK due to "The file is invalid: ERROR: dump failed because no AndroidManifest.xml found"

First: I'm not help vampire) I'm fighting with this issue for two days and I'm desperate to find solution. I've googled for the solution all over the inet and none is my case - this is the final stage and it feels hopeless.
To be clear: messing with AndroidManifest.xml doesn't help (no empty or unclosed tags etc). Nor app size issue (official limit is 4GB). Nor browser\system cause tried in FF, Chrome, IE 9 , Win 7, MacOSX SL 10.6.4, from my PC and from remote Server with Win2008 - same error.
Second - I extracted the AndroidManifest.xml from the APK file I submitted successfully (one with 13MB size) and extracted AndroidManifest.xml from the APK I'm trying to submit (yes, it's there! the size of this APK is 50MB) both with same apktool v 1.4.1. I compared the AndroidManifest.xml files with tortoise Diff - and the only difference between them is presence of android:targetSdkVersion="8" attribute in unuploadable APK and of course package name (diff only in .sub of com.mycompany.app.vers.sub - so i guess not a reason for this googlemare I'm having on ).
No way to give up on android:targetSdkVersion="8" - cause it can't be a reason for the error too.
Both APK were created with File -> Export -> Android -> Export Android Application with same keystore and key. I uploaded another app - third one with same AndroidManifest.xml as first one (without android:targetSdkVersion="8") but also of small size - 9MB, nothing bigger works((!
Help - I hate google and android now, almost :)
If you ran into the same problem I did with apktool, then please make sure you download the .jar file along with aapt.exe, that fixed it for me. I was running aapt.exe on an apk and got your above error, but it turns out I should have been running the apktool.bat file. The apktool.bat won't work if the .jar is not in the same directory. Get the jar file here: Android-APKTool
The maximum size of an Android app to be uploaded to Android Market is 50MB. If you're even one byte over this, I believe that the upload will fail. See this blog post for reference.

Categories

Resources