I am encountering the error: java.lang.ClassNotFoundException: org.glassfish.jersey.client.JerseyClientBuilder however i have imported the classes so am not sure why it is popping up. My build.gradle and code is below:
private String getAccessToken() {
try {
Log.e("tree","get access entered");
javax.ws.rs.client.Client client = javax.ws.rs.client.ClientBuilder.newClient();
javax.ws.rs.client.Entity<String> payload =
javax.ws.rs.client.Entity.text("grant_type=client_credentials&redirect_uri=https://facebook.com/intellidevco");
javax.ws.rs.core.Response response = client.target("https://v2.api.xapo.com/oauth2/token")
.request(MediaType.TEXT_PLAIN_TYPE)
.header("Authorization","Basic MjVjMDZjZDU3M2FmNDFjYzo4NjE4ZWY2NDE1MDI0MTE3YjhiOTI3YzhkZmQ1NmZlMw==")
.post(payload);
Log.e("tree","response completed");
String body = response.readEntity(String.class);
Log.e("tree","body "+body);
} catch(Exception e) {
Log.e("tree","token exception "+e.getMessage());
}
retu "";
}
build.gradle
apply plugin: 'com.android.application'
android {
signingConfigs {
config {
keyAlias 'intellidev'
keyPassword 'Kralking94!'
storeFile file('E:/WorkSpace/key.jks')
storePassword 'Kralking94!'
}
}
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.intellidev.faucetpro"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
}
dexOptions {
javaMaxHeapSize "4g"
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/maven/commons-io/commons-io/pom.xml'
exclude 'META-INF/maven/commons-io/commons-io/pom.properties'
exclude 'META-INF/ASL2.0'
}
}
repositories {
maven {
url "https://dl.bintray.com/supersonic/android-sdk"
}
mavenCentral()
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'org.sharegov:mjson:1.3'
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile 'org.bouncycastle:bcprov-jdk16:1.46'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.supersonic.sdk:mediationsdk:6.3.6@jar'
compile 'com.parse.bolts:bolts-android:1.+'
compile 'com.parse:parse-android:1.+'
compile 'org.glassfish.jersey.core:jersey-common:2.8'
compile 'org.glassfish.jersey.media:jersey-media-json-jackson:2.8'
compile 'com.google.code.gson:gson:2.4'
compile 'com.orhanobut:dialogplus:1.11@aar'
compile 'me.grantland:autofittextview:0.2.+'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'org.apache.commons:commons-io:1.3.2'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.google.android.gms:play-services-ads:8.4.0'
compile 'com.google.android.gms:play-services-analytics:8.4.0'
compile 'com.google.android.gms:play-services-auth:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
}
apply plugin: 'com.google.gms.google-services'
