相关疑难解决方法(0)

如何在应用程序中添加比库更多的构建类型

就像这里的例子一样,我正在扩展我的构建类型来添加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)

android gradle

7
推荐指数
1
解决办法
1605
查看次数

找不到通过 Flutter Module 构建的本地 aar

我正在尝试将 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在我的 …

android gradle flutter flutter-dependencies

6
推荐指数
1
解决办法
1854
查看次数

标签 统计

android ×2

gradle ×2

flutter ×1

flutter-dependencies ×1