Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build on Android #1

Open
glemartret opened this issue Mar 17, 2024 · 3 comments
Open

Unable to build on Android #1

glemartret opened this issue Mar 17, 2024 · 3 comments

Comments

@glemartret
Copy link

glemartret commented Mar 17, 2024

When I run my app on Android I get the following build error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find any matches for com.github.TelemetryDeck:KotlinSDK:+ as no versions of com.github.TelemetryDeck:KotlinSDK are available.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/github/TelemetryDeck/KotlinSDK/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/com/github/TelemetryDeck/KotlinSDK/maven-metadata.xml
       - https://storage.googleapis.com/download.flutter.io/com/github/TelemetryDeck/KotlinSDK/maven-metadata.xml
     Required by:
         project :app > project :telemetrydecksdk

And when I add maven { url 'https://jitpack.io' } to build.gradle I get the following:


* What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not resolve com.github.TelemetryDeck:KotlinSDK:+.
     Required by:
         project :app > project :telemetrydecksdk
      > Could not resolve com.github.TelemetryDeck:KotlinSDK:2.0.1.
         > Could not get resource 'https://jitpack.io/com/github/TelemetryDeck/KotlinSDK/2.0.1/KotlinSDK-2.0.1.module'.
            > Could not GET 'https://jitpack.io/com/github/TelemetryDeck/KotlinSDK/2.0.1/KotlinSDK-2.0.1.module'.
               > Read timed out```
@roygroothulze
Copy link

I got the same issue.

@novas1r1
Copy link
Contributor

novas1r1 commented Mar 22, 2024

I've got the same issue for Android, for iOS everything works.

Here's my flutter doctor:
`[✓] Flutter (Channel stable, 3.19.2, on macOS 14.2.1 23C71 darwin-arm64, locale de-DE)
• Flutter version 3.19.2 on channel stable at /Users/verenazaiser/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 7482962148 (3 weeks ago), 2024-02-27 16:51:22 -0500
• Engine revision 04817c99c9
• Dart version 3.3.0
• DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/verenazaiser/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15E204a
• CocoaPods version 1.14.3

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.87.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.84.0`

@kkostov
Copy link
Contributor

kkostov commented Mar 22, 2024

The Flutter plugin wraps the native KotlinSDK and so it requires that build.gradle in the flutter app be extended to include the jitpack repository:

./android/build.gradle:

allprojects {
    repositories {
        google()
        mavenCentral()
        maven { url 'https://www.jitpack.io' }
    }
}
...

It seems that the maven repository over at jitpack.io is intermittently very slow to respond and causing a timeout when Gradle attempts to build the app. When this happens, the following error appears in the log:

...
> Could not resolve com.github.TelemetryDeck:KotlinSDK:2.0.1.
         > Could not get resource 'https://jitpack.io/com/github/TelemetryDeck/KotlinSDK/2.0.1/KotlinSDK-2.0.1.module'.
            > Could not GET 'https://jitpack.io/com/github/TelemetryDeck/KotlinSDK/2.0.1/KotlinSDK-2.0.1.module'.
               > Read timed out

I will prepare a PR allowing the KotlinSDK to be published to Maven Central in order to avoid the connectivity issues related to jitpack (and also simplify the steps needed to run it on Android).

In the meantime, while testing I noticed that adding jitpack with https://www.jitpack.io instead of https://jitpack.io made it so gradle was able to download the dependency successfully. Another work-around would be to increase the gradle timeout for your app by adapting the gradle.properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants