youtube / yt-direct-lite-android

The code is a reference implementation for an Android OS application that captures video, uploads it to YouTube, and submits the video to a YouTube Direct Lite instance.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is the project being maintained?

starapple2 opened this issue · comments

I cleaned and built the project from git after Android Studio finally agreed on the process after it insisted on upgrading Gradle etc. But I still ended up with errors. Lint reported 4 errors and 68 warnings.

It stopped building on something related to 'com.google.http-client:google-http-client-android:+'.

It also listed Obsolete Gradle Dependency: (1) com.google.android.gms:play-services-plus:7.8.0 and (2) com.google.code.gson:gson:2.2.4.

When I upgraded to play-services-plus:11.6.0 as suggested by Gradle, it still showed a related error.

After several clean and builds import "com.google.android.gms.auth.GoogleAuthException" was finally recognized in utils.java. The Lint overview and the details on the first issue "DuplicatePlatformClasses:

Duplicate Platform Classes
../../build.gradle: commons-logging defines classes that conflict with classes now provided by Android. Solutions include finding newer versions or alternative libraries that don't have the same problem (for example, for httpclient use HttpUrlConnection or okhttp instead), or repackaging the library using something like jarjar.
../../build.gradle: httpclient defines classes that conflict with classes now provided by Android. Solutions include finding newer versions or alternative libraries that don't have the same problem (for example, for httpclient use HttpUrlConnection or okhttp instead), or repackaging the library using something like jarjar.
There are a number of libraries that duplicate not just functionality of the Android platform but using the exact same class names as the ones provided in Android -- for example the apache http classes. This can lead to unexpected crashes.

To solve this, you need to either find a newer version of the library which no longer has this problem, or to repackage the library (and all of its dependencies) using something like the jarjar tool, or finally, rewriting the code to use different APIs (for example, for http code, consider using HttpUrlConnection or a library like okhttp.)
To suppress this error, use the issue id "DuplicatePlatformClasses" as explained in the Suppressing Warnings and Errors section.

  Correctness
2 error DuplicatePlatformClasses: Duplicate Platform Classes
1 warning ApplySharedPref: Use apply() on SharedPreferences
2 warning OldTargetApi: Target SDK attribute is not targeting latest version
10 warning UnusedAttribute: Attribute unused on older versions
2 error AppCompatResource: Menu namespace
2 warning GradleDependency: Obsolete Gradle Dependency
3 warning GradleDynamicVersion: Gradle Dynamic Version
4 warning GradleOverrides: Value overridden by Gradle build script
  Security
2 warning TrustAllX509TrustManager: Insecure TLS/SSL trust manager
1 warning ExportedService: Exported service does not require permission
1 warning AllowBackup: AllowBackup/FullBackupContent Problems
  Performance
1 warning Recycle: Missing recycle() calls
4 warning ObsoleteSdkInt: Obsolete SDK_INT Version Check
5 warning StaticFieldLeak: Static Field Leaks
22 warning UnusedResources: Unused resources
  Usability:Icons
1 warning IconColors: Icon colors do not follow the recommended visual style
4 warning IconDensities: Icon densities validation
  Usability
1 warning GoogleAppIndexingWarning: Missing support for Firebase App Indexing
  Internationalization:Bidirectional Text
4 warning RtlHardcoded: Using left/right instead of start/end attributes

Despite all the warnings from Lint, when I suppressed the failure on errors in build.gradle, the project built and worked perfectly, uploading a test video and activating the video recorder when requested.

I'm still interested in getting a clean version of the code example using more up-to-date libraries.

@alfredmack, will give it a go. Eventually, my real problem became authentication/permissions. I couldn't get permissions to work correctly for pre and post Android 6 in one app.

@starapple2 i have fixed all your issues in my fork