I am trying to create and .apk file of my project but when I am trying to build the project in release mode, it is giving me these errors:
I am using google maps in my project. One of my team member is able to generate it from Mac machine but I am using Windows 8.1 and it is giving me errors. I tried increasing the heap size in system variables but it didn't work for me. Can anyone please help me to find out some solution.
Answers
I found solution on below link and it worked for me :
https://kb.xamarin.com/customer/portal/articles/1661284-why-does-my-xamarin-forms-maps-android-project-fail-with-compiletodalvik-unexpected-top-level-error-
I made following settings as suggested for Xamarin Studio
Right-click the Android project & open the project options.
Go to "Build -> Android Build -> Advanced"
In the Java heap size text box enter 1G.
Rebuild the project.
Changing the heap to 1G did not work for me.
+1 Changing the heap to 1G did not work for me.
+1 Changing the heap to 1G did not work for me.
Rebooting my machine sometimes helps. This issue is annoying and I wish they would fix it.
"Changing the heap to 1G" worked for me before I upgraded Xamarin studio.
I have released a few projects without problems in Dec, 3 2015.
All my projects are broken after uploading a new xamarin studio release.
Just an example:
1. I created a new project - picture #1 - OK
2. Changed Java heap to 1G - as usual
3. Just added a package "xamarin.googleplayservices.ads" - didn't change anything else - picture#2 -
java.exe exited with code 1. I didn't add a line of code to the test project.
"Could not create the Java virtual machine" - it is a hint, but I was not able to figure out the problem.
Most likely I missed something important.
Do we have a way to open a ticket with Xamarin?
Thank you in advance.
Heh, Microsoft thanks! I had 30 days to downgrade the windows 10 to windows 8.1. I just did it. All my projects are back with no errors... No more "java.exe exited with code 1" error messages...
I know it's an old thread but in my case I solved by doing this:
1) Run regedit
2) Go to HKEY_CURRENT_USER
3) Select Environment
4) Add a new String Value and enter _JAVA_OPTIONS for Value name
5) Enter -Xms256m -Xmx512m for Value data
6) Reboot computer
I have same problem Changing the heap not help me
i'm using visual studio xamarin
this problem is happened when
1: update sdk without ndk
2: new api or tools of sdk come but the user do not upgrade jre to same level
3: new release of xamarin not need to change heap to 1G but you must update everything about sdk ndk and xamarin version to last
xamarin not working with sdk 1.9
old xamarin version work with 1.6.39
new xamarin version worked with 1.8.51
Thanks @aunanue
In your Android csproj, do the following:
Make sure you get rid of the following items:
768MB
Ensure DebugType is:
pdbonly
Good luck!
After trying all of the above suggested things, I ended up giving up, uninstalling the JDK and reinstalling it. This fixed my problem. I'm not sure why or what caused it but just in case anyone else has issues.