pyamsoft / tetherfi

TetherFi - Internet sharing without Root
Apache License 2.0
428 stars 36 forks source link

Failed to resolve: io.ktor:ktor-network:3.0.1-PYAMSOFT #348

Closed douglasNordenstedt closed 3 weeks ago

douglasNordenstedt commented 3 weeks ago

Im trying to run the source code in android studio but it seems to have failed to download some of the dependencies?

This is the log from the build:

Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find io.ktor:ktor-network:3.0.1-PYAMSOFT. Searched in the following locations:

pyamsoft commented 3 weeks ago

Hi

The project uses a custom fork of ktor that you'll also need to build.

You can find the ktor fork in my repositories.

brlin-tw commented 3 weeks ago

Some notes of rebuilding ktor for use in TetherFi

You may not need to unless you need the preferred network feature.

Avoid building ktor directly in Android Studio(unless you know how to correctly do it), the project targets multiple platforms(Android, iOS(tvos, watchos, etc...), Kotlin, Linux, Windows...) and is very large, and most of them aren't really used in TetherFi, dependency resolution for all the build targets takes forever(>2hr) at my end and should be avoided.

The process in general would be:

  1. Install Gradle(the one provided by Ubuntu 24.04 works), OpenJDK, Git, and other build dependencies of ktor.
  2. Clone a copy of the pyamsoft/ktor Git repository.
  3. Launch a text terminal.
  4. Change the working directory to the local ktor source tree.
  5. Run the following commands to build and publish the packages to the local Maven repository:
    • ./gradlew publishKotlinMultiplatformPublicationToMavenLocal
    • ./gradlew publishJvmPublicationToMavenLocal
  6. Verifies files are published in the ~/.m2/repository/ directory.
  7. Build TetherFi as usual.