Embeddinator-4000 icon indicating copy to clipboard operation
Embeddinator-4000 copied to clipboard

Embeddinator runs without errors, still no aar file

Open MarcK95 opened this issue 4 years ago • 12 comments

Steps to Reproduce

I created a test project like its described here https://docs.microsoft.com/en-us/xamarin/tools/dotnet-embedding/get-started/java/android

I installed Embeddinator as nuget

I tried all methods of building an aar file like its described here https://docs.microsoft.com/en-us/xamarin/tools/dotnet-embedding/get-started/install/install

I get no positive result in any of these possibilities

Expected Behavior

Should generate aar file inside output folder

Actual Behavior

generates a bunch of files but no aar

Environment

Win10 64bit, VS19 (16.4.6)

Logs

WHEN USING COMMAND LINE WITHOUT -c Embeddinator-4000.exe -gen=Java --platform=Android -out=Foo bin\Debug\hello-from-csharp.dll -v

Pass 'Embeddinator.Passes.CheckDeclarations'
    Found forbidden property name: Java_Lang_Object_Class
Pass 'CppSharp.Passes.CaseRenamePass'
Pass 'Embeddinator.Passes.InterfacesPass'
Pass 'Embeddinator.Passes.CheckReservedKeywords'

Generating binding code... Generated: hello_from_csharp\hellofromcsharp\Class1.java Generated: hello_from_csharp\hellofromcsharp\Resource.java Generated: hello_from_csharp\hellofromcsharp\Animation.java Generated: hello_from_csharp\hellofromcsharp\Attribute.java Generated: hello_from_csharp\hellofromcsharp\Boolean.java Generated: hello_from_csharp\hellofromcsharp\Color.java Generated: hello_from_csharp\hellofromcsharp\Dimension.java Generated: hello_from_csharp\hellofromcsharp\Drawable.java Generated: hello_from_csharp\hellofromcsharp\Id.java Generated: hello_from_csharp\hellofromcsharp\Integer.java Generated: hello_from_csharp\hellofromcsharp\Layout.java Generated: hello_from_csharp\hellofromcsharp\String.java Generated: hello_from_csharp\hellofromcsharp\Style.java Generated: hello_from_csharp\hellofromcsharp\Styleable.java Generated: hello_from_csharp\Native_hello_from_csharp.java Generated: mscorlib\system\IDisposableImpl.java Generated: mscorlib\system\IDisposable.java Generated: mscorlib\Native_mscorlib.java Generating Java stubs... Key HKCU\SOFTWARE\Novell\Mono for Android\AndroidSdkDirectory found: Path contains adb in \platform-tools (C:\Program Files (x86)\Android\android-sdk). Key HKCU\SOFTWARE\Novell\Mono for Android\AndroidNdkDirectory found: Path contains ndk-stack in . (C:\Users\UserName\AppData\Local\Android\Sdk\ndk-bundle). Key HKCU\SOFTWARE\Novell\Mono for Android\JavaSdkDirectory found: Path contains jarsigner.exe in \bin (C:\Program Files\Java\jdk-14). Invoking: C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /nologo /verbosity:minimal C:\Users\UserName\Documents\projects\hello\hello-from-csharp\hello-from-csharp\Foo\GenerateJavaStubs.proj

This runs without errors, but there is still no aar file generated in the output folder

WHEN USING COMMAND LINE WITH -c Embeddinator-4000.exe -gen=Java --platform=Android -out=Foo bin\Debug\hello-from-csharp.dll -v -c

Pass 'Embeddinator.Passes.CheckDeclarations'
Pass 'Embeddinator.Passes.FixMethodParametersPass'
Pass 'Embeddinator.Passes.CheckReservedKeywords'

