Failure building Android project with gradle error: "Illegal embedded sign character" - android

Can't make Android project build with gradle assemble task. I'm getting
What went wrong:
A problem occurred configuring root project 'MyProjectTitle'.
> Could not resolve all files for configuration ':classpath'.
> Could not download javax.activation.jar (com.sun.activation:javax.activation:1.2.0)
> Failed to download SHA1 for resource 'https://nexus.mycompanydomain.com/repository/jcenter-cache/com/sun/activation/javax.activation/1.2.0/javax.activation-1.2.0.jar'.
> Illegal embedded sign character
We are using our own Nexus artifactory repository. It works fine for some colleagues.

Turns out, you need to clean ~/.gradle/caches/ folder.

Related

Gradle build failure when packaging GooglePAD asset packs in Unreal Engine

I have followed this guide to implement the GooglePAD plugin in UE 4.27, but I'm met with the following error when I try to package the project for the second time (first time generates the asset packs):
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:assetPackDebugPreBundleTask'.
> Could not resolve all task dependencies for configuration ':app:assetPackFiles'.
> Could not resolve project :assetpacks:on-demand:OnDemandPack.
Required by:
project :app
> Project :app declares a dependency from configuration 'assetPackFiles' to configuration 'packElements' which is not declared in the descriptor for project :assetpacks:on-demand:OnDemandPack.
I see that there is a similar question here, but their solution doesn't seem to apply to me since I'm certain my folders are properly named. This happens with all 3 of my on-demand packs. The build.gradle file inside the asset pack folders is exactly the same as the one included in the guide, though I have tried just writing the pack names as shown here to no avail.
What should I do to build successfully with this plugin?

Building android build with jenkins

I am trying to build android with Jenkin. But I am getting this compilation error:
Execution failed for task ':app:mergeDebugResources'.
> Multiple task action failures occurred:
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
AAPT: C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\android_build\app\build\intermediates\res\merged\debug: error: The system cannot find the file specified. (2).
Can anyone else facing this issue. I tried running the build on Android Studio and it works fine. I have defined the sdk path in jenkins and setup gradle also.
Please help.
So I found a solution that worked for me. I was using jenkins:2.277.4, I downgraded the jenkin version to 2.204.6 and suddenly it worked. Also I used war file this time so the path to workspace was smaller as compared to previous install and yeah also use app:build as task for build so you dont get lint error for other libraries.

Android offline install com.android.tools.build:builder:3.3.0

