如何在flutter运用中引入自己定义的依赖包
本人在自己定义了一个Android library依赖包
如图:
方式有两中:
方式一
- 打开主程序[以后默认名字为app]的build.gradle.中添加:
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
+ implementation project(':asr_plugin')//自己定义的依赖文件名
}
- 打开需要添加的插件asr_plugin的build.gradle文件
修改 compileSdkVersion,targetSdkVersion 和app中build.gradle中保持一致
compileSdkVersion 28
targetSdkVersion 28
以及
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar']