[Troubleshooting]: Command line is too long. Shorten command line for [Your test class] or also for Android JUnit default configuration

Last updated November 1, 2022 at 11:17 AM

During the unit test of your android application, you encounter this error: Command line is too long. Shorten command line for [Your test class] or also for Android JUnit default configuration.

Migration from linux to windows source code of our android application file search was not without problems. We have experienced issues after updating libraries which comes in the form of the error Illegal Class File: Class Module-Info is Missing A Super Type. Class File version 53. Now we will fix a unit test execution problem under android studio. While running our unit test, we found the error below:

Command line is too long. Shorten command line for [your class test] or also for Android JUnit default configuration

We do not know if the problem is related to the windows environment but what we are sure of is that the error can be resolved under windows in the same way as under linux with the same methodology. Let's see next, How to solve this problem.

 

[bctt tweet=”Troubleshooting: Command line is too long. Shorten command line for < Your test class > or also for Android JUnit default configuration” username=”tedidevblog”]

 

 

 

Solution to resolve the error: Command line is too long. Shorten command line for [Your test class] or also for Android JUnit default configuration

Fortunately, there is nothing complicated about solving this error. You have to go to the settings Run / debug configurations by clicking on the link below the error or by going through the main menu -> Run / debug configurations. Follow the next steps:

 

 

1- At the option level Shorten command line, we will change the content to blue.

 

[Troubleshooting]: Command line is too long. Shorten command line for [Your test class] or also for Android JUnit default configuration

 

 

 

 

2- The content in blue will be changed to classpath file -java WrapperClass…

 

 

 

 

Normally after these 2 steps, everything would be settled. You will no longer find this error.

Also try to change the configuration for all unit tests. To do this, you should select the tab Android JUnit to ensure that the configuration is applied to all content. (We haven't tried it yet.)

 

 

 

Last updated November 1, 2022 at 11:17 AM

 

Conclusion

You may be interested in Git: tutorial to link your local repository to the remote repository to protect your project. et 500 firepaper: Make your android mobiles more alive,

 

Command line is too long. Shorten command line for [Your test class] or also for Android JUnit default configuration
Image by Kankanravee Kanyawath from Pixabay