I am trying to build a react native app in a github action using the following config file and I am getting the following error. Any idea how to fix this?
name: "Android Build"
on:
workflow_call:
inputs:
environment:
required: true
type: string
publish:
required: false
type: boolean
description: Publish to Appcenter
# secrets:
# NPM_TOKEN:
# required: true
# APP_CENTER_TOKEN_ANDROID:
# required: true
jobs:
build-android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout#v2
- name: Use Node.js 14
uses: actions/setup-node#v3
with:
node-version: 14
cache: "yarn"
- name: Install Node modules
run: |
cd app && yarn ci && cd ..
- name: Cache Gradle Wrapper
uses: actions/cache#v2
with:
path: ~/app/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Cache Gradle Dependencies
uses: actions/cache#v2
with:
path: ~/app/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-caches-
- name: Make Gradlew Executable
run: cd app/android && chmod +x ./gradlew
# Build Command
- name: Build Android ${{inputs.environment == 'release' && 'Release' || 'Debug'}}
run: |
cd app/android && ./gradlew assemble${{inputs.environment == 'release' && 'Release' || 'Debug'}} --no-daemon
# Upload to Artifact
- name: Upload Artifact
uses: actions/upload-artifact#v3
with:
name: FinderUK.aab
path: "android/app/build/outputs/bundle/release/app-release.aab"
Currently detected usages in: root project 'finderUk', project ':amplitude_react-native', project ':app', ...
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:lintVitalDevelopmentRelease'.
> Could not resolve all artifacts for configuration ':app:productionProductionreleaseCompileClasspath'.
> Could not resolve project :amplitude_react-native.
Required by:
project :app
> No matching variant of project :amplitude_react-native was found. The consumer was configured to find an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'productionrelease', attribute 'store' with value 'play', attribute 'default' with value 'production' but:
- Variant 'debugApiElements' capability finderUk:amplitude_react-native:unspecified declares an API of a component:
- Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'productionrelease'
- Other compatible attributes:
- Doesn't say anything about default (required 'production')
- Doesn't say anything about store (required 'play')
- Variant 'debugRuntimeElements' capability finderUk:amplitude_react-native:unspecified declares a runtime of a component:
- Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'productionrelease'
- Other compatible attributes:
- Doesn't say anything about default (required 'production')
- Doesn't say anything about store (required 'play')
- Variant 'releaseApiElements' capability finderUk:amplitude_react-native:unspecified declares an API of a component:
- Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'productionrelease'
- Other compatible attributes:
- Doesn't say anything about default (required 'production')
- Doesn't say anything about store (required 'play')
- Doesn't say anything about store (required 'play')
> Could not resolve project :react-native-vector-icons.
Required by:
project :app
> No matching variant of project :react-native-vector-icons was found. The consumer was configured to find an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'productionrelease', attribute 'store' with value 'play', attribute 'default' with value 'production' but:
- Variant 'debugApiElements' capability finderUk:react-native-vector-icons:unspecified declares an API of a component:
- Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'productionrelease'
- Other compatible attributes:
- Doesn't say anything about default (required 'production')
- Doesn't say anything about store (required 'play')
- Variant 'debugRuntimeElements' capability finderUk:react-native-vector-icons:unspecified declares a runtime of a component:
- Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'productionrelease'
- Other compatible attributes:
- Doesn't say anything about default (required 'production')
- Doesn't say anything about store (required 'play')
- Variant 'releaseApiElements' capability finderUk:react-native-vector-icons:unspecified declares an API of a component:
- Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'productionrelease'
- Other compatible attributes:
- Doesn't say anything about default (required 'production')
- Doesn't say anything about store (required 'play')
- Variant 'releaseRuntimeElements' capability finderUk:react-native-vector-icons:unspecified declares a runtime of a component:
- Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'productionrelease'
- Other compatible attributes:
- Doesn't say anything about default (required 'production')
- Doesn't say anything about store (required 'play')
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Related
I'm trying to build my project to launch it into my Oculus (Meta) Quest 2, the exact build that I'm choosing is Android (ASTC). But when I try to build, I get the following error
UATHelper: Packaging (Android (ASTC)): ERROR: Missing precompiled manifest for 'SteamShared'. This module was most likely not flagged for being included in a precompiled build - set 'PrecompileForTargets = PrecompileTargetsType.Any;' in SteamShared.build.cs to override.
PackagingResults: Error: Missing precompiled manifest for 'SteamShared'. This module was most likely not flagged for being included in a precompiled build - set 'PrecompileForTargets = PrecompileTargetsType.Any;' in SteamShared.build.cs to override.
I added that line PrecompileForTargets = PrecompileTargetsType.Any; to the SteamShared.build.cs file but it didn't change anything, the error persists.
Here's my Project.Build.cs
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "HeadMountedDisplay", "UMG", "LibOVRPlatform"}); //, "OnlineSubsystem"
PrivateDependencyModuleNames.AddRange(new string[] { "FirebaseFeatures", "OnlineSubsystem", "OnlineSubsystemOculus", "OnlineSubsystemSteam" });
So I'm also using the plugin AdvancedSessions & AdvancedSteamSessions. These plugins are in the Engine's plugins but also in the Project's plugins.
But the SteamSharedModule Plugin that's giving me the error is only in the engine (at C:\Epic\UE_4.27\Engine\Plugins\Runtime\Steam), and the OnlineSubsystemSteam Plugin is also only in the engine (at C:\Epic\UE_4.27\Engine\Plugins\Online).
When I try to disable the SteamSharedModule Plugin, it says "This plugin is required by OnlineSubsystemSteam", and when I try to disable the plugin OnlineSubsystemSteam, it says "This plugin is required by AdvancedSteamSessions".
NOTE: The multiplayer functionality I have made it in blueprints, but the project isn't completely in Blueprints, I do have some C++ classes.
Getting the error below when I try to run npm run android to launch a React Native app. Have done npm install --legacy-peer-deps, done a clean git clone, and wiped all user data on the android emulator device.
I have also tried setting android:exported="false" in the AndroidManifest.xml file but get the same error. Android Sdk version 31. Using VSCode as the text editor.
PS C:\Velocity\Velocity-React-Native\app> npm run android
> app#0.0.1 preandroid
> python ./preCompile/parse_game_data.py
> app#0.0.1 android
> gulp set --env=dev && react-native run-android
[18:45:27] Using gulpfile C:\Velocity\Velocity-React-Native\app\gulpfile.js
[18:45:27] Starting 'set'...
[18:45:27] Starting 'del'...
[18:45:27] Finished 'del' after 19 ms
[18:45:27] Starting 'move'...
[18:45:27] Finished 'move' after 15 ms
[18:45:27] Finished 'set' after 37 ms
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1688 file(s) to forward-jetify. Using 12 workers...
info Starting JS server...
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
> Configure project :react-native-firebase_analytics
:react-native-firebase_analytics package.json found at C:\Velocity\Velocity-React-Native\app\node_modules\#react-native-firebase\analytics\package.json
:react-native-firebase_app package.json found at C:\Velocity\Velocity-React-Native\app\node_modules\#react-native-firebase\app\package.json
:react-native-firebase_analytics:firebase.bom using default value: 29.1.0
:react-native-firebase_analytics package.json found at C:\Velocity\Velocity-React-Native\app\node_modules\#react-native-firebase\analytics\package.json
:react-native-firebase_analytics:version set from package.json: 14.9.1 (14,9,1 - 14009001)
:react-native-firebase_analytics:android.compileSdk using custom value: 31
:react-native-firebase_analytics:android.targetSdk using custom value: 31
:react-native-firebase_analytics:android.minSdk using custom value: 21
:react-native-firebase_analytics:reactNativeAndroidDir C:\Velocity\Velocity-React-Native\app\node_modules\react-native\android
> Configure project :react-native-firebase_app
:react-native-firebase_app package.json found at C:\Velocity\Velocity-React-Native\app\node_modules\#react-native-firebase\app\package.json
:react-native-firebase_app:firebase.bom using default value: 29.1.0
:react-native-firebase_app:play.play-services-auth using default value: 20.1.0
:react-native-firebase_app package.json found at C:\Velocity\Velocity-React-Native\app\node_modules\#react-native-firebase\app\package.json
:react-native-firebase_app:version set from package.json: 14.9.1 (14,9,1 - 14009001)
:react-native-firebase_app:android.compileSdk using custom value: 31
:react-native-firebase_app:android.targetSdk using custom value: 31
:react-native-firebase_app:android.minSdk using custom value: 21
:react-native-firebase_app:reactNativeAndroidDir C:\Velocity\Velocity-React-Native\app\node_modules\react-native\android
> Configure project :react-native-firebase_auth
:react-native-firebase_auth package.json found at C:\Velocity\Velocity-React-Native\app\node_modules\#react-native-firebase\auth\package.json
:react-native-firebase_app package.json found at C:\Velocity\Velocity-React-Native\app\node_modules\#react-native-firebase\app\package.json
:react-native-firebase_auth:firebase.bom using default value: 29.1.0
:react-native-firebase_auth package.json found at C:\Velocity\Velocity-React-Native\app\node_modules\#react-native-firebase\auth\package.json
:react-native-firebase_auth:version set from package.json: 14.9.1 (14,9,1 - 14009001)
:react-native-firebase_auth:android.compileSdk using custom value: 31
:react-native-firebase_auth:android.targetSdk using custom value: 31
:react-native-firebase_auth:android.minSdk using custom value: 21
:react-native-firebase_auth:reactNativeAndroidDir C:\Velocity\Velocity-React-Native\app\node_modules\react-native\android
> Configure project :react-native-firebase_database
:react-native-firebase_database package.json found at C:\Velocity\Velocity-React-Native\app\node_modules\#react-native-firebase\database\package.json
:react-native-firebase_app package.json found at C:\Velocity\Velocity-React-Native\app\node_modules\#react-native-firebase\app\package.json
:react-native-firebase_database:firebase.bom using default value: 29.1.0
:react-native-firebase_database package.json found at C:\Velocity\Velocity-React-Native\app\node_modules\#react-native-firebase\database\package.json
:react-native-firebase_database:version set from package.json: 14.9.1 (14,9,1 - 14009001)
:react-native-firebase_database:android.compileSdk using custom value: 31
:react-native-firebase_database:android.targetSdk using custom value: 31
:react-native-firebase_database:android.minSdk using custom value: 21
:react-native-firebase_database:reactNativeAndroidDir C:\Velocity\Velocity-React-Native\app\node_modules\react-native\android
> Configure project :react-native-firebase_firestore
:react-native-firebase_firestore package.json found at C:\Velocity\Velocity-React-Native\app\node_modules\#react-native-firebase\firestore\package.json
:react-native-firebase_app package.json found at C:\Velocity\Velocity-React-Native\app\node_modules\#react-native-firebase\app\package.json
:react-native-firebase_firestore:firebase.bom using default value: 29.1.0
:react-native-firebase_firestore package.json found at C:\Velocity\Velocity-React-Native\app\node_modules\#react-native-firebase\firestore\package.json
:react-native-firebase_firestore:version set from package.json: 14.9.1 (14,9,1 - 14009001)
:react-native-firebase_firestore:android.compileSdk using custom value: 31
:react-native-firebase_firestore:android.targetSdk using custom value: 31
:react-native-firebase_firestore:android.minSdk using custom value: 21
:react-native-firebase_firestore:reactNativeAndroidDir C:\Velocity\Velocity-React-Native\app\node_modules\react-native\android
> Configure project :react-native-firebase_functions
:react-native-firebase_functions package.json found at C:\Velocity\Velocity-React-Native\app\node_modules\#react-native-firebase\functions\package.json
:react-native-firebase_app package.json found at C:\Velocity\Velocity-React-Native\app\node_modules\#react-native-firebase\app\package.json
:react-native-firebase_functions:firebase.bom using default value: 29.1.0
:react-native-firebase_functions package.json found at C:\Velocity\Velocity-React-Native\app\node_modules\#react-native-firebase\functions\package.json
:react-native-firebase_functions:version set from package.json: 14.9.1 (14,9,1 - 14009001)
:react-native-firebase_functions:android.compileSdk using custom value: 31
:react-native-firebase_functions:android.targetSdk using custom value: 31
:react-native-firebase_functions:android.minSdk using custom value: 21
:react-native-firebase_functions:reactNativeAndroidDir C:\Velocity\Velocity-React-Native\app\node_modules\react-native\android
> Configure project :react-native-firebase_storage
:react-native-firebase_storage package.json found at C:\Velocity\Velocity-React-Native\app\node_modules\#react-native-firebase\storage\package.json
:react-native-firebase_app package.json found at C:\Velocity\Velocity-React-Native\app\node_modules\#react-native-firebase\app\package.json
:react-native-firebase_storage:firebase.bom using default value: 29.1.0
:react-native-firebase_storage package.json found at C:\Velocity\Velocity-React-Native\app\node_modules\#react-native-firebase\storage\package.json
:react-native-firebase_storage:version set from package.json: 14.9.1 (14,9,1 - 14009001)
:react-native-firebase_storage:android.compileSdk using custom value: 31
:react-native-firebase_storage:android.targetSdk using custom value: 31
:react-native-firebase_storage:android.minSdk using custom value: 21
:react-native-firebase_storage:reactNativeAndroidDir C:\Velocity\Velocity-React-Native\app\node_modules\react-native\android
> Configure project :react-native-reanimated
AAR for react-native-reanimated has been found
C:\Velocity\Velocity-React-Native\app\node_modules\react-native-reanimated\android\react-native-reanimated-68-hermes.aar
> Configure project :storyly-react-native
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
> Task :app:processDebugMainManifest FAILED
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
208 actionable tasks: 2 executed, 206 up-to-date
C:\Velocity\Velocity-React-Native\app\android\app\src\debug\AndroidManifest.xml:27:9-33:20 Error:
android:exported needs to be explicitly specified for element <activity#androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
C:\Velocity\Velocity-React-Native\app\android\app\src\debug\AndroidManifest.xml:34:9-40:20 Error:
android:exported needs to be explicitly specified for element <activity#androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Manifest merger failed with multiple errors, see logs
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 27s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
C:\Velocity\Velocity-React-Native\app\android\app\src\debug\AndroidManifest.xml:27:9-33:20 Error:
android:exported needs to be explicitly specified for element <activity#androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
C:\Velocity\Velocity-React-Native\app\android\app\src\debug\AndroidManifest.xml:34:9-40:20 Error:
android:exported needs to be explicitly specified for element <activity#androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Manifest merger failed with multiple errors, see logs
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 27s
at makeError (C:\Velocity\Velocity-React-Native\app\node_modules\execa\index.js:174:9)
at C:\Velocity\Velocity-React-Native\app\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (C:\Velocity\Velocity-React-Native\app\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (C:\Velocity\Velocity-React-Native\app\node_modules\react-native\node_modules\#react-native-community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.
Here is my build.gradle file:
import org.apache.tools.ant.taskdefs.condition.Os
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "31.0.0"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
kotlin_version = '1.6.10'
googlePlayServicesAuthVersion = "19.2.0"
if (System.properties['os.arch'] == "aarch64") {
// For M1 Users we need to use the NDK 24 which added support for aarch64
ndkVersion = "24.0.8215888"
} else if (Os.isFamily(Os.FAMILY_WINDOWS)) {
// For Android Users, we need to use NDK 23, otherwise the build will
// fail due to paths longer than the OS limit
ndkVersion = "23.1.7779620"
} else {
// Otherwise we default to the side-by-side NDK version from AGP.
ndkVersion = "21.4.7075529"
}
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath('com.android.tools.build:gradle:7.1.3')
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:4.1.2")
classpath "com.google.gms:google-services:4.3.10"
classpath "com.google.android.gms:play-services-auth:20.1.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.30")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}
google()
maven { url 'https://www.jitpack.io' }
}
}
Here is my AndroidManifest.xml file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.app">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:name=".MainApplication"
android:label="#string/app_name"
android:icon="#mipmap/ic_launcher"
android:roundIcon="#mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="#style/AppTheme">
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="#string/facebook_app_id"/>
<meta-data android:name="com.facebook.sdk.ClientToken" android:value="#string/facebook_client_token"/>
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustPan"
android:exported="true"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Look like it's happening by jitpack.io down, try adding this in android/app/build.gradle
implementation "androidx.test:core:1.4.0" (add to dependencies)
After updating 'com.android.tools.build:gradle' from version 4.1.3 to 4.2.0, I started to get an error that 'manifestPlaceholders' are no longer merged into the manifest when running unit tests. Everything works fine when I run the app. It just fails when running tests.
defaultConfig {
(...)
manifestPlaceholders = [
myPlaceholder1: "some_value_1",
myPlaceholder2: "some_value_2"
]
}
Any unit test in the "test" folder now fails with this message:
> Task :myLib:processDebugUnitTestManifest FAILED
/myProject/source/android/myProject/build/intermediates/tmp/manifest/test/debug/manifestMerger684952061703372993.xml Error:
Attribute attribute1 at manifestMerger684952061703372993.xml requires a placeholder substitution but no value for <myPlaceholder1> is provided.
/myProject/source/android/myProject/build/intermediates/tmp/manifest/test/debug/manifestMerger684952061703372993.xml Error:
Attribute attribute2 at manifestMerger684952061703372993.xml requires a placeholder substitution but no value for <myPlaceholder2> is provided.
I had to downgrade again to version 4.1.3. Anyone has any solution for this?
This is a specific work around here, as my issues stemmed from the required manifestPlaceHolders for the Auth0 library. I was able to work around the manifest merger issue on the unit tests build by adding a manifest to each modules unit test directory (not AndroidTest directory). The manifest I used just disabled the need for the placeholders by removing the activities that required it:
https://github.com/openid/AppAuth-Android/blob/master/library/javatests/AndroidManifest.xml
Perhaps if that manifest doesn't work for you could add the placeholders directly to the manifest in the unit test directory. I didn't try this but that might be a path forward.
I'm stuck listing transitive closure of runtime dependencies in Gradle Android project. Trying to do it like this:
task listDependencies {
doLast {
def configuration = project.configurations.debugRuntimeClasspath
for (file in configuration.files) {
println(file)
}
}
}
However, this produces following error:
Execution failed for task ':***:listDependencies'.
> Could not resolve all files for configuration ':***:debugRuntimeClasspath'.
> The consumer was configured to find a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug'. However we cannot choose between the following variants of project :***:
- Configuration ':***:debugRuntimeElements' variant android-aar-metadata declares a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug':
- Unmatched attributes:
- Provides attribute 'artifactType' with value 'android-aar-metadata' but the consumer didn't ask for it
- Provides attribute 'com.android.build.api.attributes.VariantAttr' with value 'debug' but the consumer didn't ask for it
- Configuration ':***:debugRuntimeElements' variant android-assets declares a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug':
- Unmatched attributes:
- Provides attribute 'artifactType' with value 'android-assets' but the consumer didn't ask for it
- Provides attribute 'com.android.build.api.attributes.VariantAttr' with value 'debug' but the consumer didn't ask for it
- Configuration ':***:debugRuntimeElements' variant android-classes-directory declares a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug':
Here's my main project structure:
App/src
- main
- flavor1
- flavor2
- dimension1
- dimension2
- debug
- release
Both flavor* and dimension* are flavor dimensions. The build variants are:
flavor1Dimension1Debug
flavor1Dimension2Debug
flavor2Dimension1Debug
...
And library's dir structure:
Lib/src
- main
- flavor2
- DebugInterceptor.java
- debug
- DebugInterceptor.java
- release
- DebugInterceptor.java
What I want:
if variant contains 'flavor2', this variant should use src/flavor2/DebugInterceptor.java. It should take higher priority than build types. You can assume that these three dirs(flavor2, debug, release) contain only one file DebugInterceptor.java
o.w. merging by default build rules.
How can I configure gradle to achieve this?
use only one dimension and multiple flavor, don't use multiple dimension or remove code from dimension, dimension is not suitable for code but for other configs like api level