Generating binding code... Generated: hello-from-csharp.h Generated: hello-from-csharp.c Generated: Mono.Android.h Generated: Mono.Android.c Generated: Java.Interop.h Generated: Java.Interop.c Generated: mscorlib.h Generated: mscorlib.c Generated: c-support.c Generated: c-support.h Generated: embeddinator.h Generated: glib.c Generated: glib.h Generated: mono-support.c Generated: mono-support.h Generated: mono_embeddinator.c Generated: mono_embeddinator.h Compiling binding code... Key HKCU\SOFTWARE\Novell\Mono for Android\AndroidSdkDirectory found: Path contains adb in \platform-tools (C:\Program Files (x86)\Android\android-sdk). Key HKCU\SOFTWARE\Novell\Mono for Android\AndroidNdkDirectory found: Path contains ndk-stack in . (C:\Users\UserName\AppData\Local\Android\Sdk\ndk-bundle). Key HKCU\SOFTWARE\Novell\Mono for Android\JavaSdkDirectory found: Path contains jarsigner.exe in \bin (C:\Program Files\Java\jdk-14).

Unhandled Exception: System.Exception: Unable to find NDK toolchain for Arm! at Xamarin.Android.Tasks.NdkUtil.GetNdkClangBin(String toolchainsPath, AndroidTargetArch arch) at Embeddinator.Driver.CompileNDK(IEnumerable1 files) at Embeddinator.Driver.CompileNativeCode(IEnumerable1 files) at Embeddinator.Driver.CompileCode() at Embeddinator.Driver.Run() at Embeddinator.CLI.Main(String[] args)

WHEN USING MSBUILD TARGETS

The command "set K_OUTPUT='C:\Users\UserName\Documents\projects\hello\hello-from-csharp\output' if exist K_OUTPUT% rmdir /S /Q K_OUTPUT% 'C:\Users\UserName\Documents\projects\hello\hello-from-csharp\packages\Embeddinator-4000.0.2.0.80\tools\Embeddinator-4000.exe' 'C:\Users\UserName\Documents\projects\hello\hello-from-csharp\hello-from-csharp\bin\Debug\hello-from-csharp.dll' --gen=Java --platform=Android --outdir=K_OUTPUT% -c" exited with code 123

WHEN USING POST-BUILD STEPS

The command "set E4K_OUTPUT="C:\Users\UserName\Documents\projects\hello\hello-from-csharp\output" if exist %E4K_OUTPUT% rmdir /S /Q %E4K_OUTPUT% "C:\Users\UserName.nuget\packages\Embeddinator-4000\0.4.0\tools\Embeddinator-4000.exe" "C:\Users\UserName\Documents\projects\hello\hello-from-csharp\hello-from-csharp\bin\Debug\hello-from-csharp.dll" --gen=Java --platform=Android --outdir=%E4K_OUTPUT% -c" exited with code -532462766

MarcK95 avatar Mar 24 '20 09:03 MarcK95

Could you run C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /nologo C:\Users\UserName\Documents\projects\hello\hello-from-csharp\hello-from-csharp\Foo\GenerateJavaStubs.proj

Remove the /verbosity:minimal code from msbuild command.

lindexi avatar Apr 08 '20 11:04 lindexi

https://github.com/jamesmontemagno/embeddinator-hellosharedui/issues/3

lindexi avatar Apr 09 '20 01:04 lindexi

I ran the command you mentioned with the following result:

