Bug 12628 - Getting 'Deployment Failed. Internal error' when debug/run the application after selecting "Embed assemblies in native code" in Project option
Summary: Getting 'Deployment Failed. Internal error' when debug/run the application af...
Status: VERIFIED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 4.7.x
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2013-06-11 06:35 UTC by Nischal
Modified: 2013-06-21 06:38 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description Nischal 2013-06-11 06:35:46 UTC
Steps to reproduce this issue:
1. Open or create android application.
2. Go to project option->Android Build.
3. Check the option "Embed assemblies in native code"
4. Debug or Run the application.

Actual result: When user debug or Run the application after selecting "Embed assemblies in native code" in project option, Getting error 'Deployment Failed. Internal error'. While this is working fine on Windows 

Expected Result: Application should run successfully after selecting "Embed assemblies in native code" in project option.

Supplement info:
https://gist.github.com/atin360/c81ef576d9b6d223d7cc
http://screencast.com/t/e1K1YjUNfIz

Environment details:
All Mac
X.S 4.0.9(build 3)
Mono 3.0.11
Xamarin.Android 4.7.7-24

Regression Status:
NOT A REGRESSION
Comment 2 Jonathan Pryor 2013-06-11 15:38:14 UTC
@Nischal: Please provide diagnostic build output:

    $ cd path/to/your/project
    $ xbuild /t:Install /p:Configuration=Release /v:diag > build.txt

Then attach build.txt.

The error message is also "interesting":

> Deployment failed because of an internal error:
> Could not find file
> "/Users/nischal/Projects/AndroidApp3/AndroidApp3/bin/Debug/AndroidApp3.AndroidApp3-Signed.apk".

What .apk files, if any, are in /Users/nischal/Projects/AndroidApp3/AndroidApp3/bin/Debug?

I may also need the Xamarin Studio log files for the build.
http://docs.xamarin.com/guides/android/deployment%2c_testing%2c_and_metrics/diagnostics#2.device-deployment-logs
Comment 3 narayanp 2013-06-12 02:35:05 UTC
Today I have checked this issue with following build:

All Mac
X.S 4.0.9(build 3)
Xamarin.Android 4.7.9-1

Diagnostics Build Output: https://gist.github.com/atin360/440692d3ac0258d86295

We are not seeing any .apk file under /Users/nischal/Projects/AndroidApp3/AndroidApp3/bin/Debug
Comment 4 Jonathan Pryor 2013-06-12 10:38:23 UTC
@narayanp: My apologies; `xbuild /t:Install` needs to be run on a .csproj, not a .sln. Thus (using the project from Comment #3):

    $ cd /Users/nischal/Projects/AndroidsA/AndroidsA
    $ xbuild /t:Install /p:Configuration=Release /v:diag *.csproj > build.txt
Comment 5 narayanp 2013-06-12 10:49:47 UTC
I have used this command mentioned in Comment#4 and got the build.txt. This is the gist for the same: https://gist.github.com/atin360/a0db4eb90e7004d9af75
Comment 6 Jonathan Pryor 2013-06-12 11:33:20 UTC
@narayanp: Have you deleted your projects or something? Comment #3 states:

> /Users/nischal/Projects/AndroidsA/AndroidsA/AndroidsA.csproj: Importing project /Library/Frameworks/Mono.framework/External/xbuild/Novell/Novell.MonoDroid.CSharp.targets from extension path /Library/Frameworks/Mono.framework/External/xbuild

Which means that /Users/nischal/Projects/AndroidsA/AndroidsA/AndroidsA.csproj existed (otherwise it wouldn't be mentioned). Yet Comment #5 states:

> MSBUILD: error MSBUILD0000: Project file '*.csproj' not found.

So where did your .csproj go? Are you in the correct directory?
Comment 7 narayanp 2013-06-13 03:21:22 UTC
Sorry I was in wrong directory. I have tried it for another project and got the build.txt. Here is the gist for the same: https://gist.github.com/atin360/8ac15a141fdbd62169de
Comment 8 Jonathan Pryor 2013-06-13 09:22:04 UTC
@narayanp: Build output is incomplete; it ends with:

> Tool /usr//bin/java execution started with arguments

It _should_ end with:

> Build succeeded.
> 	 0 Warning(s)
> 	 0 Error(s)
> 
> Time Elapsed 00:00:18.0276860

(Error and warning count may differ ;-)

Please run my command, redirecting the command output to a file, and provide the full file contents.

Note: FYI, a future XA release will likely be requiring a system Mono 3.0.12.
Comment 9 narayanp 2013-06-13 09:48:39 UTC
I have updated this gist: https://gist.github.com/atin360/8ac15a141fdbd62169de
Comment 10 Jonathan Pryor 2013-06-13 16:35:55 UTC
Thank you.

The problem is that your Android NDK directory is wrong:

> 		Android NDK: /

It is highly unlikely that you installed the Android NDK into /.

Which is why this is produced:

> 		Error: System.IO.DirectoryNotFoundException: Directory '/toolchains' not found.

"The" bug here is that we're not validating the NDK directory, or than checking that it exists.
Comment 11 Jonathan Pryor 2013-06-19 11:46:58 UTC
monodroid/81f16eb3 will now generate an XA5101 error if the Android NDK isn't properly installed instead of the above DIrectoryNotFoundException.
Comment 12 Atin 2013-06-21 06:38:57 UTC
Today, We have checked this issue with following builds:

XS 4.0.9(build 9)
Mono 2.10.12
MFA 4.6.9

Now Application is running successfully after selecting "Embed assemblies in native code" in project option.

Hence marking this as Verified Fixed.