Skip to content

Fix local NewPipeExtractor build inclusion in settings.gradle.kts#12765

Merged
TobiGr merged 1 commit intoTeamNewPipe:devfrom
TransZAllen:build_error_into_NewPipeExtractor
Nov 2, 2025
Merged

Fix local NewPipeExtractor build inclusion in settings.gradle.kts#12765
TobiGr merged 1 commit intoTeamNewPipe:devfrom
TransZAllen:build_error_into_NewPipeExtractor

Conversation

@TransZAllen
Copy link
Contributor

@TransZAllen TransZAllen commented Nov 2, 2025

What is it?

  • [✓] Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

description

This PR updates the commented example block in settings.gradle.kts to fix the build error while including the NewPipeExtractor for local.

  • Replaced single quotes ('...') with double quotes ("...")
  • Updated the substitute syntax to the Kotlin DSL form, here is the new code:
    substitute(module("com.github.TeamNewPipe:NewPipeExtractor"))
        .using(project(":extractor"))
reason

This was caused by #12706

    1. Old file settings.gradle is coded with Groovy DSL syntax,
    1. new file settings.gradle.kts is coded with Kotlin DSL
      Here is the current comment block in the file:
//includeBuild('../NewPipeExtractor') {
//    dependencySubstitution {
//        substitute module('com.github.TeamNewPipe:NewPipeExtractor') using project(':extractor')
//    }
//}

However, since this file uses Kotlin DSL (.kts), the single quotes ('...') and the Groovy-style chained syntax are not valid in Kotlin.

I have written the details in the comment below.

Before/After Screenshots/Screen Record

  • Before: Fail when trying to include a local NewPipeExtractor build in settings.gradle.kts.
  • After: Succeed.

Fixes the following issue(s)

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.

  • No functional or runtime changes.
  • This only updates a commented-out example, so there’s zero impact on builds or dependencies.
  • Tested successfully on the latest dev branch — project builds cleanly with the updated snippet.

Due diligence

- Resolves build issue related to local NewPipeExtractor inclusion
- Related issue: TeamNewPipe#12763
@github-actions github-actions bot added the size/small PRs with less than 50 changed lines label Nov 2, 2025
@TransZAllen
Copy link
Contributor Author

TransZAllen commented Nov 2, 2025

the 1st build error

error log

allen@allen-Inspiron-3558:/media/allen/WinUbuShare/NewPipe_ubuntu/branch_build_error_into_NewPipeExtractor/NewPipe$ ./gradlew build
e: file:///media/allen/WinUbuShare/NewPipe_ubuntu/branch_build_error_into_NewPipeExtractor/NewPipe/settings.gradle.kts:28:14: Too many characters in a character literal ''../NewPipeExtractor''
e: file:///media/allen/WinUbuShare/NewPipe_ubuntu/branch_build_error_into_NewPipeExtractor/NewPipe/settings.gradle.kts:30:9: Function invocation 'substitute(...)' expected
e: file:///media/allen/WinUbuShare/NewPipe_ubuntu/branch_build_error_into_NewPipeExtractor/NewPipe/settings.gradle.kts:30:9: No value passed for parameter 'substitutedDependency'
e: file:///media/allen/WinUbuShare/NewPipe_ubuntu/branch_build_error_into_NewPipeExtractor/NewPipe/settings.gradle.kts:30:20: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
public fun Dependencies.module(group: String?, name: String, version: String?): ExternalModuleDependency defined in org.gradle.kotlin.dsl
public fun DependencyHandler.module(notation: Any, clientModuleConfiguration: ClientModuleScope.() -> Unit): ClientModule defined in org.gradle.kotlin.dsl
public fun DependencyHandler.module(group: String, name: String, version: String? = ..., configuration: String? = ..., classifier: String? = ..., ext: String? = ...): ClientModule defined in org.gradle.kotlin.dsl
public fun DependencyHandler.module(group: String, name: String, version: String? = ..., configuration: String? = ..., classifier: String? = ..., ext: String? = ..., clientModuleConfiguration: ClientModuleScope.() -> Unit): ClientModule defined in org.gradle.kotlin.dsl
e: file:///media/allen/WinUbuShare/NewPipe_ubuntu/branch_build_error_into_NewPipeExtractor/NewPipe/settings.gradle.kts:30:27: Too many characters in a character literal ''com.github.TeamNewPipe:NewPipeExtractor''
e: file:///media/allen/WinUbuShare/NewPipe_ubuntu/branch_build_error_into_NewPipeExtractor/NewPipe/settings.gradle.kts:30:84: The character literal does not conform to the expected type String!
e: file:///media/allen/WinUbuShare/NewPipe_ubuntu/branch_build_error_into_NewPipeExtractor/NewPipe/settings.gradle.kts:30:84: Too many characters in a character literal '':extractor''

