Fat jar problem with Ktor and Kotlin multiplatformAndroid Studio: Add jar as library?Shadow Jar doesn't include dependencies into fat jarInclude sources in fat JARHow to compile different flavors while building a fat jar using GradleAndroid Studio Not Seeing Dependency (but Gradle does!)Ktor: Serialize/Deserialize JSON with List as root in MultiplatformUsing gradle shadow with Kotlin multiplatformAndroid - Kotlin files are present in apk after compilationktor dependencies not resolved in ios module of multiplatform projectKotlin Multiplatform with iOS: “Use of undeclared type 'KotlinCoroutineContext'”
Is it possible to record a short contained sound no longer than 60 milliseconds?
How do I deal with an unproductive colleague in a small company?
What's the output of a record needle playing an out-of-speed record
What does the "remote control" for a QF-4 look like?
Why is 150k or 200k jobs considered good when there's 300k+ births a month?
Replacing matching entries in one column of a file by another column from a different file
Can I make popcorn with any corn?
Is it possible to do 50 km distance without any previous training?
Do I have a twin with permutated remainders?
What's that red-plus icon near a text?
Why can't we play rap on piano?
Did Shadowfax go to Valinor?
What does "Puller Prush Person" mean?
A newer friend of my brother's gave him a load of baseball cards that are supposedly extremely valuable. Is this a scam?
What is the word for reserving something for yourself before others do?
Important Resources for Dark Age Civilizations?
Can you really stack all of this on an Opportunity Attack?
Can a Cauchy sequence converge for one metric while not converging for another?
Is it possible to run Internet Explorer on OS X El Capitan?
dbcc cleantable batch size explanation
How does quantile regression compare to logistic regression with the variable split at the quantile?
Approximately how much travel time was saved by the opening of the Suez Canal in 1869?
Is it legal for company to use my work email to pretend I still work there?
Why can't I see bouncing of a switch on an oscilloscope?
Fat jar problem with Ktor and Kotlin multiplatform
Android Studio: Add jar as library?Shadow Jar doesn't include dependencies into fat jarInclude sources in fat JARHow to compile different flavors while building a fat jar using GradleAndroid Studio Not Seeing Dependency (but Gradle does!)Ktor: Serialize/Deserialize JSON with List as root in MultiplatformUsing gradle shadow with Kotlin multiplatformAndroid - Kotlin files are present in apk after compilationktor dependencies not resolved in ios module of multiplatform projectKotlin Multiplatform with iOS: “Use of undeclared type 'KotlinCoroutineContext'”
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I have a kotlin multiplatform project targeting Android and iOS and recently integrated ktor so that the shared library can load web resources. It's working on iOS, but on Android I get this error:
java.lang.NoClassDefFoundError: Failed resolution of: Lio/ktor/client/HttpClientJvmKt
I'm guessing my build pipeline is creating a jar that doesn't contain all the dependencies that ktor needs. So I'm trying to make a fat jar using the gradle shadow plugin (com.github.jengelman.gradle.plugins:shadow:2.0.4
). Here is my task:
task shadowJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar)
from kotlin.targets.android.compilations.main.output
def runtimeClasspath = kotlin.targets.android.compilations.main.runtimeDependencyFiles
configurations = [runtimeClasspath]
baseName = 'myproject-android-shadow'
exclude 'META-INF/*'
exclude '*.kotlin_metadata'
The jar jumped up from 300Kb to 8.5Mb.
The result is a new error: More than one file was found with OS independent path 'kotlinx/coroutines/CoroutineExceptionHandler.kotlin_metadata'
You'll notice I've tried excluding files from the shadowJar
, but it's not working.
gradle ktor kotlin-multiplatform gradle-shadow-plugin
add a comment |
I have a kotlin multiplatform project targeting Android and iOS and recently integrated ktor so that the shared library can load web resources. It's working on iOS, but on Android I get this error:
java.lang.NoClassDefFoundError: Failed resolution of: Lio/ktor/client/HttpClientJvmKt
I'm guessing my build pipeline is creating a jar that doesn't contain all the dependencies that ktor needs. So I'm trying to make a fat jar using the gradle shadow plugin (com.github.jengelman.gradle.plugins:shadow:2.0.4
). Here is my task:
task shadowJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar)
from kotlin.targets.android.compilations.main.output
def runtimeClasspath = kotlin.targets.android.compilations.main.runtimeDependencyFiles
configurations = [runtimeClasspath]
baseName = 'myproject-android-shadow'
exclude 'META-INF/*'
exclude '*.kotlin_metadata'
The jar jumped up from 300Kb to 8.5Mb.
The result is a new error: More than one file was found with OS independent path 'kotlinx/coroutines/CoroutineExceptionHandler.kotlin_metadata'
You'll notice I've tried excluding files from the shadowJar
, but it's not working.
gradle ktor kotlin-multiplatform gradle-shadow-plugin
add a comment |
I have a kotlin multiplatform project targeting Android and iOS and recently integrated ktor so that the shared library can load web resources. It's working on iOS, but on Android I get this error:
java.lang.NoClassDefFoundError: Failed resolution of: Lio/ktor/client/HttpClientJvmKt
I'm guessing my build pipeline is creating a jar that doesn't contain all the dependencies that ktor needs. So I'm trying to make a fat jar using the gradle shadow plugin (com.github.jengelman.gradle.plugins:shadow:2.0.4
). Here is my task:
task shadowJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar)
from kotlin.targets.android.compilations.main.output
def runtimeClasspath = kotlin.targets.android.compilations.main.runtimeDependencyFiles
configurations = [runtimeClasspath]
baseName = 'myproject-android-shadow'
exclude 'META-INF/*'
exclude '*.kotlin_metadata'
The jar jumped up from 300Kb to 8.5Mb.
The result is a new error: More than one file was found with OS independent path 'kotlinx/coroutines/CoroutineExceptionHandler.kotlin_metadata'
You'll notice I've tried excluding files from the shadowJar
, but it's not working.
gradle ktor kotlin-multiplatform gradle-shadow-plugin
I have a kotlin multiplatform project targeting Android and iOS and recently integrated ktor so that the shared library can load web resources. It's working on iOS, but on Android I get this error:
java.lang.NoClassDefFoundError: Failed resolution of: Lio/ktor/client/HttpClientJvmKt
I'm guessing my build pipeline is creating a jar that doesn't contain all the dependencies that ktor needs. So I'm trying to make a fat jar using the gradle shadow plugin (com.github.jengelman.gradle.plugins:shadow:2.0.4
). Here is my task:
task shadowJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar)
from kotlin.targets.android.compilations.main.output
def runtimeClasspath = kotlin.targets.android.compilations.main.runtimeDependencyFiles
configurations = [runtimeClasspath]
baseName = 'myproject-android-shadow'
exclude 'META-INF/*'
exclude '*.kotlin_metadata'
The jar jumped up from 300Kb to 8.5Mb.
The result is a new error: More than one file was found with OS independent path 'kotlinx/coroutines/CoroutineExceptionHandler.kotlin_metadata'
You'll notice I've tried excluding files from the shadowJar
, but it's not working.
gradle ktor kotlin-multiplatform gradle-shadow-plugin
gradle ktor kotlin-multiplatform gradle-shadow-plugin
asked Mar 21 at 23:03
vortekvortek
385113
385113
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Although building a fat jar is possible, the easier solution was to include the missing dependencies (ktor
and kotlinx
) in the app directly. Then I had to add a bunch of exclude 'META-INF ...
statements in packagingOptions
.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55290508%2ffat-jar-problem-with-ktor-and-kotlin-multiplatform%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Although building a fat jar is possible, the easier solution was to include the missing dependencies (ktor
and kotlinx
) in the app directly. Then I had to add a bunch of exclude 'META-INF ...
statements in packagingOptions
.
add a comment |
Although building a fat jar is possible, the easier solution was to include the missing dependencies (ktor
and kotlinx
) in the app directly. Then I had to add a bunch of exclude 'META-INF ...
statements in packagingOptions
.
add a comment |
Although building a fat jar is possible, the easier solution was to include the missing dependencies (ktor
and kotlinx
) in the app directly. Then I had to add a bunch of exclude 'META-INF ...
statements in packagingOptions
.
Although building a fat jar is possible, the easier solution was to include the missing dependencies (ktor
and kotlinx
) in the app directly. Then I had to add a bunch of exclude 'META-INF ...
statements in packagingOptions
.
answered Mar 27 at 16:49
vortekvortek
385113
385113
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55290508%2ffat-jar-problem-with-ktor-and-kotlin-multiplatform%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown