Skip to content
This repository has been archived by the owner on Oct 25, 2021. It is now read-only.

Embeddinator runs without errors, still no aar file #767

Open
MarcK95 opened this issue Mar 24, 2020 · 12 comments
Open

Embeddinator runs without errors, still no aar file #767

MarcK95 opened this issue Mar 24, 2020 · 12 comments
Labels
Milestone

Comments

@MarcK95
Copy link

MarcK95 commented Mar 24, 2020

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

@chamons chamons added this to the Future milestone Mar 24, 2020
@rolfbjarne rolfbjarne modified the milestone: Future Apr 7, 2020
@lindexi
Copy link

lindexi commented Apr 8, 2020

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
Copy link

lindexi commented Apr 9, 2020

@MarcK95
Copy link
Author

MarcK95 commented Apr 9, 2020

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

@lindexi
Copy link

lindexi commented Apr 9, 2020

@MarcKammermann I find the old issus : jamesmontemagno/embeddinator-hellosharedui#3

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

@andrejs-mamontovs
Copy link

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

@robinwit
Copy link

robinwit commented May 25, 2020

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

@Raykud
Copy link

Raykud commented Aug 14, 2020

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.

@Harishez
Copy link

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

@Harishez
Copy link

Harishez commented Oct 21, 2020

@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)

@lindexi
Copy link

lindexi commented Oct 21, 2020

@Harishez I do not know which file not found.

@Harishez
Copy link

Harishez commented Oct 22, 2020

@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

@seacco
Copy link

seacco commented Nov 5, 2020

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.

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

No branches or pull requests

9 participants