R.java issue, no solutions found in my research regarding the matter - android

Hey so I have been having this issue for a few weeks and it's incredibly bothersome. I have looked at the other posts regarding the issue and tried everything without success. This inculdes:
Checking that all .xml files are named correctly,
adding to the top of all .xml
files,
renaming package (which it does not let me because it says I have to
fix the errors first )..
I have also tried removing newer .xml files. no luck.
the error occurred when I did a routine clean the other week. I immediately proof read then removed the view_feed_event.xml file which I had just created and re-cleaned with no luck
thus far I have not been able to figure out the problem and it has persisted.
the only other thing I can think if is I added the App Engine SDK a few days prior to mess around with that
heres a screenshot, standard output for a J.java generated error.
any help would be greatly appreciated and I will make sure to accept the answer that resolves the issue.
Kind regards,
- Pete

Well, the comment from Ken Wolf proved to be the correct one...
I did not have Android SDK Build-tools installed and there were several small errors in my xml that were not flagged as a result.
the resolution to this involved: Window -> Android SDK Manager -> check and install the tools then restart the ADT
thanks again ken for a timely response, you nailed it

Related

Unable to serialize DslActivationStatus state...Android Studio

If this is a stupid question because I made some terrible mistake, please let me know. Anyways, I just encountered the error and after searching on internet for quite some time, the only similar error that I could find was here But my situation was different.
1). I tried to create a new project from File menu of a previous project.
2). I clicked on Basic Activity and selected mininimum supported API to be 19.
3). I was following this tutorial by Google Developers.
4). I was previously able to successfully build and run from Empty Templates, but now, even they show this same error.
Here are two screenshots: Error & Window
I have tried to restart computer. I have NOT yet tried to download and re-install Android Studio yet. I do not know of any good troubleshooting besides restarting computer; so, if someone wants to share some tips, please be kind enough to do it.
I have not edited or tried to do anything in the automatically created project. I have not editted any file, until I noticed that even #color/primaryColor could not be resolved. So, I went on to look into the res/values/color file and found out that it had no color values in it, instead there was a single line: androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-au. So, I checked further, and found out that many of the automatically generated files had several errors in them.
I am on a Windows 10 machine. Please help, if this question needs to be edited, please let me know. Thanks a lot in advance.

Xamarin Forms Android This type of collectionView does not support changes to its sourceCollection from a thread different from the dispatcher thread

