使用Twitter登录时只能在ins调试中使用,但不能在发行版中使用,在调试中apk的大小也较大。问题出在哪里??
我有3个活动
这是build.grandle
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.PolDevs.MyClickerGame"
minSdkVersion 23
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'com.google.firebase:firebase-auth:19.1.0'
implementation 'com.google.firebase:firebase-database:19.1.0'
implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
implementation 'com.google.firebase:firebase-core:17.2.2'
implementation 'com.twitter.sdk.android:twitter-core:3.1.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
打开所有正在使用的库的文档,并仔细检查它们是否具有要放入proguard
的特定规则,因为在发布版本构建期间已启用该规则。 proguard
进行发行时会混淆您的APK,这意味着删除注释和注释等代码,这也会减小apk的大小。因此,要使某些库起作用,必须在proguard
文件中指定一些规则,以免混淆某些内容。进行调试和发行版本时要注意的常见错误。