配置 SDK 依赖

引入 SDK 包

MiniProgramLib.aar添加到依赖中。可以放到lib目录下。

引入其他依赖包

将小程序SDK依赖的两个包也放入lib目录中,OKJSBridge.aarimageSelector.aar

build.gradle 配置

需要升级 androidx

请在build.gradle中添加下面依赖

dependencies {
...
implementation(name: 'MiniProgramLib-1.0.0', ext: 'aar')
implementation(name: 'OKJSBridge-0.4.0', ext: 'aar')
implementation(name: 'imageSelector-0.3.5', ext: 'aar')

implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'com.squareup.okhttp3:okhttp:3.12.2'

//选择器所依赖的库
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.guava:guava:20.0'
implementation 'io.reactivex.rxjava2:rxjava:2.2.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
implementation 'com.squareup.retrofit2:converter-simplexml:2.5.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.12.2'
implementation 'com.alibaba:fastjson:1.2.41'
implementation 'androidx.multidex:multidex:2.0.0'
implementation "com.facebook.fresco:fresco:2.2.0"
implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0'
...
}
  1. 1. 配置 SDK 依赖
    1. 1.1. 引入 SDK 包
    2. 1.2. 引入其他依赖包
    3. 1.3. build.gradle 配置