Here is the error I'm getting when trying to archive my app for deployment.
This error doesn't show up at any other time. The project builds and runs on emulators and devices without issue. This error has zero context or direction as to where to look to fix it. It also just randomly showed up out of nowhere, last time I built/archived (with zero functional changes) this error did not happen.
Main difference between this archival and the previous one is a newer version of VS 2017. Don't remember exactly the version from before, but am currently on 15.9.4 (stable).
Looking around on the interwebs, I've found that this error seems to have something to do with ObservableCollection's, which there are probably 10-ish in my app. Not really sure what to do here, because this has never been an issue previously, and I'm coming up on a deadline and with the structure of the app, am not in a good position to start making functional changes.
EDIT
I have also cleaned and rebuilt my solution, as well as deleting all bin/obj folders in my xamarin projects. Even tried deleting the .vs folder which can sometimes help. But still no go.
Going to try updating VS to 15.9.5 and see if maybe it was fixed in a release.
EDIT 2
Updating VS 2017 to 15.9.5 made no difference.
EDIT 3
I had my coworker try archiving the exact same project on his machine (running VS 2017: 5.9.3, and it archived fine for him. So far that's the only difference we've been able to find between our environments.
I saw the same problem using VS2017 15.9.9. Even the same code that could be archived a week ago threw the above mentioned error. It seems related to local data in the solution. A "clear" build was not sufficient. However manual deletion of the local obj and bin folders followed by archiving (build is done implicitly) solved the problem for me.
For my part closing Visual studio and deleting the .vs hidden folder did it.
It's actually a fix for many issues using Xamarin.
I had this other issue where I couldn't archive because the build process would just hang and never end. Deleting the .vs folder did it too.
https://github.com/xamarin/xamarin-android/issues/1760
Just go to project property then go to Android options-> Select Advanced then increase the Java Max heap size to 2G/3G -> it's working for me.
Leon Lu's suggestion worked. I don't particularly like it, as it took forever and repairing basically restores you to a base install (no extensions or personalizations). Took about 1.2 hours to complete, but once done I was able to again archive my android application. I guess something went wrong in vs at some point, perhaps during an update. There's no way to tell.
I tried ALL of the ideas above, but had no consistent reliable luck with any of them.
I found that Microsoft has had the problem reported to them (see link below). After a ton of time burn on this, I posted at the link below one way that I've been able to get around this archive-build issue.
Like the other fixes, it's not exactly logical, and nothing that you would think would work, but I've found the process to be repeatable, which is golden for me with tight timelines and having no time for this.
MS Visual Studio Developer Community Problem 507708
Posted on a Saturday morning, a sign of really needing to get around this urgently. I hope it helps you too.

Views getting flagged inside CardView

Everything with my android studio was working fine until I came across this weird thing that when I add Views inside a CardViewthe IDE is warning me telling that for example "TextView is not allowed here". I have done this a thousand times before and It was absolutely fine.
Here is a List of the things I have tried
1. Restarted the IDE.
2. Restarted the entire system.
3. Tried the Invalidate Caches/Restart thing.
4. Cleaned the peoject.
5. Verified the support library version and files
6. Banged my head against the wall.
Nothing worked, here are some additional details
IDE version 1.3.1, SDK tools is using API 22 fully updated
And one more thing is suggestions are not shown under the CardView in XML, i guess both these problems are related.
I have seen a similar question here, but unfortunately it didn't help me.... Please someone find a fix for this problem...
Well after spending a day searching around in the Intelli J IDEA docs, I was able to find a solution for this problem. It has to do with the corrupted project metadata and other project related data that is common across projects loaded into Android Studio, so naturally I just opened a backup of my project that I had backed up when the problem did not exist. And I solved it....
Hope this'll help you...

Unable to import android.support.v4.apps.NavUtils

After thoroughly searching here, I found the following question which exactly states the problem that I am facing.
Trouble importing android.support.v4 package
However, the issue in that case was the imported package was wrong. In my case the package is correct and yet I am facing the same issue.
I have already wasted couple of days trying to figure out the solution.
One thing that I would like to add is that, I am trying to learn the command line execution for the purposes of automation so I dont want to use eclipse for the same purpose.
Going by the link on the support page, they talk about adding it in eclipse but havent mentioned how to do it via command line
http://developer.android.com/tools/extras/support-library.html#SettingUp
My android manifest mentions minsdkversion = 4 and targetsdkversion = 17 and I have already copied the android-support-v4.jar file into my project's "libs" folder but everything that i have tried so far has been in vain.
I am running this on windows 7 with JDK 1.6
Any help will be greatly appreciated.
Silly mistakes are common with beginners and I am no exception. The problem was an extra "s" in apps. It should be app in the package name. All I needed to do was to change the scope of debugging and move out from my code into the ANT script which showed me the problem.
Its amazing how putting the problem down in words gives you new avenues to dig which helped in my case. I think this is a good lesson for anybody attempting to start learning anything new.
I sincerely apologize to all those who attempted to find the problem. Hope you didn't spend a lot of time on this.
Thanks for reading though :)

MotoDev Says I Have Errors, but it won't show me them

This is a really stupid question I imagine, but is there a way to search for hidden errors. I'm working on a project in MotoDev's Eclipse environment, and it won't let me run suddenly stating that I need to fix errors first, but it won't show any errors in the log at all.
Check out the Problem view, you may get something there.
There shouldn't be any hidden errors in MOTODEV Studio. As Tony mentions, bring up the Problem view to see if there are any errors listed there. Also, look in the project explorer and see if there are any files or folders with a red X on them, which indicates a file with a problem is in there. Failing that, do a clean build on the project.
If the problems persist, give us a shout on the MOTODEV forums and we'll work with you to get the issue resolved.
Eric

Categories

Resources