集成 pdk (pinterest sdk) 时出错
Error on integrating pdk (pinterest sdk )
我想整合 pinterest 以在 pinterest 上分享 link。为此,我从 official document.
下载了 pdk
但是当我尝试 运行 应用程序时,我遇到了一些编译错误,因为遵循 类 org.apache.http.NameValuePair
和 org.apache.http.client.utils.URLEncodedUtils
。但是,在那之后,我遇到了一些 proguard 问题,我添加了所需的语句。
大多数错误通过在 pdk 模块的 proguard-rules.pro 文件中添加以下行来解决。
-libraryjars libs\android-support-v4.jar
-libraryjars <java.home>\lib\rt.jar
-dontwarn org.apache.commons.**
-keep class org.apache.http.** { *; }
-dontwarn org.apache.http.**
-dontwarn org.codehaus.jackson.**
-keep class org.codehaus.jackson.** { *; }
但是,我仍然面临这些警告的一些问题:
library class com.fasterxml.jackson.core.util.DefaultPrettyPrinter$Lf2SpacesIndenter extends or implements program class com.fasterxml.jackson.core.util.DefaultPrettyPrinter$NopIndenter
com.fasterxml.jackson.databind.util.TokenBuffer$Parser: can't find referenced method 'com.fasterxml.jackson.core.json.JsonReadContext createRootContext(int,int)' in program class com.fasterxml.jackson.core.json.JsonReadContext
there were 1 instances of library classes depending on program classes.
there were 1 unresolved references to program class members.
Exception while processing task java.io.IOException: Please correct the above warnings first.
有人知道如何解决这个问题吗?
build.gradle pdk 模块的文件
apply plugin: 'com.android.library'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
useLibrary 'org.apache.http.legacy'
defaultConfig {
minSdkVersion 14
targetSdkVersion 27
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.mcxiaoke.volley:library:1.0.19'
// implementation 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
implementation 'com.google.http-client:google-http-client-android:1.25.0'
implementation 'com.google.api-client:google-api-client-android:1.25.0'
implementation 'com.google.api-client:google-api-client-gson:1.25.0'
}
请帮我解决这些错误谢谢。
我通过在混淆器中添加这些行解决了错误
-dontwarn com.fasterxml.jackson.**
-keep class com.fasterxml.jackson.** { *;}
我想整合 pinterest 以在 pinterest 上分享 link。为此,我从 official document.
下载了 pdk但是当我尝试 运行 应用程序时,我遇到了一些编译错误,因为遵循 类 org.apache.http.NameValuePair
和 org.apache.http.client.utils.URLEncodedUtils
。但是,在那之后,我遇到了一些 proguard 问题,我添加了所需的语句。
大多数错误通过在 pdk 模块的 proguard-rules.pro 文件中添加以下行来解决。
-libraryjars libs\android-support-v4.jar
-libraryjars <java.home>\lib\rt.jar
-dontwarn org.apache.commons.**
-keep class org.apache.http.** { *; }
-dontwarn org.apache.http.**
-dontwarn org.codehaus.jackson.**
-keep class org.codehaus.jackson.** { *; }
但是,我仍然面临这些警告的一些问题:
library class com.fasterxml.jackson.core.util.DefaultPrettyPrinter$Lf2SpacesIndenter extends or implements program class com.fasterxml.jackson.core.util.DefaultPrettyPrinter$NopIndenter
com.fasterxml.jackson.databind.util.TokenBuffer$Parser: can't find referenced method 'com.fasterxml.jackson.core.json.JsonReadContext createRootContext(int,int)' in program class com.fasterxml.jackson.core.json.JsonReadContext
there were 1 instances of library classes depending on program classes.
there were 1 unresolved references to program class members.
Exception while processing task java.io.IOException: Please correct the above warnings first.
有人知道如何解决这个问题吗?
build.gradle pdk 模块的文件
apply plugin: 'com.android.library'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
useLibrary 'org.apache.http.legacy'
defaultConfig {
minSdkVersion 14
targetSdkVersion 27
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.mcxiaoke.volley:library:1.0.19'
// implementation 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
implementation 'com.google.http-client:google-http-client-android:1.25.0'
implementation 'com.google.api-client:google-api-client-android:1.25.0'
implementation 'com.google.api-client:google-api-client-gson:1.25.0'
}
请帮我解决这些错误谢谢。
我通过在混淆器中添加这些行解决了错误
-dontwarn com.fasterxml.jackson.**
-keep class com.fasterxml.jackson.** { *;}