就像这里的例子一样,我正在扩展我的构建类型来添加staging:
android {
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
applicationIdSuffix '.debug'
}
staging {
initWith release
applicationIdSuffix '.staging'
}
}
}
Run Code Online (Sandbox Code Playgroud)
但我也有一个依赖:
implementation project(':mylibrary')
Run Code Online (Sandbox Code Playgroud)
编译失败,因为它不知道要配对staging的内容:mylibrary:
* What went wrong:
Could not determine the dependencies of task ':app:compileStagingJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:stagingCompileClasspath'.
> Could not resolve project :mylibrary.
Required by:
project :app
> Unable to find a matching configuration of project :mylibrary:
- …Run Code Online (Sandbox Code Playgroud) 我正在尝试将 flutter 模块添加为我的 Android 项目的 aar 依赖项。这是指南 https://flutter.dev/docs/development/add-to-app/android/project-setup#add-the-flutter-module-as-a-dependency 我能够生成本地 AAR 和我可以看到需要完成以下步骤:
1. Open <host>/app/build.gradle
2. Ensure you have the repositories configured, otherwise add them:
repositories {
maven {
url '/Users/asharma/Documents/Flutter/animation_module/build/host/outputs/repo'
}
maven {
url 'http://download.flutter.io'
}
}
3. Make the host app depend on the Flutter module:
dependencies {
debugImplementation 'com.example.animation_module:flutter_debug:1.0
profileImplementation 'com.example.animation_module:flutter_profile:1.0
releaseImplementation 'com.example.animation_module:flutter_release:1.0
}
4. Add the `profile` build type:
android {
buildTypes {
profile {
initWith debug
}
}
}
Run Code Online (Sandbox Code Playgroud)
在我的Android项目中,我有app模块和library模块。我想将其包含aar在我的 …