eclair-mobile icon indicating copy to clipboard operation
eclair-mobile copied to clipboard

Build fail with "Failed to transform shapeless" error on ubuntu 21.04

Open emanuelb opened this issue 4 years ago • 0 comments

Build fail with error:

> Task :app:checkReleaseDuplicateClasses FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkReleaseDuplicateClasses'.
> Could not resolve all files for configuration ':app:releaseRuntimeClasspath'.
   > Failed to transform shapeless_2.11-2.3.3.jar (com.chuusai:shapeless_2.11:2.3.3) to match attributes {artifactType=enumerated-runtime-classes, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for JetifyTransform: /home/appuser/.gradle/caches/modules-2/files-2.1/com.chuusai/shapeless_2.11/2.3.3/ea34d4b6128b9090386945dcb952816bd9e87ce2/shapeless_2.11-2.3.3.jar.
         > Failed to transform '/home/appuser/.gradle/caches/modules-2/files-2.1/com.chuusai/shapeless_2.11/2.3.3/ea34d4b6128b9090386945dcb952816bd9e87ce2/shapeless_2.11-2.3.3.jar' using Jetifier. Reason: InvalidPathException, message: Malformed input or input contains unmappable characters: shapeless/$tilde$qmark$greater$?.class. (Run with --stacktrace for more details.)
           Suggestions:
            - Check out existing issues at https://issuetracker.google.com/issues?q=componentid:460323&s=modified_time:desc, it's possible that this issue has already been filed there.
            - If this issue has not been filed, please report it at https://issuetracker.google.com/issues/new?component=460323 (run with --stacktrace and provide a stack trace if possible).

As the error show "Execution failed for JetifyTransform", removing the enableJetifier may be related and fix it, see issue for it at #274

Trying again result in same error in different task :app:kaptGenerateStubsReleaseKotlin

> Task :app:kaptGenerateStubsReleaseKotlin FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:kaptGenerateStubsReleaseKotlin'.
> Could not resolve all files for configuration ':app:releaseCompileClasspath'.
   > Failed to transform shapeless_2.11-2.3.3.jar (com.chuusai:shapeless_2.11:2.3.3) to match attributes {artifactType=android-classes-jar, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-api}.
      > Execution failed for JetifyTransform: /home/appuser/.gradle/caches/modules-2/files-2.1/com.chuusai/shapeless_2.11/2.3.3/ea34d4b6128b9090386945dcb952816bd9e87ce2/shapeless_2.11-2.3.3.jar.
         > Failed to transform '/home/appuser/.gradle/caches/modules-2/files-2.1/com.chuusai/shapeless_2.11/2.3.3/ea34d4b6128b9090386945dcb952816bd9e87ce2/shapeless_2.11-2.3.3.jar' using Jetifier. Reason: InvalidPathException, message: Malformed input or input contains unmappable characters: shapeless/$tilde$qmark$greater$?.class. (Run with --stacktrace for more details.)
           Suggestions:
            - Check out existing issues at https://issuetracker.google.com/issues?q=componentid:460323&s=modified_time:desc, it's possible that this issue has already been filed there.
            - If this issue has not been filed, please report it at https://issuetracker.google.com/issues/new?component=460323 (run with --stacktrace and provide a stack trace if possible).

Does the git checkout v0.4.12-android is correct for eclair repo? used it instead of git checkout android as it's mentioned in v0.4.16-MAINNET release notes under "Complete list of changes:": https://github.com/ACINQ/eclair-mobile/releases/tag/v0.4.16-MAINNET

it was build with Cotnainerfile:

FROM ubuntu:21.04

RUN set -ex; \
    mkdir -p /usr/share/man/man1/; \
    apt-get update; \
    DEBIAN_FRONTEND=noninteractive apt-get install --yes -o APT::Install-Suggests=false --no-install-recommends \
        git \
        wget \
        unzip \
        maven \
        openjdk-11-jdk ; \
    rm -rf /var/lib/apt/lists/*; \
    useradd -ms /bin/bash appuser;
    
USER appuser

ENV ANDROID_HOME="/home/appuser/app/sdk" \
    ANDROID_SDK_ROOT="/home/appuser/app/sdk"

RUN set -ex; \
    mkdir -p "/home/appuser/app/sdk/licenses" "/home/appuser/app/eclair/"; \
    printf "\n24333f8a63b6825ea9c5514f83c2829b004d1fee" > "/home/appuser/app/sdk/licenses/android-sdk-license"; \
    printf "\n84831b9409646a918e30573bab4c9c91346d8abd" > "/home/appuser/app/sdk/licenses/android-sdk-preview-license"; \
    cd /home/appuser/app/sdk/; \
    wget https://dl.google.com/android/repository/commandlinetools-linux-7302050_latest.zip; \
    echo "7a00faadc0864f78edd8f4908a629a46d622375cbe2e5814e82934aebecdb622  commandlinetools-linux-7302050_latest.zip" | sha256sum -c; \
    unzip commandlinetools-linux-7302050_latest.zip; \
    rm commandlinetools-linux-7302050_latest.zip; \
    /home/appuser/app/sdk/cmdline-tools/bin/sdkmanager --sdk_root=/home/appuser/app/sdk/ --install --channel=1 "ndk-bundle" "ndk;23.0.7196353"; \
    cd /home/appuser/app/eclair/; \
    git clone https://github.com/ACINQ/eclair; \
    cd /home/appuser/app/eclair/eclair/; \
    git checkout v0.4.12-android; \
    mvn clean install -DskipTests; \
    cd /home/appuser/app/eclair; \
    git clone https://github.com/ACINQ/eclair-mobile; \
    cd /home/appuser/app/eclair/eclair-mobile; \
    git checkout v0.4.16-MAINNET;
    
WORKDIR /home/appuser/app/eclair/eclair-mobile/

RUN ./gradlew assembleRelease

emanuelb avatar May 28 '21 00:05 emanuelb