Android Studio: Execution fails when I add SignalR client library - android

I have downloaded signalr client library from https://github.com/SignalR/java-client. On build it generated jar files.
When I add the jar files to my project, the project builds but when I try to run I get the error message below:
Error:Execution failed for task ':app:dexDebug'.> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_25\bin\java.exe'' finished with non-zero exit value 1
Previously I followed the tutorial on https://whathecode.wordpress.com/2014/03/20/getting-started-with-the-java-signalr-sdk/ and downloaded jar files from https://www.mediafire.com/?8qun6hbs3onnbbl. Those jar files were working fine.
However I needed the WebSocket transport protocol which were implemented in the latest version.
I am not sure if removal of previous jar files causing any issues.
Gradle scripts:
signalr-client-sdk
apply plugin: 'java'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.code.gson:gson:2.2.2'
compile 'org.java-websocket:java-websocket:1.3.1'
}
-signalr-client-sdk-android
apply plugin: 'com.android.library'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 8
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile project(':signalr-client-sdk')
}
-My project
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion '21.1.2'
defaultConfig {
applicationId "com.eb5.uvexa.uvexadriver"
minSdkVersion 17
targetSdkVersion 21
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
debug {
debuggable true
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions
{
preDexLibraries=false
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.2.1'
compile files('libs/gson-2.2.2.jar')
compile files('libs/mail.jar')
compile files('libs/activation.jar')
compile files('libs/additionnal.jar')
compile files('libs/signalr-client-sdk.jar')
compile files('libs/signalr-client-sdk-android.jar')
}
I tried clean and rebuild, restarted the pc and also Invalidate option in Android Studio.
I am using windows10 and Android Studio(64). What am I doing wrong?

Related

Android Task 'clean' not found in root project [Jenkins]

I'm using Jenkins to build my android application.
But I'm facing below error
FAILURE: Build failed with an exception.
What went wrong: Task 'clean' not found in root project 'ProjectName'.
Tried this solution but unable to solve my unable
Stackoverflow Solution
Below is my build.gradle
apply plugin: 'com.android.application'
apply plugin:'base'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.xyz.xxx"
minSdkVersion 15
targetSdkVersion 23
versionCode 12
versionName "1.0.2"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
dexOptions {
jumboMode true
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.3.0'
compile files('libs/guava-r09.jar')
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile project(':library')
compile 'com.google.android.gms:play-services-appindexing:8.1.0'
}

Getting more than one library with package name 'com.facebook'

I am doing Facebook Integration and got the following error :
Error:Execution failed for task ':app:processDebugResources'.
> Error: more than one library with package name 'com.facebook'
You can temporarily disable this error with`android.enforceUniquePackageName=false
However, this is temporary and will be enforced in 1.0`
You can check my build.gradle file is as follows,
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.zaptech.latestfacebookintegration"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile project(':facebook')
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
}
Whats the problem is ? Please let me know about it.
You have to remove
compile project(':facebook')
from build.gradle

jdk1.8.0 finished with non-zero exit value 2

My error:
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_20\bin\java.exe'' finished with non-zero exit value 2
I have zero clue where this is coming from. I'm trying to integrate Stripe so possibly it could be a gradle issue.
Stripe is a external library integrated.
App build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.weaverprojects.stripe2"
minSdkVersion 21
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':stripe')
//compile 'com.android.support:support-v4:18.0.+'
compile 'com.google.code.gson:gson:2.3'
compile 'org.parceler:parceler:0.2.13'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup:otto:1.3.6'
compile 'com.squareup.okhttp:okhttp:2.3.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.3.0'
}
Stripe library build.gradle:
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 21
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.stripe:stripe-java:1.15.1'
//compile 'com.google.code.gson:gson:2.2.4'
}
Top level build.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
Settings.gradle:
include ':app', ':stripe'
I had your problem right now, I solved it checking the dependencies ( I had one library with different version of the same dependence) and rebuild the project.
Check also this answer.
So try:
1- Check dependecies and resolve the different versions or conflicts of the same library/dependence
2- Resync Gradle
3- Rebuild the project (this was essential for me)
Sometimes it seems that the problem is caused by the exhaustion of RAM memory (a lot of program opened or android emulator)

Error: more than one library with package name

The Android-studio post a Error
Error:Execution failed for task ':android:processDebugResources'.
Error: more than one library with package name 'com.tencent.weibo.sdk.android.component'
You can temporarily disable this error with android.enforceUniquePackageName=false
However, this is temporary and will be enforced in 1.0
Below is my content of build.gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "21.1.1"
defaultConfig {
applicationId "com.insthub.ecmobile"
minSdkVersion 8
targetSdkVersion 17
testApplicationId "com.insthub.ecmobile.test"
testInstrumentationRunner "android.test.InstrumentationTestRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':androidSDK')
compile project(':alipay_lib')
compile project(':eventBus')
compile 'com.android.support:support-v4:19.1.0'
compile files('libs/Msc.jar')
compile files('libs/UPPayAssistEx.jar')
compile files('libs/UPPayPluginExPro.jar')
compile files('libs/alipay.jar')
compile files('libs/commons-httpclient-3.0.1.jar')
compile files('libs/libammsdk.jar')
compile files('libs/pushservice-3.2.0.jar')
compile files('libs/umeng_sdk.jar')
compile files('libs/universal-image-loader-1.8.6-with-sources.jar')
compile files('libs/weibosdkcore.jar')
compile project(':androidSDKComponent')
}
I can't find "com.tencent.weibo.sdk.android.component"

Android Studio gives me Execution failed for task ':library:proguardRelease' error after updating to Android Studio 1.0.1

I updated my Android Studio to 1.0.1. I followed this tutorial http://tools.android.com/tech-docs/new-build-system/migrating-to-1-0-0 and changed from runProguard to minifyEnabled true. I also changed it in my library project. When I tried to compile it gave me Error:Execution failed for task ':> java.io.FileNotFoundException: ProjectName\library\proguard-rules.txt (The system cannot find the file specified). I researched for that and I found a solution. I added blank proguard-rules.txt file into that folder. After trying to compile, it gave me even more errors. The main error now was that it cannot find symbol class PageIndicator, which is my library's class. I don't even know what can I do for that.
My project's build.gradle:
apply plugin: 'android'
android {
compileSdkVersion 21
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.miesto.meniu"
minSdkVersion 9
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':library')
compile files('libs/volley.jar')
compile 'com.google.android.gms:play-services:6.1.71'
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.android.support:support-v4:21.0.0'
compile 'com.squareup.picasso:picasso:2.3.2'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.slider:library:1.1.0#aar'
compile('com.google.api-client:google-api-client-xml:1.17.0-rc') {
exclude group: 'com.google.android.google-play-services'
}
compile 'com.google.http-client:google-http-client-gson:1.17.0-rc'
compile('com.google.api-client:google-api-client-android:1.17.0-rc') {
exclude group: 'com.google.android.google-play-services'
}
compile 'com.google.apis:google-api-services-drive:v2-rev105-1.17.0-rc'
compile files('libs/YouTubeAndroidPlayerApi.jar')
}
My library's build.gradle:
apply plugin: 'com.android.library'
android {
compileSdkVersion 21
buildToolsVersion "20.0.0"
defaultConfig {
minSdkVersion 9
targetSdkVersion 19
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:21.0.0'
}
What am I doing wrong?
I solved this problem when I deleted my library and added it again.

Categories

Resources