FAILURE: Build failed with an exception.

* Where:
Settings file '/media/allen/WinUbuShare/NewPipe_ubuntu/branch_build_error_into_NewPipeExtractor/NewPipe/settings.gradle.kts' line: 28

* What went wrong:
Script compilation errors:

  Line 28: includeBuild('../NewPipeExtractor') {
                        ^ Too many characters in a character literal ''../NewPipeExtractor''

  Line 30:         substitute module('com.github.TeamNewPipe:NewPipeExtractor') using project(':extractor')
                   ^ Function invocation 'substitute(...)' expected

  Line 30:         substitute module('com.github.TeamNewPipe:NewPipeExtractor') using project(':extractor')
                   ^ No value passed for parameter 'substitutedDependency'

  Line 30:         substitute module('com.github.TeamNewPipe:NewPipeExtractor') using project(':extractor')
                              ^ Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
                                  public fun Dependencies.module(group: String?, name: String, version: String?): ExternalModuleDependency defined in org.gradle.kotlin.dsl
                                  public fun DependencyHandler.module(notation: Any, clientModuleConfiguration: ClientModuleScope.() -> Unit): ClientModule defined in org.gradle.kotlin.dsl
                                  public fun DependencyHandler.module(group: String, name: String, version: String? = ..., configuration: String? = ..., classifier: String? = ..., ext: String? = ...): ClientModule defined in org.gradle.kotlin.dsl
                                  public fun DependencyHandler.module(group: String, name: String, version: String? = ..., configuration: String? = ..., classifier: String? = ..., ext: String? = ..., clientModuleConfiguration: ClientModuleScope.() -> Unit): ClientModule defined in org.gradle.kotlin.dsl

  Line 30:         substitute module('com.github.TeamNewPipe:NewPipeExtractor') using project(':extractor')
                                     ^ Too many characters in a character literal ''com.github.TeamNewPipe:NewPipeExtractor''

  Line 30:         substitute module('com.github.TeamNewPipe:NewPipeExtractor') using project(':extractor')
                                                                                              ^ The character literal does not conform to the expected type String!

  Line 30:         substitute module('com.github.TeamNewPipe:NewPipeExtractor') using project(':extractor')
                                                                                              ^ Too many characters in a character literal '':extractor''

7 errors

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 3s
allen@allen-Inspiron-3558:/media/allen/WinUbuShare/NewPipe_ubuntu/branch_build_error_into_NewPipeExtractor/NewPipe$ 

key information

Too many characters in a character literal

why

old file settings.gradle (Groovy syntax) ---> new file settings.gradle.kts (Kotlin DSL)
Groovy syntax can use the single quotes ('...'), but Kotlin DSL can not.
So I change the code:

// Use a local copy of NewPipe Extractor by uncommenting the lines below.
// We assume, that NewPipe and NewPipe Extractor have the same parent directory.
// If this is not the case, please change the path in includeBuild().

includeBuild("../NewPipeExtractor") {
    dependencySubstitution {
        substitute module("com.github.TeamNewPipe:NewPipeExtractor") using project(":extractor")
    }
}

but it fails again, but reports different log, please see the below.

@TransZAllen
Copy link
Contributor Author

TransZAllen commented Nov 2, 2025

the 2nd build error

error log

allen@allen-Inspiron-3558:/media/allen/WinUbuShare/NewPipe_ubuntu/branch_build_error_into_NewPipeExtractor/NewPipe$ ./gradlew build
e: file:///media/allen/WinUbuShare/NewPipe_ubuntu/branch_build_error_into_NewPipeExtractor/NewPipe/settings.gradle.kts:30:9: Function invocation 'substitute(...)' expected
e: file:///media/allen/WinUbuShare/NewPipe_ubuntu/branch_build_error_into_NewPipeExtractor/NewPipe/settings.gradle.kts:30:9: No value passed for parameter 'substitutedDependency'
e: file:///media/allen/WinUbuShare/NewPipe_ubuntu/branch_build_error_into_NewPipeExtractor/NewPipe/settings.gradle.kts:30:20: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
public fun Dependencies.module(group: String?, name: String, version: String?): ExternalModuleDependency defined in org.gradle.kotlin.dsl
public fun DependencyHandler.module(notation: Any, clientModuleConfiguration: ClientModuleScope.() -> Unit): ClientModule defined in org.gradle.kotlin.dsl
public fun DependencyHandler.module(group: String, name: String, version: String? = ..., configuration: String? = ..., classifier: String? = ..., ext: String? = ...): ClientModule defined in org.gradle.kotlin.dsl
public fun DependencyHandler.module(group: String, name: String, version: String? = ..., configuration: String? = ..., classifier: String? = ..., ext: String? = ..., clientModuleConfiguration: ClientModuleScope.() -> Unit): ClientModule defined in org.gradle.kotlin.dsl

FAILURE: Build failed with an exception.

* Where:
Settings file '/media/allen/WinUbuShare/NewPipe_ubuntu/branch_build_error_into_NewPipeExtractor/NewPipe/settings.gradle.kts' line: 30

* What went wrong:
Script compilation errors:

  Line 30:         substitute module("com.github.TeamNewPipe:NewPipeExtractor") using project(":extractor")
                   ^ Function invocation 'substitute(...)' expected

  Line 30:         substitute module("com.github.TeamNewPipe:NewPipeExtractor") using project(":extractor")
                   ^ No value passed for parameter 'substitutedDependency'

  Line 30:         substitute module("com.github.TeamNewPipe:NewPipeExtractor") using project(":extractor")
                              ^ Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
                                  public fun Dependencies.module(group: String?, name: String, version: String?): ExternalModuleDependency defined in org.gradle.kotlin.dsl
                                  public fun DependencyHandler.module(notation: Any, clientModuleConfiguration: ClientModuleScope.() -> Unit): ClientModule defined in org.gradle.kotlin.dsl
                                  public fun DependencyHandler.module(group: String, name: String, version: String? = ..., configuration: String? = ..., classifier: String? = ..., ext: String? = ...): ClientModule defined in org.gradle.kotlin.dsl
                                  public fun DependencyHandler.module(group: String, name: String, version: String? = ..., configuration: String? = ..., classifier: String? = ..., ext: String? = ..., clientModuleConfiguration: ClientModuleScope.() -> Unit): ClientModule defined in org.gradle.kotlin.dsl

3 errors

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 1s
allen@allen-Inspiron-3558:/media/allen/WinUbuShare/NewPipe_ubuntu/branch_build_error_into_NewPipeExtractor/NewPipe$ 

why

Kotlin DSL does not support Groovy-style command chains or implicit method calls.
Use explicit parentheses and dot notation instead.
So please see my final commit (https://github.com/TeamNewPipe/NewPipe/pull/12765/commits)

Copy link
Contributor

@TobiGr TobiGr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like your PR description more than mine. So let's merge this.

Superseeds and closes #12760

@TobiGr TobiGr enabled auto-merge November 2, 2025 09:56
@TobiGr TobiGr merged commit 2fadaff into TeamNewPipe:dev Nov 2, 2025
8 checks passed
@TransZAllen
Copy link
Contributor Author

@TobiGr

Thanks 🙂 happy to contribute!

@AudricV AudricV changed the title [Build] Local NewPipeExtractor build inclusion fails in settings.gradle.kts Fix local NewPipeExtractor build inclusion in settings.gradle.kts Nov 2, 2025
@TransZAllen TransZAllen deleted the build_error_into_NewPipeExtractor branch November 30, 2025 08:32
@TobiGr TobiGr mentioned this pull request Dec 21, 2025
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/small PRs with less than 50 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Build] Local NewPipeExtractor build inclusion fails in settings.gradle.kts

2 participants