我现在已经制作了一个应用程序,我想将其迁移到库中,并在其他项目中用作 .aar ,但是当我尝试通过将插件更改为来将其迁移到库中时库和已删除的applicationid我无法为数据绑定生成 BR 参考。这是我的Gradle文件
apply plugin: 'com.android.library'
android {
compileSdkVersion 29
buildToolsVersion "29.0.0"
defaultConfig {
minSdkVersion 21
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'
}
}
dataBinding {
enabled = true
}
dexOptions {
jumboMode true
}
flavorDimensions "version"
productflavors {
dev {
dimension "version"
buildConfigField "boolean","IS_IDProof","true"
buildConfigField 'int','APP_TYPE','2'
buildConfigField "boolean","ALLOW_GALLERY_OPTION","false"
buildConfigField "boolean","ALLOW_MULTIPLE_PRODUCT","false"
}
uat {
dimension "version"
buildConfigField "boolean","false"
}
production {
dimension "version"
buildConfigField "boolean","false"
buildConfigField 'int',"false"
}
} }
dependencies {
def lifecycle_version = "2.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:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
// ViewModel and LiveData
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
implementation 'com.google.android.material:material:1.1.0-alpha10'
implementation 'ch.acra:acra:4.9.2'
implementation 'com.facebook.stetho:stetho:1.5.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'id.zelory:compressor:2.1.0'
implementation 'com.github.clans:fab:1.6.4'
implementation('com.journeyapps:zxing-android-embedded:3.6.0') { transitive = false }
implementation 'com.google.zxing:core:3.3.0'
implementation 'com.github.Gavras:MultiLineRadioGroup:v1.0.0.6'
implementation 'com.getkeepsafe.taptargetview:taptargetview:1.12.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
implementation 'com.iceteck.silicompressorr:silicompressor:2.2.2'
implementation 'com.nex3z:toggle-button-group:1.2.0'
implementation 'com.squareup.picasso:picasso:2.71828'}
我正在使用 androidx ,这可能是这里的原因吗?请让我知道是否缺少将应用程序迁移到库的过程。