android-gradle-plugin

Android Studio - Gradle generate specific javadoc files

旧巷老猫 提交于 2021-02-07 13:36:40
问题 I need to generate some javadoc for a project that contains 3 modules, and I only need specific files from each module. In Android Studio I can go Tools -> Generate JavaDoc and then set custom scope, and selectively choose the files I want and it aggregates them into a single javadoc folder, but this won't work for our automated build. I can't figure out how to do this on the gradle command line? Every example is some variation of this task task javadoc(type: Javadoc) { source = android

Android Studio create a build variant / type excluding jniLibs?

倖福魔咒の 提交于 2021-02-07 13:30:19
问题 I have an Android application that uses a native JNI library. I put it into app/src/main/jniLibs/armeabi-v7a without any gradle configuration and Android studio happily bundles it into the APK. I have a requirement where all native libraries cannot be bundled with a certain distribution. Is it possible to create a build variant or build type that simply excludes all native libraries (maybe even by name .so ). The fact that the native library is missing in this distribution doesn't matter

Android Studio create a build variant / type excluding jniLibs?

末鹿安然 提交于 2021-02-07 13:28:23
问题 I have an Android application that uses a native JNI library. I put it into app/src/main/jniLibs/armeabi-v7a without any gradle configuration and Android studio happily bundles it into the APK. I have a requirement where all native libraries cannot be bundled with a certain distribution. Is it possible to create a build variant or build type that simply excludes all native libraries (maybe even by name .so ). The fact that the native library is missing in this distribution doesn't matter

Android Studio not using Gradle jvmArgs when running tests?

陌路散爱 提交于 2021-02-07 12:32:28
问题 I have an Android library with a JUnit test that only passes if it is run with the -noverify flag passed to the JVM (I believe because of this). The test will pass if it is run from the command line as long as I tell Gradle to pass that flag by adding this to my build.gradle file: android { testOptions.unitTests { all { jvmArgs '-noverify' } } } I thought that Android Studio would pick that up and use that flag to run the tests as well, but that does not seem to be the case. In order to get

Android studio: Parameter 'directory' is not a directory

有些话、适合烂在心里 提交于 2021-02-07 12:22:13
问题 When I try to build my project, I get such a mistake: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:dataBindingGenBaseClassesDebug'. > Parameter 'directory' is not a directory 回答1: From an answer to a similar question: Delete the .gradle directory (in the project base directory) Invalidate Caches and restart Android Studio. 来源: https://stackoverflow.com/questions/63372379/android-studio-parameter-directory-is-not-a-directory

Gradle assemble specific flavor and build

杀马特。学长 韩版系。学妹 提交于 2021-02-07 11:59:42
问题 Running ./gradlew tasks shows options to assemble all builds for a particular flavor, or all flavors for a particular build. Does there exist an option to assemble for a specific flavor and build combination? 回答1: Yes - you're referring to a specific build variant ./gradlew assembleFlavoraBuildb Where your flavor is called flavora and your build is buildb Read more here: http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Building-and-Tasks 来源: https://stackoverflow.com

React Native Unable to find a matching configuration of project (Build only)

旧巷老猫 提交于 2021-02-07 11:16:17
问题 My react native build works fine when running react-native run-android or cd android && ./gradlew assembleDebug . But I'll get the following for all every react native package I have installed when running ./gradlew assembleRelease > Could not resolve project :react-native-fbsdk. Required by: project :app > Unable to find a matching configuration of project :react-native-fbsdk: - Configuration 'debugApiElements': - Required com.android.build.api.attributes.BuildTypeAttr 'releaseStaging' and

React Native Unable to find a matching configuration of project (Build only)

江枫思渺然 提交于 2021-02-07 11:14:01
问题 My react native build works fine when running react-native run-android or cd android && ./gradlew assembleDebug . But I'll get the following for all every react native package I have installed when running ./gradlew assembleRelease > Could not resolve project :react-native-fbsdk. Required by: project :app > Unable to find a matching configuration of project :react-native-fbsdk: - Configuration 'debugApiElements': - Required com.android.build.api.attributes.BuildTypeAttr 'releaseStaging' and

Cannot find opencv2 in Android Studio

本秂侑毒 提交于 2021-02-07 04:26:00
问题 I am trying to write a C++ file in Android Studio and I would like to use OpenCV in my project. However, when I try to use the following includes, I get an error saying Cannot Find 'opencv2' . #include <opencv2/core.hpp> #include <opencv2/imgproc.hpp> #include <opencv2/features2d.hpp> To set up OpenCV in Android, you have to take the following steps, found here, to use the Java part of OpenCV in Android Studio. To the best of my knowledge to use the C++ part of OpenCV in Android Studio, you

Cannot find opencv2 in Android Studio

喜欢而已 提交于 2021-02-07 04:25:16
问题 I am trying to write a C++ file in Android Studio and I would like to use OpenCV in my project. However, when I try to use the following includes, I get an error saying Cannot Find 'opencv2' . #include <opencv2/core.hpp> #include <opencv2/imgproc.hpp> #include <opencv2/features2d.hpp> To set up OpenCV in Android, you have to take the following steps, found here, to use the Java part of OpenCV in Android Studio. To the best of my knowledge to use the C++ part of OpenCV in Android Studio, you