react-native-track-player: [Android] [v3.2.0] Build Error "Unresolved reference: value"

Describe the Bug

> Task :react-native-track-player:compileDebugKotlin FAILED
e: /Users/gsquare567/Sites/blogcast/node_modules/react-native-track-player/android/src/main/java/com/doublesymmetry/trackplayer/extensions/AudioPlayerStateExt.kt: (8, 16): 'when' expression must be exhaustive, add necessary 'STOPPED', 'ERROR' branches or 'else' branch instead
e: /Users/gsquare567/Sites/blogcast/node_modules/react-native-track-player/android/src/main/java/com/doublesymmetry/trackplayer/module/MusicModule.kt: (505, 61): Unresolved reference: value

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':react-native-track-player:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more details

Steps To Reproduce How can someone else reproduce this bug?

Code To Reproduce Please provide a simple code example that allows others to replicate the bug.

Replicable on Example App? Can you replicate this bug in the React Native Track Player Example App?

Environment Info:

System:
    OS: macOS 12.4
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 27.07 MB / 32.00 GB
    Shell: 3.0.2 - /usr/local/bin/fish
  Binaries:
    Node: 16.18.1 - /usr/local/bin/node
    Yarn: 1.22.5 - ~/.yarn/bin/yarn
    npm: 8.19.2 - /usr/local/bin/npm
    Watchman: Not Found
  Managers:
    CocoaPods: 1.11.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK:
      API Levels: 30, 31, 32, 33
      Build Tools: 29.0.2, 30.0.2, 30.0.3, 31.0.0, 33.0.0
      System Images: android-30 | Google Play Intel x86 Atom, android-33 | Google APIs Intel x86 Atom_64
      Android NDK: Not Found
  IDEs:
    Android Studio: 2021.3 AI-213.7172.25.2113.9123335
    Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.13 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: Not Found
    react-native: Not Found
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

"react": "18.1.0",
"react-native": "0.70.5",

        buildToolsVersion = findProperty('android.buildToolsVersion') ?: '31.0.0'
        minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '21')
        compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '33')
        targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '31')
        kotlinVersion = findProperty('android.kotlinVersion') ?: '1.6.0'
        frescoVersion = findProperty('expo.frescoVersion') ?: '2.5.0'

        classpath('com.android.tools.build:gradle:7.2.1')
        classpath('com.facebook.react:react-native-gradle-plugin')
        classpath('de.undercouch:gradle-download-task:5.0.1')

Android

How I can Help What can you do to help resolve this? Have you investigated the underlying JS or Swift/Android code causing this bug? Can you create a Pull Request with a fix?

Downgrading to 3.1.0 works, so this is a regression in the update. I have no experience with Kotlin and my patch-package attempt did not work. I am working in Expo v47 (latest) Bare so versioning has been a bit of a nightmare.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (1 by maintainers)

Most upvoted comments

I switched from “main-SNAPSHOT” to “1.2.4” and created a patch and the build was successful. No problems with the player on my device.

Same problem for me. I used “main-SNAPSHOT” so far but it’s not working right now; with “1.2.4” or “v1.2.4” it looks like credentials are required :

Could not get resource ‘https://www.jitpack.io/com/github/doublesymmetry/kotlin-audio/1.2.4/kotlin-audio-1.2.4.pom’. Could not GET ‘https://www.jitpack.io/com/github/doublesymmetry/kotlin-audio/1.2.4/kotlin-audio-1.2.4.pom’. Received status code 401 from server: Unauthorized