You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 27, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 27, 2026. It is now read-only.
I don' t know - they are showing up as errors in the Build Output as well as the Error List. Is there another setting in VS that might affect this?
I tried removing the source jar files and now get invalid token errors in some generated files. It is placing '?' in some methods like so (notice "void?"):
Looks like this is the full output message that is being emitted:
## Unable to translate remarks for com/google/android/exoplayer2/Player:
A media player interface defining traditional high-level functionality, such as the ability to
play, pause, seek and query properties of the currently playing media.
<p>
Some important properties of media players that implement this interface are:
<ul>
<li>They can provide a {@link Timeline} representing the structure of the media being played,
which can be obtained by calling {@link #getCurrentTimeline()}.</li>
<li>They can provide a {@link TrackGroupArray} defining the currently available tracks,
which can be obtained by calling {@link #getCurrentTrackGroups()}.</li>
<li>They contain a number of renderers, each of which is able to render tracks of a single
type (e.g. audio, video or text). The number of renderers and their respective track types
can be obtained by calling {@link #getRendererCount()} and {@link #getRendererType(int)}.
</li>
<li>They can provide a {@link TrackSelectionArray} defining which of the currently available
tracks are selected to be rendered by each renderer. This can be obtained by calling
{@link #getCurrentTrackSelections()}}.</li>
</ul>
Error (31:41): Syntax error, expected: #PCDATA, <tt>, <TT>, <i>, <I>, {@code, {@docRoot}, {@inheritDoc}, {@link, {@linkplain, {@literal, {@value}, {@value, UnknownHtmlElementStart, </tt>, </TT>, </i>, </I>, </p>, </P>, <p>, <P>, <pre>, <PRE>, @author, @apiSince, @deprecated, @deprecatedSince, @exception, @param, @return, @see, @serialData, @serialField, @since, @throws, @[unknown], @version
{@link #getCurrentTrackSelections()}}.</li>
^
This part:
Error (31:41): Syntax error, expected: ......
Is close enough to the MSBuild error format that MSBuild seems to be recognizing it as an actual error, which is not intended.
I think if we change this line to something else we can get this back to an informational message as intended:
Did you remove them from all of your projects? I had tried removing them from all the projects, and did not get the invalid token errors you mentioned.
Somehow even though it builds successfully, several interfaces and classes are missing in the output. I think I tracked it down to the "Player" interface never being generated. I get this warning but it does not tell me anything specific:
1>obj\Release\monoandroid10.0\api.xml(3, 6) : warning BG8C01: For type 'Com.Google.Android.Exoplayer2.BasePlayer', base interface 'com.google.android.exoplayer2.Player' is invalid.
That's not one I see very often. It means it found the interface com.google.android.exoplayer2.Player, but there is some issue with it that will prevent it from getting generated.
Hopefully there is another message somewhere in the diagnostic output that tells what is wrong with the com.google.android.exoplayer2.Player interface.
I turned on "Diagnostic" build output and unfortunately don't see anything that tells what is wrong with the interface. Just the one warning for BasePlayer about the invalid interface and several invalid parameter and return type warnings where the Player interface is attempted to be used. Here is the build output: Output-Build.txt
1> C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Bindings.Core.targets(53,5): message BG0000: obj\Release\monoandroid10.0\api.xml(2220, 10): warning BG8801: Invalid parameter type 'com.google.android.exoplayer2.Player.Listener' for member 'Com.Google.Android.Exoplayer2.IPlayer.RemoveListener (Com.Google.Android.Exoplayer2.IPlayerListener)'.
1> obj\Release\monoandroid10.0\api.xml(2030, 6) : warning BG8503: Invalidating 'Com.Google.Android.Exoplayer2.IPlayer' and all its nested types because some of its methods were invalid.
You will need to follow the trail to figure out the root issue causing the types to be invalidated.
That is:
IPlayer is invalidated because IPlayerListener is invalid
I traced it back to me removing the Metadata class to avoid the 'void?' token error. I have tried both your suggestion as well as
<attr name="return-not-null" path="/api/package[@name='com.google.android.exoplayer2.metadata']/interface[@name='Metadata.Entry']/method[@name='writeToParcel' and count(parameter)=2 and parameter[1][@type='android.os.Parcel'] and parameter[2][@type='int']]">true</attr>
but it always generates a 'void?' (it seems that IEntryInvoker is automatically generated by the binder for IEntry because it is not defined in Java). Any other ideas on how to solve this?
<Nullable> worked but that uncovered a number of other errors including several runtime Java.Lang.AbstractMethodError exceptions. These seem to mostly have come from a deprecated interface? I'm sure there is a better way to do it, but I had to slowly remove these methods one-at-a-time until the errors stopped. But, I finally have something running successfully so thank you!
Activity
jpobst commentedon Jun 14, 2021
I think the only current workaround for this is to remove the
<JavaSourceJar>files from your.csprojfiles.jonpryor commentedon Jun 14, 2021
@cncb-gh: How are you observing this error? It looks like you have
$(TreatWarningsAsErrors)disabled:https://github.com/Baseflow/ExoPlayerXamarin/blob/5214b7158fc6611f602ffc0f0122429a3ae49b6d/Directory.Build.props#L22
We should only be emitting a warning for this, and probably not even a warning… (We should fix that.)
cncb-gh commentedon Jun 14, 2021
I don' t know - they are showing up as errors in the Build Output as well as the Error List. Is there another setting in VS that might affect this?
I tried removing the source jar files and now get invalid token errors in some generated files. It is placing '?' in some methods like so (notice "void?"):
[Register ("writeToParcel", "(Landroid/os/Parcel;I)V", "GetWriteToParcel_Landroid_os_Parcel_IHandler")] public abstract void? WriteToParcel (global::Android.OS.Parcel? dest, [global::Android.Runtime.GeneratedEnum] global::Android.OS.ParcelableWriteFlags flags);jpobst commentedon Jun 15, 2021
Looks like this is the full output message that is being emitted:
This part:
Is close enough to the MSBuild error format that MSBuild seems to be recognizing it as an actual error, which is not intended.
I think if we change this line to something else we can get this back to an informational message as intended:
jpobst commentedon Jun 15, 2021
I have a PR that fixes MSBuild interpreting these error messages as real errors:
#851
I believe @pjcollins will be looking at improving the Javadoc parsing in the future to prevent the messages from happening in the first place.
(See also https://github.com/xamarin/java.interop/issues/843)
cncb-gh commentedon Jun 15, 2021
Thanks. In the meantime, do you know how I can fix the "invalid token" error when removing the JavaDoc references?
jpobst commentedon Jun 15, 2021
Did you remove them from all of your projects? I had tried removing them from all the projects, and did not get the invalid token errors you mentioned.
[generator] Avoid 'error (…):' construct in diagnostic messages (#851)
[generator] Avoid 'error (…):' construct in diagnostic messages (#851)
4 remaining items
cncb-gh commentedon Jun 23, 2021
Unfortunately, this didn't work for me either. The only thing that works is removing the whole Metadata class with remove-node. Thanks for your help.
cncb-gh commentedon Jun 24, 2021
Somehow even though it builds successfully, several interfaces and classes are missing in the output. I think I tracked it down to the "Player" interface never being generated. I get this warning but it does not tell me anything specific:
1>obj\Release\monoandroid10.0\api.xml(3, 6) : warning BG8C01: For type 'Com.Google.Android.Exoplayer2.BasePlayer', base interface 'com.google.android.exoplayer2.Player' is invalid.Player Interface:
https://github.com/google/ExoPlayer/blob/release-v2/library/common/src/main/java/com/google/android/exoplayer2/Player.java
BasePlayer:
https://github.com/google/ExoPlayer/blob/release-v2/library/common/src/main/java/com/google/android/exoplayer2/BasePlayer.java
I would appreciate any more help you are able to give. Thanks for your time.
jpobst commentedon Jun 24, 2021
That's not one I see very often. It means it found the interface
com.google.android.exoplayer2.Player, but there is some issue with it that will prevent it from getting generated.Hopefully there is another message somewhere in the diagnostic output that tells what is wrong with the
com.google.android.exoplayer2.Playerinterface.cncb-gh commentedon Jun 24, 2021
I turned on "Diagnostic" build output and unfortunately don't see anything that tells what is wrong with the interface. Just the one warning for BasePlayer about the invalid interface and several invalid parameter and return type warnings where the Player interface is attempted to be used. Here is the build output:
Output-Build.txt
jpobst commentedon Jun 24, 2021
It's in your log:
You will need to follow the trail to figure out the root issue causing the types to be invalidated.
That is:
IPlayeris invalidated becauseIPlayerListeneris invalidIPlayerListeneris invalidcncb-gh commentedon Jun 24, 2021
I traced it back to me removing the Metadata class to avoid the 'void?' token error. I have tried both your suggestion as well as
<attr name="return-not-null" path="/api/package[@name='com.google.android.exoplayer2.metadata']/interface[@name='Metadata.Entry']/method[@name='writeToParcel' and count(parameter)=2 and parameter[1][@type='android.os.Parcel'] and parameter[2][@type='int']]">true</attr>but it always generates a 'void?' (it seems that IEntryInvoker is automatically generated by the binder for IEntry because it is not defined in Java). Any other ideas on how to solve this?
jpobst commentedon Jun 25, 2021
The easiest way to solve it would be to turn off
<Nullable>for that assembly.cncb-gh commentedon Jun 30, 2021
<Nullable>worked but that uncovered a number of other errors including several runtime Java.Lang.AbstractMethodError exceptions. These seem to mostly have come from a deprecated interface? I'm sure there is a better way to do it, but I had to slowly remove these methods one-at-a-time until the errors stopped. But, I finally have something running successfully so thank you![generator] Don't generate unexpected NRT types like `void?` (#856)
[generator] Don't generate unexpected NRT types like `void?` (#856)
[-]Several XML syntax errors when trying to bind in VS 16.10[/-][+]XML syntax warnings when using JavaSourceJar[/+]