boycotting our country with all of our IPs by Google i can't build Android project which i made that with Flutter, so i get this error:
* What went wrong:
A problem occurred configuring project ':path_provider'.
> Could not resolve all artifacts for configuration ':path_provider:classpath'.
> Could not find builder-3.3.0.jar (com.android.tools.build:builder:3.3.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/3.3.0/builder-3.3.0.jar
> Could not get unknown property 'android' for project ':path_provider' of type org.gradle.api.Project.
now i can download this file and i want to know witch directory this file should be paste? i think after past this file i can install that offline
I think it will be easier to add the jar to the gradle config:
dependencies {
compile files('lib/local.jar')
}
https://discuss.gradle.org/t/put-jar-file-to-cache-manually/29488

Cordova Android Build Issue: Could not HEAD '...packages...' > Socket Closed error

I cannot get a cordova app to build. Below you can see the stack trace:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all files for configuration ':classpath'.
> Could not resolve org.ow2.asm:asm-analysis:6.0.
Required by:
project : > com.android.tools.build:gradle:3.2.0
> Could not resolve org.ow2.asm:asm-analysis:6.0.
> Could not get resource 'https://maven.google.com/org/ow2/asm/asm-analysis/6.0/asm-analysis-6.0.pom'.
> Could not HEAD 'https://maven.google.com/org/ow2/asm/asm-analysis/6.0/asm-analysis-6.0.pom'.
> Socket closed
> Could not resolve org.ow2.asm:asm-analysis:6.0.
> Could not get resource 'https://jcenter.bintray.com/org/ow2/asm/asm-analysis/6.0/asm-analysis-6.0.pom'.
> Could not HEAD 'https://jcenter.bintray.com/org/ow2/asm/asm-analysis/6.0/asm-analysis-6.0.pom'.
> Socket closed
Anyone have any ideas? I'm not being blocked by a firewall and I'm not behind a proxy. I can't find any resources that help point to why these dependencies won't resolve.
Any help is greatly appreciated. Thanks.
EDIT: I tried a cordova clean and am having a similar issue, just a different package starts off the error stack trace:
$ cordova clean
Android Studio project detected
ANDROID_HOME=/Users/[my user folder]/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home
Subproject Path: CordovaLib
Subproject Path: app
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all files for configuration ':classpath'.
> Could not download gradle-api.jar (com.android.tools.build:gradle-api:3.2.0)
> Could not get resource 'https://maven.google.com/com/android/tools/build/gradle-api/3.2.0/gradle-api-3.2.0.jar'.
> Could not HEAD 'https://maven.google.com/com/android/tools/build/gradle-api/3.2.0/gradle-api-3.2.0.jar'.
> Socket closed
> Could not download sdklib.jar (com.android.tools:sdklib:26.2.0)
> Could not get resource 'https://maven.google.com/com/android/tools/sdklib/26.2.0/sdklib-26.2.0.jar'.
> Could not HEAD 'https://maven.google.com/com/android/tools/sdklib/26.2.0/sdklib-26.2.0.jar'.
> Socket closed
> Could not download repository.jar (com.android.tools:repository:26.2.0)
> Could not get resource 'https://maven.google.com/com/android/tools/repository/26.2.0/repository-26.2.0.jar'.
> Could not HEAD 'https://maven.google.com/com/android/tools/repository/26.2.0/repository-26.2.0.jar'.
> Socket closed
> Could not download jetifier-processor.jar (com.android.tools.build.jetifier:jetifier-processor:1.0.0-alpha10)
> Could not get resource 'https://maven.google.com/com/android/tools/build/jetifier/jetifier-processor/1.0.0-alpha10/jetifier-processor-1.0.0-alpha10.jar'.
> Could not HEAD 'https://maven.google.com/com/android/tools/build/jetifier/jetifier-processor/1.0.0-alpha10/jetifier-processor-1.0.0-alpha10.jar'.
> Socket closed
I found the solution to my problem.
The gradle version the cordova app I'm running is on gradle version 3.0.1 which expects the ndk to have a specific folder in it, that provides some deprecated tooling. An answer in this stack overflow fixes that problem: Error: No toolchains found in the NDK toolchains folder for ABI with prefix: llvm
In addition, the repo lines in the gradle files needed updated to include google() in order to find all the dependencies, making it include all of the following :
mavenCentral()
google()
jcenter()
after that, the project built fine. Probably need to update the gradle version so I don't have to make deprecated stuff work. :/

Jenkins: Ionic android build failed

I am beginner of ionic mobile development and now I am setting CI for my mobile application using Jenkins (on localhost). I am facing an error that I am unable to resolve for many days. ionic compiles successfully but at the last at the time of android build preparation it fails and gives error I mentioned below.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all files for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:3.0.0.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:3.0.0.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'.
> corphttpsproxyhost.yourdomain: Name or service not known
> Could not resolve com.android.tools.build:gradle:3.0.0.
> Could not get resource 'https://maven.google.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'.
> Could not GET 'https://maven.google.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'.
> corphttpsproxyhost.yourdomain
Please let me know where I am committing mistake, or is there any other dependency issue.
Thanks
I think you did not add gradle 3.0.0
You can do this by going to “Configure System” (Jenkins 1.x) or to “Global Tool Configuration” (Jenkins 2.x). From the home page navigate to:
Manage Jenkins -> Configure System (Jenkins 1.x)
Manage Jenkins -> Global Tool Configuration (Jenkins 2.x)
Scroll down a little bit and you should encounter a small section for gradle with a single button labeled “Gradle installations…”. Click on that button to expand the configuration panel.
The gradle configuration panel will ask for a few parameters. Here you can set the tool to a static path, or let Jenkins handle the installation for you. We recommend using “Install automatically” for ease of use. Below is an example of an automatic installation of gradle 3.0.0
than you have to select this gradle version from your project configration.
in bbuild tab
add Invoke Gradle script
Invoke Gradle
X Gradle Version 3.0.0
than build it it may help you

Categories

Resources