Android studio minify enabled=true,无法生成apk?
} 这里,如果我使Android studio minify enabled=true,无法生成apk?,android,android-studio,Android,Android Studio,} 这里,如果我使minify enabled=false代码运行良好,而如果我使用true,则代码显示 信息:Gradle任务[:app:assembleerelease]谷歌服务插件 默认情况下,无法检测com.google.android.gms的任何版本 将使用版本:8.3.0。请在以下位置应用谷歌服务插件: 生成文件的底部:应用程序:预构建最新版本 :app:prerelease生成最新:app:checkReleaseMifest :app:preDebugBuild-TO-DATE
minify enabled=false
代码运行良好,而如果我使用true,则代码显示
信息:Gradle任务[:app:assembleerelease]谷歌服务插件
默认情况下,无法检测com.google.android.gms的任何版本
将使用版本:8.3.0。请在以下位置应用谷歌服务插件:
生成文件的底部:应用程序:预构建最新版本
:app:prerelease生成最新:app:checkReleaseMifest
:app:preDebugBuild-TO-DATE
:app:prepareCommandroidSupportedAnimatedVectorDrawable2330库
最新:应用程序:PrepareCommandroidSupportAppCompatV72330Library
最新:应用程序:PrepareCommandroidSupportCardViewV72330Library
最新:应用程序:PrepareCommandroidSupportDesign2330库最新
:app:PrepareCommandroidSupportMultidex101库最新
:app:PrepareCommandroidSupport回收服务W72330Library最新
:app:PrepareCommandroidSupportV42330库最新
:app:prepareCommandroidSupportVectorDrawable2330库
最新:app:prepareComdaasuAnimateHorizontalProgressBar022图书馆
最新:应用程序:PrepareComFaceBookandIdFaceBookandIdDk482图书馆
最新的
:app:PrepareComgithubaFollestadMaterialDialogScore0856库
最新的
:app:prepareComgithubjakobGrabbenerCircleProgressView128Library
最新:应用程序:prepareComGithubSiyamedAndroidShapeImageview093Library
最新:应用程序:prepareComGithubVlonjatgProgressActivityV103Library
最新的
:app:prepareComgoogleandroidgmsplayservicesanalytics830库
最新:应用程序:prepareComGoogleAndroidGmsPlayServicesBase830Library
最新的
:app:PrepareComgoogleandroidgmsPlayServicesBasement830库
最新:应用程序:prepareComGoogleAndroidGmsPlayServicesGcm830Library
最新的
:app:prepareComGoogleAndroidGmsPlayServicesMeasurement830Library
最新:应用程序:prepareComGoogleAndroidGmsPlayServicesPlus830Library
最新:应用程序:prepareComJakewhartonRxbindingRxbinding040Library
最新:应用程序:PrepareComjakeWhartontimberMember410库最新
:app:prepareComjoanzapataiconifyandroidiconify211最新图书馆
:app:prepareComjoanzapatacionifyandridoconifyfontawesome211图书馆
最新:应用程序:PrepareCommikePenzFastadapter140库最新
:app:prepareComrengWuxianMaterialEdit文本库214库最新
:app:prepareComtrellorXLifecycle040最新库
:app:prepareComtrellorxliFecycleComponent040最新库
:app:prepareOreActiveXRXAndroid110最新库
:app:PrepareOreAlRealMandRoidLibrary0883最新库
:app:prepareme张海AndroidMaterialProgressBar图书馆114图书馆
最新:app:prepareReleaseDependencies:app:compilerReleaseAIDL
:app:compileReleaseRenderscript:app:generateReleaseBuildConfig
:app:generateReleaseAssets最新:app:mergeReleaseAssets
:app:generateReleaseResValues最新
:app:processReleaseGoogleServices:app:generateReleaseResources
:app:mergeReleaseResources:app:ProcessReleaseMifest
:app:processReleaseResources:app:generateReleaseSources
:app:compileReleaseJavaWithJavac注意:某些输入文件使用或
重写不推荐使用的API。注意:使用-Xlint重新编译:对
细节。注意:某些输入文件使用未经检查或不安全的操作。
注意:使用-Xlint重新编译:未选中以获取详细信息。
:app:compileRetrolambdaRelease:app:CompilerLeaseNDK最新版本
:app:compileReleaseSources:app:prepackageArkerForrelease
:app:transformclasses with realmtransformer-orease
:app:processReleaseJavaRes最新
:app:transformResourcesWithMergeJavaResForRelease
:app:TransformClasses和Resources,其中ProguardForRelease作为成员)
警告:有1个对库类成员的未解析引用。
您可能需要更新库版本。
()
警告:处理任务时出现异常java.io.IOException:请
首先更正上述警告。
:app:transformClassesAndResourcesWithProguardForRelease失败
错误:任务的执行失败
“:app:transformClassesAndResourcesWithProguardForRelease”
java.io.IOException:请先更正上述警告。信息:生成失败信息:总时间:27.946秒
信息:1错误信息:91警告信息:请参阅完整
控制台中的输出
如果启用缩小功能,构建将调用Proguard以去除所有不必要的类、成员和方法。 要使其工作,您需要一个proguard配置文件,它将告诉proguard哪些类是您的类入口点,哪些成员和方法应该保留。 您看到的错误是不匹配方法调用的常见错误 该错误包括一个指向手册的链接,对错误进行了更详细的描述:您必须确保使用了正确的Android构建目标,并且保留了所有必要的lib及其方法
尝试在您的属性中调整Android构建目标。如果这不起作用,您必须检查您的proguard配置中是否需要更多条目。我是proguard的新手,请您用一个例子详细说明一下。另外,我正在做的项目是由其他人开发的,所以我不知道完整的项目细节。我开始做这个项目只有3天了,我的第一个目标是缩小apk并删除bug。嗯,您可以从提供的链接中的建议解决方案开始:
您应该将project.properties文件或build.gradle文件中的生成目标更改为该最新版本。您仍然可以在AndroidManifest.xml文件中指定不同的minSdkVersion和不同的targetSdkVersion。
如果这不起作用,您必须查看您的proguard配置文件(将其添加到您的问题中)或创建一个,如果您没有。从零开始为您的项目创建一个新的配置可能有点乏味,因为您有很多外部库。是否有单独的fi
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'realm-android'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultPublishConfig "debug"
defaultConfig {
applicationId "com.youth4work.ibps"
minSdkVersion 16
targetSdkVersion 23
multiDexEnabled true
versionCode 1
versionName "1.0.0"
}
signingConfigs {
release {
storeFile file('keystore/youth4work_second_key')
keyAlias 'youth4work_second_key_alias'
keyPassword "youth4work"
storePassword "youth4work"
}
debug {
storeFile file('keystore/debug.keystore')
keyAlias 'androiddebugkey'
storePassword 'android'
keyPassword 'android'
}
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
versionNameSuffix "Debug"
debuggable true
}
}
lintOptions {
disable 'InvalidPackage'
checkReleaseBuilds false
}
packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
retrolambda {
jvmArgs '-noverify'
}
dependencies {
final PLAY_SERVICES_VERSION = '8.3.0'
final SUPPORT_LIBRARY_VERSION = '23.3.0'
// Google Play Services
compile "com.google.android.gms:play-services-base:$PLAY_SERVICES_VERSION"
compile "com.google.android.gms:play-services- analytics:$PLAY_SERVICES_VERSION"
compile "com.google.android.gms:play-services-gcm:$PLAY_SERVICES_VERSION"
compile "com.google.android.gms:play-services-plus:$PLAY_SERVICES_VERSION"
// Support Libraries
compile "com.android.support:support-v4:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:recyclerview-v7:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:cardview-v7:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:design:$SUPPORT_LIBRARY_VERSION"
compile 'com.android.support:support-annotations:23.3.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.okhttp3:okhttp:3.2.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.2.0'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.squareup.retrofit2:adapter-rxjava:2.0.2'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.jakewharton.timber:timber:4.1.0'
compile 'com.jakewharton.rxbinding:rxbinding:0.4.0'
compile 'com.github.siyamed:android-shape-imageview:0.9.+@aar'
compile 'com.github.kevinsawicki:timeago:1.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.8.2'
compile 'com.rengwuxian.materialedittext:library:2.1.4'
compile 'com.mobsandgeeks:android-saripaar:2.0.2'
compile 'com.joanzapata.iconify:android-iconify-fontawesome:2.1.1'
compile 'com.github.jakob-grabner:Circle-Progress-View:1.2.8'
compile 'com.github.vlonjatg:progress-activity:v1.0.3'
compile 'com.github.PhilJay:MPAndroidChart:v2.2.4'
compile 'com.daasuu:animateHorizontalProgressBar:0.2.2'
compile 'io.reactivex:rxjava:1.1.0'
compile 'io.reactivex:rxandroid:1.1.0'
compile 'com.trello:rxlifecycle:0.4.0'
compile 'com.trello:rxlifecycle-components:0.4.0'
compile('com.github.afollestad.material-dialogs:core:0.8.5.6@aar') {
transitive = true
}
compile('com.mikepenz:fastadapter:1.4.0@aar') {
transitive = true
}
testCompile 'junit:junit:4.12'
}
// Log out test results to console
tasks.matching { it instanceof Test }.all {
testLogging.events = ["failed", "passed", "skipped"]
}