ExoPlayer icon indicating copy to clipboard operation
ExoPlayer copied to clipboard

Classes/resource not accessible through "full" library after the gradle changes in 2.7.1

Open CoryCharlton opened this issue 8 years ago • 9 comments

Issue description

Resource ids are no longer accessible through the "full" library after the gradle changes in 2.7.1

Reproduction steps

Add the ExoPlayer library like this

implementation 'com.google.android.exoplayer:exoplayer:2.7.1'

And try to reference one of the resource ids:

<TextView android:id="@id/exo_position" android:layout_width="wrap_content" android:layout_height="wrap_content" tools:text="0:00" style="@style/VideoBrowser.Widget.TextView.Subtitle.Shadow" />

Link to test content

Not relevant

Version of ExoPlayer being used

2.7.1

Device(s) and version(s) of Android being used

Build issue

CoryCharlton avatar Mar 14 '18 05:03 CoryCharlton

I switched my application gradle to the following and I can reference the resource ids again:

implementation 'com.google.android.exoplayer:exoplayer-core:2.7.1'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.7.1'
implementation 'com.google.android.exoplayer:exoplayer-hls:2.7.1'
implementation 'com.google.android.exoplayer:exoplayer-smoothstreaming:2.7.1'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.7.1'

I'll fork and see if I can resolve the issue.

CoryCharlton avatar Mar 14 '18 05:03 CoryCharlton

It seems that the full version only contains a BuildConfig.class

Ernest-su avatar Mar 14 '18 08:03 Ernest-su

Is this just resource ids, or classes too? I think our release process didn't handle api/implementation properly. The POM file for 2.7.1 is missing its dependencies:

https://bintray.com/google/exoplayer/download_file?file_path=com%2Fgoogle%2Fandroid%2Fexoplayer%2Fexoplayer%2F2.7.1%2Fexoplayer-2.7.1.pom

Compared to:

https://bintray.com/google/exoplayer/download_file?file_path=com%2Fgoogle%2Fandroid%2Fexoplayer%2Fexoplayer%2F2.7.0%2Fexoplayer-2.7.0.pom

It might be possible to fix this just by fixing the POM files, but I'm not certain yet.

ojw28 avatar Mar 14 '18 08:03 ojw28

I just confirmed that the classes are missing also.

I tried editing the POM in my gradle cache as a hack and that didn't seem to work (not suggesting that isn't the solution).

CoryCharlton avatar Mar 14 '18 15:03 CoryCharlton

I haven't been able to reproduce this fix but issue https://github.com/novoda/bintray-release/issues/149 seems to suggest that com.novoda:bintray-release:0.8.0 resolved the dependency issue related to api and implementation.

https://github.com/novoda/bintray-release/releases/tag/0.8.0

Looks like ExoPlayer is still using release 0.5.0

CoryCharlton avatar Mar 14 '18 19:03 CoryCharlton

Correct. I've tried using 0.8.0 and the POM files do contain the dependencies again. I'm currently checking whether upgrading the version changes anything else about the release, and whether the POM changes fix the issue.

ojw28 avatar Mar 14 '18 22:03 ojw28

The POM files have been updated, and the issue appears to be fixed. Unfortunately, since we haven;'t bumped the version again, you'll probably need to clear your gradle cache to pick up the updates.

I found that after I did that Android Studio would build a project depending on the "full" library fine, although for some reason it still showed imports as unresolved when opening source files. I was able to "fix" that by upgrading gradle/wrapper/gradle-wrapper.properties to use 4.4. However when I then downgraded to 4.1 again, everything was still happy, so I'm guessing that was also some kind of caching related issue.

If you could verify the issue is fixed for you too, that would be great.

ojw28 avatar Mar 14 '18 23:03 ojw28

Confirmed that the updated POM fixed the issue.

I ran into the same problem with unresolved imports in the UI. Switching to gradle 4.4 and then back to 4.1 resolved it for me as well.

CoryCharlton avatar Mar 14 '18 23:03 CoryCharlton

Thanks for confirming! Looking at the stats we have for how many developers downloaded 2.7.1 prior to the issue being fixed, it doesn't seem worthwhile bumping the version number to avoid them having to clear their gradle cache. Marking as closed.

ojw28 avatar Mar 15 '18 00:03 ojw28