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.Build.Tasks] fix for MonoPackageManager.java from 16.1 #3128

Merged
merged 1 commit into from
May 28, 2019

Conversation

jonathanpeppers
Copy link
Member

Fixes: http://work.devdiv.io/899432

There is a #deletebinobj problem if you take an existing project built
with 16.1 and build with 16.2/master.

  1. File > New > Android App in 16.1.
  2. Build
  3. Open in 16.2, build.

Get an error such as:

obj\Debug\90\android\src\mono\MonoPackageManager_Resources.java(2,8):  error: duplicate class: mono.MonoPackageManager_Resources
public class MonoPackageManager_Resources {

Reviewing obj\Debug\90\android\src\mono, there is a
MonoPackageManager.java and MonoPackageManager_Resources.java that
have a duplicate class.

In 5a9d1a6, we had already tried to fix this, but the
_CleanupOldStaticResources target was not running? It appears that
16.1 is not producing the ApplicationRegistration.java file it is
looking for.

The path we were using for a few files wasn't right:

android\src\mono\app\ApplicationRegistration.java

Should actually be:

android\src\mono\android\app\ApplicationRegistration.java

But then looking at <GenerateJavaStubs/>, we still produce this
file? I think we should instead use NotifyTimeZoneChanges.java for
this check. We don't need to delete, or look for
ApplicationRegistration.java.

Then I found another problem, in that _GeneratePackageManagerJava
and _CompileJava need to re-run. I added the stamp files for these
MSBuild targets to the @(_OldStaticResources) item group to fix
this.

Fixes: http://work.devdiv.io/899432

There is a #deletebinobj problem if you take an existing project built
with 16.1 and build with 16.2/master.

1. File > New > Android App in 16.1.
2. Build
3. Open in 16.2, build.

Get an error such as:

    obj\Debug\90\android\src\mono\MonoPackageManager_Resources.java(2,8):  error: duplicate class: mono.MonoPackageManager_Resources
    public class MonoPackageManager_Resources {

Reviewing `obj\Debug\90\android\src\mono`, there is a
`MonoPackageManager.java` and `MonoPackageManager_Resources.java` that
have a duplicate class.

In 5a9d1a6, we had already tried to fix this, but the
`_CleanupOldStaticResources` target was not running? It appears that
16.1 is not producing the `ApplicationRegistration.java` file it is
looking for.

The path we were using for a few files wasn't right:

    android\src\mono\app\ApplicationRegistration.java

Should actually be:

    android\src\mono\android\app\ApplicationRegistration.java

But then looking at `<GenerateJavaStubs/>`, we still produce this
file? I think we should instead use `NotifyTimeZoneChanges.java` for
this check. We don't need to delete, or look for
`ApplicationRegistration.java`.

Then I found another problem, in that `_GeneratePackageManagerJava`
and `_CompileJava` need to re-run. I added the stamp files for these
MSBuild targets to the `@(_OldStaticResources)` item group to fix
this.
@jonathanpeppers
Copy link
Member Author

I think the build results look the same as recent builds to me:

  • Windows: all AOT related
  • macOS: network related, and the xunit bcl tests exited

@dellis1972 dellis1972 merged commit 241a5ce into dotnet:master May 28, 2019
jonpryor pushed a commit that referenced this pull request May 30, 2019
….1 (#3128)

Fixes: http://work.devdiv.io/899432

There is a #deletebinobj problem if you take an existing project built
with 16.1 and build with 16.2/master.

1. File > New > Android App in 16.1.
2. Build
3. Open in 16.2, build.

Get an error such as:

    obj\Debug\90\android\src\mono\MonoPackageManager_Resources.java(2,8):  error: duplicate class: mono.MonoPackageManager_Resources
    public class MonoPackageManager_Resources {

Reviewing `obj\Debug\90\android\src\mono`, there is a
`MonoPackageManager.java` and `MonoPackageManager_Resources.java` that
have a duplicate class.

In 5a9d1a6, we had already tried to fix this, but the
`_CleanupOldStaticResources` target was not running? It appears that
16.1 is not producing the `ApplicationRegistration.java` file it is
looking for.

The path we were using for a few files wasn't right:

    android\src\mono\app\ApplicationRegistration.java

Should actually be:

    android\src\mono\android\app\ApplicationRegistration.java

But then looking at `<GenerateJavaStubs/>`, we still produce this
file? I think we should instead use `NotifyTimeZoneChanges.java` for
this check. We don't need to delete, or look for
`ApplicationRegistration.java`.

Then I found another problem, in that `_GeneratePackageManagerJava`
and `_CompileJava` need to re-run. I added the stamp files for these
MSBuild targets to the `@(_OldStaticResources)` item group to fix
this.
@jonathanpeppers jonathanpeppers deleted the monopackagemanager.java branch June 4, 2019 01:19
@github-actions github-actions bot locked and limited conversation to collaborators Jan 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants