Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xamarin Android error MSB6006: "java.exe" exited with code 1 #40

Open
rogerskk opened this issue Apr 14, 2022 · 2 comments
Open

Xamarin Android error MSB6006: "java.exe" exited with code 1 #40

rogerskk opened this issue Apr 14, 2022 · 2 comments

Comments

@rogerskk
Copy link

rogerskk commented Apr 14, 2022

After adding the Geofence plugin 1.8.11 to my project I started getting the error "java.exe" exited with code 1 for the Xamarin Android project when trying to build. I remove it and then it builds and runs in the emulator just fine. I am using Visual Studio 2022 Preview 17.2.0 Preview 3.0, and building for Android 12.0 - API 31. I have the latest version of Java installed (18). I tried compiling in Visual Studio 2019, which succeeds - but when trying to debug in the Emulator I get the following error (including stack trace). I don't care which version of Visual Studio I use, I just want to be able to get it to work in at least one of them. And no my package name does not start with a capital letter. Also in VS 2019 to fix the issue below, I tried adding Exported=true in the Activity annotation but got the following error System.InvalidOperationException: Duplicate attribute - which from what I've read online is a bug in VS 2019 and can only find a fix for it in VS 2022.

Severity Code Description Project File Line Suppression State
Error ADB0010: Mono.AndroidTools.InstallFailedException: Unexpected install output: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl1873278123.tmp/base.apk (at Binary XML file line #56): crc64c554f6b6abc76285.GeofenceBootReceiver: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present]

at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) in D:\a_work\1\s\External\androidtools\Mono.AndroidTools\Internal\AdbOutputParsing.cs:line 350
at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass100_0.b__0(Task1 t) in D:\a\_work\1\s\External\androidtools\Mono.AndroidTools\AndroidDevice.cs:line 803 at System.Threading.Tasks.ContinuationTaskFromResultTask1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at AndroidDeviceExtensions.d__12.MoveNext() in D:\a_work\1\s\External\androidtools\Xamarin.AndroidTools\Devices\AndroidDeviceExtensions.cs:line 206
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at AndroidDeviceExtensions.d__12.MoveNext() in D:\a_work\1\s\External\androidtools\Xamarin.AndroidTools\Devices\AndroidDeviceExtensions.cs:line 223
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Xamarin.Android.Tasks.FastDeploy.d__101.MoveNext() in /Users/builder/azdo/_work/1/s/xamarin-android/external/monodroid/tools/msbuild/Tasks/FastDeploy.cs:line 338
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Xamarin.Android.Tasks.FastDeploy.d__101.MoveNext() in /Users/builder/azdo/_work/1/s/xamarin-android/external/monodroid/tools/msbuild/Tasks/FastDeploy.cs:line 355
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Xamarin.Android.Tasks.FastDeploy.d__96.MoveNext() in /Users/builder/azdo/_work/1/s/xamarin-android/external/monodroid/tools/msbuild/Tasks/FastDeploy.cs:line 212 0

@evan-masseau
Copy link

I just encountered this issue too, after bumping my target version up. The problem is services and receivers need to have "exported" set explicitly now, and I can't figure out a way to make that modification myself, I think it needs to be fixed in this project.

@dhewitson
Copy link

I'm seeing this too. The issue lies with the GeoFenceBootReceiver.

It uses the BOOT_COMPLETED intent-filter, so needs [Service(Exported = true)] attribute added to the class.

There's no manual way to update the android manifest to do this so must be done in this package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants