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

Projects which specify a 'minSdkVersion' lower than 10 fail to compile against d16-0 #2690

Closed
pjcollins opened this issue Feb 4, 2019 · 0 comments
Assignees
Labels
Area: App+Library Build Issues when building Library projects or Application projects. vs-sync For internal use only; creates a VSTS "mirror" issue.
Milestone

Comments

@pjcollins
Copy link
Member

pjcollins commented Feb 4, 2019

Steps to Reproduce

  1. Clone or download https://github.com/MvvmCross/NPlus1DaysOfMvvmCross
  2. Restore NuGets and attempt to build N-04-ValueConverters/N-04-ValueConverters.sln.
  3. The javac task fails with the following output, and there appears to be a relevant change in Runtime startup performance improvements #2515
Javac Task (TaskId:313)
    StubSourceDirectory: obj\Debug\44\android\src (TaskId:313)
    TargetFrameworkDirectory: C:\Program Files (x86)\Microsoft Visual Studio\2019\IntPreview\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v4.4\;C:\Program Files (x86)\Microsoft Visual Studio\2019\IntPreview\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\;;;C:\Program Files (x86)\Microsoft Visual Studio\2019\IntPreview\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\Facades\ (TaskId:313)
    JavaSourceFiles: (TaskId:313)
    Jars: (TaskId:313)
      C:\Program Files (x86)\Microsoft Visual Studio\2019\IntPreview\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v4.4\mono.android.jar (TaskId:313)
    ClassesOutputDirectory: obj\Debug\44\android\bin\classes (TaskId:313)
    JavacTargetVersion:  (TaskId:313)
    JavacSourceVersion:  (TaskId:313)
  C:\Program Files\Android\jdk\microsoft_dist_openjdk_1.8.0.9\bin\javac.exe -J-Dfile.encoding=UTF8 -d obj\Debug\44\android\bin\classes -classpath "C:\Program Files (x86)\Microsoft Visual Studio\2019\IntPreview\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v4.4\mono.android.jar" -bootclasspath "C:\Program Files (x86)\Android\android-sdk\platforms\android-19\android.jar" -encoding UTF-8 "@C:\Users\xamarinqa\AppData\Local\Temp\tmp8C13.tmp"  (TaskId:313)
  obj\Debug\44\android\src\mono\MonoPackageManager.java:49: error: method init in class Runtime cannot be applied to given types; (TaskId:313)
  				Runtime.init ( (TaskId:313)
  				       ^ (TaskId:313)
    required: String,String[],String,String[],ClassLoader,String[],String[],String,int,String[] (TaskId:313)
    found: String,String[],String,String[],ClassLoader,String[],String[],String (TaskId:313)
    reason: actual and formal argument lists differ in length (TaskId:313)
  Note: obj\Debug\44\android\src\md596eb82b73f2b170f6f4fd68ad4f37efc\MvxEventSourceTabActivity.java uses or overrides a deprecated API. (TaskId:313)
  Note: Recompile with -Xlint:deprecation for details. (TaskId:313)
  Note: Some input files use unchecked or unsafe operations. (TaskId:313)
  Note: Recompile with -Xlint:unchecked for details. (TaskId:313)
  1 error (TaskId:313)
obj\Debug\44\android\src\mono\MonoPackageManager.java(49,12): error :  error: method init in class Runtime cannot be applied to given types; [C:\xms\NPlus1DaysOfMvvmCross\N-04-ValueConverters\Value.Droid\Value.Droid.csproj]
obj\Debug\44\android\src\mono\MonoPackageManager.java(49,12): error : 				Runtime.init ( [C:\xms\NPlus1DaysOfMvvmCross\N-04-ValueConverters\Value.Droid\Value.Droid.csproj]
obj\Debug\44\android\src\mono\MonoPackageManager.java(49,12): error :   required: String,String[],String,String[],ClassLoader,String[],String[],String,int,String[] [C:\xms\NPlus1DaysOfMvvmCross\N-04-ValueConverters\Value.Droid\Value.Droid.csproj]
obj\Debug\44\android\src\mono\MonoPackageManager.java(49,12): error :   found: String,String[],String,String[],ClassLoader,String[],String[],String [C:\xms\NPlus1DaysOfMvvmCross\N-04-ValueConverters\Value.Droid\Value.Droid.csproj]
obj\Debug\44\android\src\mono\MonoPackageManager.java(49,12): error :   reason: actual and formal argument lists differ in length [C:\xms\NPlus1DaysOfMvvmCross\N-04-ValueConverters\Value.Droid\Value.Droid.csproj]
obj\Debug\44\android\src\mono\MonoPackageManager.java(49,12): error :  [C:\xms\NPlus1DaysOfMvvmCross\N-04-ValueConverters\Value.Droid\Value.Droid.csproj]
Done executing task "Javac" -- FAILED. (TaskId:313)

Build output

Version Information

VS2019 preview w/ 9.1.103.12 (monodroid/HEAD/7e1c4688)

Log File

http://xqa.blob.core.windows.net/gist/report-1e37b13d7d5f4d05987d5e0585a4020f.txt

VS bug #785417

@pjcollins pjcollins added the Area: App+Library Build Issues when building Library projects or Application projects. label Feb 4, 2019
@pjcollins pjcollins added this to the d16-0 milestone Feb 4, 2019
@pjcollins pjcollins added the vs-sync For internal use only; creates a VSTS "mirror" issue. label Feb 4, 2019
grendello added a commit to grendello/xamarin-android that referenced this issue Feb 4, 2019
Context: dotnet#2690
Fixes: dotnet#2690

Xamarin.Android and Mono are no longer capable of running on API levels lower
than 9 (if built with NDK r14) or 16 (if built with NDK r18+). This commit drops
the version of `MonoPackageManager` targetting API levels < 9.

If an application with its minimum target sdk set to anything < 9 is build it
results in a compilation error when building Java code:

    error :  error: method init in class Runtime cannot be applied to given types; [C:\xms\NPlus1DaysOfMvvmCross\N-04-ValueConverters\Value.Droid\Value.Droid.csproj]
    error :	Runtime.init ( [C:\xms\NPlus1DaysOfMvvmCross\N-04-ValueConverters\Value.Droid\Value.Droid.csproj]
    error :   required: String,String[],String,String[],ClassLoader,String[],String[],String,int,String[] [C:\xms\NPlus1DaysOfMvvmCross\N-04-ValueConverters\Value.Droid\Value.Droid.csproj]
    error :   found: String,String[],String,String[],ClassLoader,String[],String[],String [C:\xms\NPlus1DaysOfMvvmCross\N-04-ValueConverters\Value.Droid\Value.Droid.csproj]
    error :   reason: actual and formal argument lists differ in length [C:\xms\NPlus1DaysOfMvvmCross\N-04-ValueConverters\Value.Droid\Value.Droid.csproj]

This is caused by the changes introduced in the runtime performance commit
dotnet@b90d3ab
which changed the `Runtime.init` signature but *only* in the version of
`MonoPackageManager` targetting the currently supported minimum SDK levels.
@pjcollins pjcollins changed the title NPlus1DaysOfMvvmCross example projects fail to build in dev16 Projects which specify a 'minSdkVersion' lower than 10 fail to compile against d16-0 Feb 4, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Jun 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: App+Library Build Issues when building Library projects or Application projects. vs-sync For internal use only; creates a VSTS "mirror" issue.
Projects
None yet
Development

No branches or pull requests

2 participants