Build` started 09.04.2020 09:02:40.
Project "C:\Users\UserName\Documents\projects\hello\hello-from-csharp\hello-from-csharp\Foo\GenerateJavaStubs.proj" on node 1 (default targets).
Build:
  Copying file from "C:\Users\UserName\Documents\projects\hello\hello-from-csharp\hello-from-csharp\Foo\obj\lp\hello-from-csharp\jl\res\layout\hello.xml" to "C:\Users\UserName\Documents\projec
  ts\hello\hello-from-csharp\hello-from-csharp\Foo\android\res\layout\hello.xml".
  Copying file from "C:\Users\UserName\Documents\projects\hello\hello-from-csharp\hello-from-csharp\Foo\obj\lp\hello-from-csharp\jl\res\values\strings.xml" to "C:\Users\UserName\Documents\proj
  ects\hello\hello-from-csharp\hello-from-csharp\Foo\android\res\values\strings.xml".
  Made 1 replacement(s).
  Made 2 replacement(s).
  Made 2 replacement(s).
Done Building Project "C:\Users\UserName\Documents\projects\hello\hello-from-csharp\hello-from-csharp\Foo\GenerateJavaStubs.proj" (default targets).


Build succeeded.
    0 Warning(s)
    0 Error(s)

I didn't get what you mean with this:

yes, remove the /verbosity:minimal code

MarcK95 avatar Apr 09 '20 07:04 MarcK95

@MarcKammermann I find the old issus : https://github.com/jamesmontemagno/embeddinator-hellosharedui/issues/3

And the msbuild output is without any error but still no arr file. This is a confusing question

lindexi avatar Apr 09 '20 07:04 lindexi

I ran the command you mentioned with the following result:

Build` started 09.04.2020 09:02:40.
Project "C:\Users\UserName\Documents\projects\hello\hello-from-csharp\hello-from-csharp\Foo\GenerateJavaStubs.proj" on node 1 (default targets).
Build:
  Copying file from "C:\Users\UserName\Documents\projects\hello\hello-from-csharp\hello-from-csharp\Foo\obj\lp\hello-from-csharp\jl\res\layout\hello.xml" to "C:\Users\UserName\Documents\projec
  ts\hello\hello-from-csharp\hello-from-csharp\Foo\android\res\layout\hello.xml".
  Copying file from "C:\Users\UserName\Documents\projects\hello\hello-from-csharp\hello-from-csharp\Foo\obj\lp\hello-from-csharp\jl\res\values\strings.xml" to "C:\Users\UserName\Documents\proj
  ects\hello\hello-from-csharp\hello-from-csharp\Foo\android\res\values\strings.xml".
  Made 1 replacement(s).
  Made 2 replacement(s).
  Made 2 replacement(s).
Done Building Project "C:\Users\UserName\Documents\projects\hello\hello-from-csharp\hello-from-csharp\Foo\GenerateJavaStubs.proj" (default targets).


Build succeeded.
    0 Warning(s)
    0 Error(s)

I didn't get what you mean with this:

yes, remove the /verbosity:minimal code

Same problem

andrejs-mamontovs avatar May 01 '20 13:05 andrejs-mamontovs

Same here… Is this project still actively being maintainted? 👀

robinwit avatar May 25 '20 13:05 robinwit

Same here… Is this project still actively being maintainted? 👀

I doubt it. You just have to check the commits and see that its so long since they made a fix and not to count the documentation is as old as 3 years at least (referencing VS2017) not to count the 100+ issues without resolving.

Raykud avatar Aug 14 '20 01:08 Raykud

Downgrading NDK to v14 helped in overcoming this. The project isn't updated for the latest NDKs

Harishez avatar Oct 21 '20 10:10 Harishez

@lindexi Faced this error? Any help appreciated!

Unhandled Exception: System.ComponentModel.Win32Exception: The system cannot fin d the file specified at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startIn fo) at System.Diagnostics.Process.Start() at Embeddinator.Helpers.Invoke(String program, String arguments, Dictionary2 envVars) at Embeddinator.Driver.CompileJava(IEnumerable1 files) at Embeddinator.Driver.CompileCode() at Embeddinator.Driver.Run() at Embeddinator.CLI.Main(String[] args)

Harishez avatar Oct 21 '20 12:10 Harishez

@Harishez I do not know which file not found.

lindexi avatar Oct 21 '20 12:10 lindexi

@lindexi It doesn't point to any file. I get this after the following in log

Compiling binding code...

Full Log:

Generating Java stubs...
Invoking: C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /nologo /verbosity:minimal C:\Users\HarishZ\Documents\gofrugal\print_poc\Gofrugal.POS.Ex portRuntime\Gofrugal.POS.ExportRuntime\obj\Debug\foo\GenerateJavaStubs.proj
Compiling binding code...
Unhandled Exception: System.ComponentModel.Win32Exception: The system cannot fin d the file specified at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startIn fo) at System.Diagnostics.Process.Start()
at Embeddinator.Helpers.Invoke(String program, String arguments, Dictionary2 envVars) at Embeddinator.Driver.CompileJava(IEnumerable1 files)
at Embeddinator.Driver.CompileCode()
at Embeddinator.Driver.Run()
at Embeddinator.CLI.Main(String[] args)

And then the exception I had shared being thrown

Harishez avatar Oct 22 '20 11:10 Harishez

Downgrading NDK to v14 helped in overcoming this. The project isn't updated for the latest NDKs

did you change anything else? I am facing the same issue and downgrading to NDK v14 alone does not resolve it.

seacco avatar Nov 05 '20 18:11 seacco