当我导入 weiboSDKCore_3.1.4.jar 和 libweibosdkcore.so 时,构建版本.apk文件并不起作用。
此路径中的weiboSDKCore_3.1.4.jar : app / libs /
此路径中的libweibosdkcore.so : app / src / main / jniLibs /
的build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
android {
compileSdkVersion 24
buildToolsVersion '24.0.2'
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.aaaa.bbbb"
minSdkVersion 19
targetSdkVersion 24
versionCode 20161019
versionName "2.1.1"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/services/javax.annotation.processing.Processor'
lintOptions {
abortOnError false
}
}
}
buildscript {
repositories {
jcenter()
maven {
url "http://mvn.leancloud.cn/nexus/content/repositories/releases"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
}
}
allprojects {
repositories {
jcenter()
maven {
url "http://mvn.leancloud.cn/nexus/content/repositories/releases"
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.google.android:flexbox:0.2.3'
compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.android.support:recyclerview-v7:24.2.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:support-v4:24.2.1'
compile 'com.github.bumptech.glide:okhttp3-integration:1.4.0@aar'
compile 'com.bigkoo:convenientbanner:2.0.5'
compile 'com.code19.library:library:0.1.0'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.squareup.okhttp3:okhttp:3.3.1'
compile 'com.squareup.okio:okio:1.8.0'
compile 'com.zhy:okhttputils:2.6.2'
compile 'jp.wasabeef:glide-transformations:2.0.1'
compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.3.0'
compile 'com.pingxx:pingpp-core:2.1.+'
compile 'com.pingxx:pingpp-alipay:2.1.+'
compile 'com.pingxx:pingpp-wxpay:2.1.+'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'com.lovedise:permissiongen:0.0.6'
compile 'com.github.anzewei:parallaxbacklayout:0.4'
compile 'cn.leancloud.android:avoscloud-sdk:v3.14.5'
compile('cn.leancloud.android:avoscloud-push:v3.+@aar') { transitive = true }
compile 'com.jakewharton:butterknife:8.4.0'
apt 'com.jakewharton:butterknife-compiler:8.4.0'
compile 'com.facebook.fresco:fresco:0.12.0'
compile files('libs/MiPush_SDK_Client_3_1_2.jar')
compile files('src/main/jniLibs/BaiduLBS_Android.jar')
compile 'cn.bingoogolapple:bga-banner:2.0.4@aar'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.basecamp:turbolinks:1.0.4'
compile 'com.umeng.analytics:analytics:latest.integration'
compile 'com.sensorsdata.analytics.android:SensorsAnalyticsSDK:latest.integration'
compile files('libs/weiboSDKCore_3.1.4.jar')
}
我构建了3次,错误消息为:
Error: at java.util.zip.ZipFile.getInputStream(ZipFile.java:374)
Error: at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:270)
Error:java.lang.OutOfMemoryError: GC overhead limit exceeded
Error:UNEXPECTED TOP-LEVEL ERROR:
Error: at java.util.zip.ZipFile$ZipFileInflaterInputStream.<init>(ZipFile.java:393)
Error: at java.util.zip.InflaterInputStream.<init>(InflaterInputStream.java:187)
Error: at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
Error: at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
Error: at com.android.dx.command.dexer.Main.processOne(Main.java:677)
Error: at com.android.dx.command.dexer.Main.processAllFiles(Main.java:569)
Error: at com.android.dx.command.dexer.Main.runMultiDex(Main.java:366)
Error: at com.android.dx.command.dexer.Main.run(Main.java:275)
Error: at com.android.dx.command.dexer.Main.main(Main.java:245)
Error: at com.android.dx.command.Main.main(Main.java:106)
Error:Execution failed for task ':app:transformClassesWithDexForJDXLRelease'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException
Error:Uncaught translation error: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded
Error:1 error; aborting
Error:Execution failed for task ':app:transformClassesWithDexForJDXLRelease'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException
Error:UNEXPECTED TOP-LEVEL ERROR:
Error:java.lang.OutOfMemoryError: GC overhead limit exceeded
Error:Execution failed for task ':app:transformClassesWithDexForJDXLRelease'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException:
java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException
希望有人可以教我一两件事? :(
答案 0 :(得分:0)
您可以在此处找到问题背后的原因。 http://www.oracle.com/technetwork/java/javase/gc-tuning-6-140523.html#par_gc.oom
您还可以在上面的链接中找到禁用垃圾收集功能的选项。