Can't start tests only for specific folder - android

In my android app I has many Espresso's tests.
It's locate in:
/app/src/androidTest/kotlin/com/myproject/android/folder1/
and
/app/src/androidTest/kotlin/com/myproject/android/folder2/
To run all instrumented tests I use this:
gradlew app:connectedAndroidTest
Here output:
10:44:37 V/ddms: execute: returning
> Task :common:connectedAndroidTest
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 7m 43s
97 actionable tasks: 25 executed, 8 from cache, 64 up-to-date
Nice.
But I need to start test only in folder2. I use this:
gradlew app:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=com.myproject.android.activity.*
but I get error:
04:45:23 V/ddms: execute: returning
> Task :app:connectedDebugAndroidTest FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:connectedDebugAndroidTest'.
> Could not generate test report to '\app\build\reports\androidTests\connected'.

Use package instead of class in the test arguments
gradlew app:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.package=com.myproject.android.packageName

Related

Error when running app after updating gradle version - Task :app:generatePackageList FAILED

I'm newbie using react-native and I've been trying to update the gradle version for a few days now..
Currently I use version 6.5, my react-native version is: 0.60.0 I need to update gradle from version 6.5 to version 7.2, but when trying to run the application using this new version of gradle I get the following error:
> Task :app:generatePackageList FAILED
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.2/userguide/command_line_interface.html#sec:command_line_warnings
82 actionable tasks: 1 executed, 81 up-to-date
FAILURE: Build failed with an exception.
* Where:
Script '/projects/xxxxxx/node_modules/#react-native-community/cli-platform-android/native_modules.gradle' line: 137
* What went wrong:
Execution failed for task ':app:generatePackageList'.
> argument type mismatch
In some places I read that possibly the react-native-community version is not compatible with the 7x version of gradle, but I'm still a little lost on the subject and I'm looking for new information.
Thanks in advance for all the help!

FAILURE: Build failed with an exception. - Android

AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{}],"original":"ERROR:: AAPT: D:\android-basics-kotlin-cupcake-app-starter\app\build\intermediates\processed_res\debug\out\resources-debug.ap_: error: The system cannot find the file specified. (2).\nerror: failed to create archive.\n\n ","tool":"AAPT"}
Task :app:mergeDebugNativeLibs
Task :app:mergeExtDexDebug
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugResources'.
A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
Android resource linking failed
ERROR:: AAPT: D:\android-basics-kotlin-cupcake-app-starter\app\build\intermediates\processed_res\debug\out\resources-debug.ap_: error: The system cannot find the file specified. (2).
error: failed to create archive.
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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 7s
27 actionable tasks: 26 executed, 1 up-to-date
Can anyone help me to solve this problem...? please...
This is what happens when aapt fails to create an archive.
First make sure you are using the latest IDE and SDK. aapt for packaging is obsolete, and the earlier aapt2 has many bugs.
If they are up to date, try to check if the following processes on your computer have read/write access to the project directory.
[your android sdk path]\build-tools[your sdk version]\aapt.exe
[your android sdk path]\build-tools[your sdk version]\aapt2.exe
[your android studio path]\bin\studio64.exe
[your android studio path]\bin\fsnotifier64.exe
[your android studio path]\jre\bin\java.exe
[your android studio path]\jre\bin\javaw.exe
If you haven't set permissions manually, they are usually blocked by security software.
I recently ran into this problem and spent a lot of time finally found out that the security software on my workstation was not adding aapt2 and aapt to the allowed list for the project repository.

React Native: Install to virtual/physical device failed

I'm currently using React Native to code my final year project. I have an issue when build and install it to virtual/physical devices althought a month ago it worked fine. Can someone explain to me wwhat wrongs with my code or files? Does it get corrupted? Because I tried to created a blank new file I still get the same errors.
My error:
> Task :app:processDebugResources FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
183 actionable tasks: 2 executed, 181 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
C:\Users\minht\SmartRoom\node_modules\react-native-image-crop-picker\android\build\intermediates\library_manifest\debug\AndroidManifest.xml:10:5-14:15: AAPT: error: unexpected element <queries> found in <manifest>.
* 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 11s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
Seems like you need upgrade Gradle from Android studio and then try if you can run your project from Android Studio.

React native Deprecated Gradle features when Builing apk

I'm trying to build my apk using ./gradlew bundleRelease but I always get this error:
error EISDIR: illegal operation on a directory, open 'P:\React'. Run CLI with --verbose flag for more details.
Error: EISDIR: illegal operation on a directory, open 'P:\React'
> Task :app:bundleReleaseJsAndAssets FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> Process 'command 'npx.cmd'' finished with non-zero exit value 1
* 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings
I also tried ./gradlew app:assembleRelease but I get the same error. I also created my project using npx.
I tried everything, I even updated the project gradle verion but I would still get the same error. But the solution was just this:
cd android
clean your gradle:
./gradlew clean
then:
./gradlew assembleRelease -x bundleReleaseJsAndAssets

React Native: Task :app:installDebug FAILED

I am working on MAC, trying to run React Native on android but it throws this error: Task :app:installDebug FAILED. This is the full error:
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings
27 actionable tasks: 2 executed, 25 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':app:installDebug'.
> File '/Users/vinaysharma/Library/Android/sdk/platform-tools/adb' specified for property 'adbExe' does not exist.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8088
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':app:installDebug'.
> File '/Users/vinaysharma/Library/Android/sdk/platform-tools/adb' specified for property 'adbExe' does not exist.
I've tried reinstalling Android Studio twice as well as creating a new project for RN but that didn't help me out.
I tried this as well: brew cask install android-platform-tools. Thanks.
You need to install adbExe. Please follow steps in this link

Categories

Resources