Java 迁移到androidX后,应用程序大小增加一倍
我有一个以前大小为51MB的应用程序。我需要将编译后的sdk版本升级到29,因此我将我的应用程序迁移到androidx布局。但现在,当我发布应用程序时,它的大小已经是107MB的两倍。我很困惑我该怎么办。我分析了apk,大部分应用程序的大小都是因为lib文件夹。我检查了以前版本的apk,其中lib文件夹有51MBJava 迁移到androidX后,应用程序大小增加一倍,java,android,android-studio,Java,Android,Android Studio,我有一个以前大小为51MB的应用程序。我需要将编译后的sdk版本升级到29,因此我将我的应用程序迁移到androidx布局。但现在,当我发布应用程序时,它的大小已经是107MB的两倍。我很困惑我该怎么办。我分析了apk,大部分应用程序的大小都是因为lib文件夹。我检查了以前版本的apk,其中lib文件夹有51MB apply plugin: 'com.android.application' android { compileSdkVersion 29 buildToolsVe
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
useLibrary 'org.apache.http.legacy'
testOptions {
unitTests.returnDefaultValues = true
}
defaultConfig {
applicationId "com.i2vsys.i2vApp"
minSdkVersion 24
targetSdkVersion 29
versionCode 11
versionName "7"
}
lintOptions {
disable "ResourceType"
}
buildTypes {
debug {
debuggable true
jniDebuggable true
renderscriptDebuggable true
}
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
jniDebuggable false
renderscriptDebuggable false
zipAlignEnabled true
}
}
}
dependencies {
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
// compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(dir: "$buildDir/native-libs", include: 'native-libs.jar')
implementation 'com.github.bmelnychuk:atv:1.2.+'
implementation 'com.github.johnkil.print:print:1.2.2'
//noinspection GradleCompatible
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.squareup.retrofit:retrofit:1.9.0'
implementation 'com.google.code.gson:gson:2.3.1'
implementation 'org.parceler:parceler-api:0.2.15'
// compile 'com.android.support:support-v4:21.0.3'
implementation 'com.google.android.material:material:1.0.0'
implementation 'commons-io:commons-io:2.4' // Apache commons for i/o
implementation 'io.github.memfis19:annca:0.3.5'
implementation 'net.gotev:uploadservice:3.2.3'
compile files('libs/org.eclipse.paho.client.mqttv3-1.0.2.jar')
compile files('libs/universal-image-loader-1.9.5.jar')
compile files('libs/uploadservice-3.0-javadoc.jar')
compile files('libs/org.apache.http.legacy.jar')
implementation 'com.roughike:bottom-bar:1.3.5'
implementation 'de.mrmaffen:libvlc-android:2.1.12@aar'
implementation 'com.loopj.android:android-async-http:1.4.9'
我还观察到,apk大小曾经达到150 mb,然后我清理了解决方案,apk大小减小了,当我通过usb安装它时,开发它的大小只有35 mb。那么,在那些
lib
子目录中有哪些库?你需要所有的吗?不需要。我怎样才能把它们拿走?