we are using Hudson for CI of an Android project with Android emulator plugin to run UI tests on the emulator. A git project delivers the source code.
Now I see that in the git repo, for each build a logcat file is created and put in the git project folder, which is then pushed back to git. As we are expecting a lot of builds, this could easily spam the project folder. Does anyone know if it is possible to set the destination folder for the emulator logs?
I cannot find any options in the emulator plugin or Hudson anywhere.
The logcat files are named logcat_[some_number].log.
Best regards,
Kim
Upgrade to version 2.0 of the plugin (or newer) and you'll see these logcat files are now written to a temporary directory, rather than your workspace.
If you're using Hudson, possibly you only see the very old version 1.6 in the Update Centre.
Which is just another reason to upgrade to Jenkins! :)
However, if you can't upgrade either the plugin or Jenkins (for some weird reason), just use an "Execute shell" step to delete any logcat_*.log files at the start of each build.
These files are purely temporary anyway and should probably only exist in your workspace after a failed build — otherwise the logcat output is archived automatically as logcat.txt.
Add an ant task to rename the logcat file to your convenience and remove the oldest ones.
add the logs to the .gitignore file, if you want to exclude them from your repository.
Related
I've recently upgraded my react-native app to version 0.60.5, as to fulfil App Store requirement of 64-bit app, but I've noticed that the executionHistory.bin file inside android/.gradle/x.x.x/executionHistory got really big, going from ~6Mb, to ~100Mb, which is a real pain as GitHub won't allow files larger than 100Mb to be uploaded. I searched a way to clean the file, delete it and recreate it but really haven't found much. I want to know how to solve this issue, if I screw up upgrading my rn version or something.
Specs:
OS:
macOS Catalina
version: 10.15.1
React-Native: 0.60.5
The .gradle directory should be added to the .gitignore. There is no need to have this in version control as it is just used to store some build cache and various things that get re-generated when gradle builds.
My suggestion... Delete the .gradle directory locally and from your git repo (it will regenerate next time you build android). Then add it to your .gitignore.
See here for the recommended ignore file for react-native (created by react-native):
https://github.com/facebook/react-native/blob/master/template/_gitignore
Just in case you are having this issue AFTER committing and pushing...
I just realized I had this issue when cloning a large repo (~470MB).
I used https://github.com/newren/git-filter-repo to inspect large objects that were bloating the git history, and found executionHistory.bin, node_modules and all kinds of other shit that should never have been checked in the first place.
I made a list of files a directories to delete from history and added them in a file to_delete.txt, in the directory one level above my repo:
# Files and directories to delete
android/.gradle
node_modules
...
And then:
git filter-repo --invert-paths --paths-from-file ../to_delete.txt --force
Note the --force option, because I was getting wrong warnings about my repo not being a fresh clone.
After this, my repo size is just above 6MB, which makes much more sense for the small-ish project that it is 🎉🤩🥳
Hope this helps!
I'm importing from Bitbucket and am experiencing the issue. There are also no run configurations available. Do any Android gurus have an idea?
Thank you
-T
edit run config:
Different views will show and group your project files differently in Android Studio and IntelliJ IDEs. I think if you choose "Files", you will see all project files, and the actual directories in which they exist.
If this is a project you downloaded from bitbucket, you will most likely have to build the project yourself, and that is why you only see gradle scripts in the project view. You will also most likely have to create your own Run configurations.
Developers usually only upload the source files-- it's up to the end users downloading the project to build it themselves to generate the build files.
You could try creating and running your own "Android" Run configuration, and see where the build breaks, patch the current build failure + rerun. Rinse and repeat. Sorry for the bad news-- I've been frustrated in the past getting Android projects from github running for the same reasons.
I have used clean project a few times after breaking my tutorial app. I did this by doing a refactor or some other fancy command on a variable. I don't actually know what android studio is doing in the background and I am wondering if anyone can give a good detailed answer in simple English. :)
Thank you in advance,
Simple answer it Deletes the build directory
It removes whatever already-compiled files are in your project meaning it removes the .class files and recompiles the project again.
Source is here : https://www.jetbrains.com/help/idea/2016.3/cleaning-system-cache.html?search=clean
If you want to have some fun by cleaning yourself
Open your project path using cmd
(go to project path and type cmd and hit enter like below)
Then use command gradlew clean and hit enter and see what happens when it cleans
For other tasks and meet your project's Mr.Gradle use command gradlew help
Clean action, basically invoking ./gradle clean task in your application directory, which is removing all generated files, removes build folders. So basically next time you will run/build all the artifacts will be builded from the scratch and will not be reused.
More information you can find on a official gradle site
Information about android plugin
DSL reference for Android plugin
Cleaning the project removes all build artifacts (ex: deleting the app/build folder)
I don't know what it does. But I would like to share my experience that is worth to know.
I was having one Android Studio project in which I was managing two projects through buildTypes(Lets name them project A and B).
I was previously working with project A. Now I need to work on project B. So I made necessary changes and implemented the functionality. My next task was to generate the signed APK. I generated the signed APK with the keystore of appropriate project that is project B.
But the generated signed APK was showing the SHA1 of the keystore of project A. and Google play store was not allowing me to upload the apk with different keystore. I checked it 5 to 6 times and generated signed APK and failed every time.
After 3 to 4 hours I gave one try to clean project as any other solution was not working for me and Voila now it signed the apk with correct keystore.
So clean and rebuild the project before generating the signed APK is a best practice mainly If you are working with different buildTypes
Cleaning an Android project simply deletes the build directory. It removes the .class files that are generated when you compile your project and then recompiles again. As per my experience, whenever I move my Android Studio project folder in another location in same or different hard drive, it gives an error while running the project. In that case, cleaning the project helps eliminating the errors by re-building the project from scratch and to run successfully.
To clear a project in Studio, go to Build > Clean Project. Done.
I use Xamarin for VS and I get 36 errors, this is the first one:
Severity Code Description Project File Line Suppression State
Error Please install package: 'Xamarin.Android.Support.Design' available in SDK installer. Android resource directory C:\Users\Cayl\AppData\Local\Xamarin\Android.Support.Design\23.0.1.3\embedded./ doesn't exist. forms.Droid
I gather it's because XF don't support the current Android Support Library I have (23.1.1), how do I fix this step by step, do I uninstall Android Support Library and get 23.0.1 from internet somewhere or what?
Those errors are due to the failure to automatically download the zip files from Google the first time (after that they are cached for project reuse).
If you have network access to dl-ssl.google.com, then cleaning and rebuilding the project "should" work. Sometimes exiting and restarting Visual Studio (or Xamarin Studio on OS-X) and then rebuilding will start the downloads again properly.
Otherwise the error message shows the download link for the zip file(s) needed and the directory that you need to manually place them in:
Example Error Message:
Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip and put it to the C:\Users\YOURUSERID\AppData\Local\Xamarin\Android.Support.Design\23.0.1.3 directory.
Once they are downloaded, they will be available for all future solution/projects.
It sounds like you might have a corrupt download. Please try deleting the zips folder, and any Android.Support.* folders from inside C:\Users\username\AppData\Local\Xamarin.
Then, delete the bin/ and obj/ folders from your solution's project folders, restart Visual Studio, and rebuild.
My Eclipse out of the blue stopped building my Android so I removed the old version and have installed Indigo. When I try to import an Android project in I get this error:
Errors occurred during the build.
Errors running builder 'Android Resource Manager' on project 'ACCUWX_HoneyComb'.
java.lang.NullPointerException
Errors running builder 'Android Pre Compiler' on project 'ACCUWX_HoneyComb'.
java.lang.NullPointerException
Errors running builder 'Java Builder' on project 'ACCUWX_HoneyComb'.
java.lang.NullPointerException
Please help!
Try removing the .metadata folder from your workspace. This holds all your configurations, even after a new install. I think if you just delete this folder, assuming everything is in place, you should be up and running again.
The 21.0.1 version of the Eclipse ADT tools has a bug that prevents a project building if you have any files without extensions in them. This is a particular problem for users (like me) using subversion which has extenion-less files.
The solution is to install the 21.1 preview version of the ADT tools and SDK manager from Google. Clear instructions can be found here and you can read all the background add your voice to the angry mob of developers here.
This happened to me today with ADT v21.0.1-543035 and it turned out to be the .svn directories throughout the directory structure. See http://code.google.com/p/android/issues/detail?id=42051
Worked around the issue by upgrading svn client and working copy to 1.7.
For me, the source of the NullPointerException problem was a host-side Junit test project that references (and tests) code from an Android project. It didn't have a project.properties file. It's not an Android project, but for some reason the newer version of the SDK somehow expects the file there. To fix the problem, I just copied a project.properties file from an Android project to the host unit test project.
I had something similar. The problem was created by having some files without extension inside the /src folder.
In my case, a branch tool, changed the encode of the file project.properties, I changed the encode to Windows-1265 and the problem was solved.
I had the same issue and fixed it by following comment number 6 in this page:
Issue 42051: Subversion folder causes NPE in PreCompilerBuilder
Let me quote the comment:
Solved it by installing subversion support packages for eclipse:
http://gan.so/VgYT
It's still a bug but...
same problem here, I closed Eclipse, manually removed any files in folder gen for the project, started Eclipse again, and made a build.
For also me, the source of the NullPointerException problem was a host-side Junit test project that references (and tests) code from an Android project. It didn't have a project.properties file. I added it and problem got fixed.
I found the solution on this website(https://code.google.com/p/android/issues/detail?id=68755)
So basically, what we should do is :
Bring up $ADT_DIR/eclipse/Eclipse.app/Contents/MacOS/eclipse.ini in an editor. Before the -vmargs line, insert these two lines:
-vm
/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/java
you can find the eclipse.ini following this
(On a Mac OS X system, you can find eclipse.ini by right-clicking (or Ctrl+click) on the Eclipse executable in Finder, choose Show Package Contents, and then locate eclipse.ini in the MacOS folder under Contents)
Upgrades did not work for me (on Linux), so I just installed IntelliJ Idea (build 123.155). Had to modify idea.sh to set JDK_HOME=/usr/lib/jvm/jdk1.7.0 (the Oracle JDK) and to select [menu] -- Run -- Run... -- Edit Configurations... -- Target Device -- USB device to make it work with the real device.