Views getting flagged inside CardView - android

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...

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.

Strange lines appearing on Android Studio design view

Personally I have no problem with Android Studio, but one of the people on my course is having a strange problem with the design view. Lines and boxes keep appearing and are causing problems and after researching profusely for the last couple of hours I've been able to find no mention of what they are or how to get rid of them anywhere on the internet.
I found one other stack overflow post about these that had been submitted a couple of months ago, however it unfortunately featured no replies. I've added the screenshot from this post just to save me getting one but it's the same problem.
Does anybody know how to get rid of these? Or what they are? Because they don't show on my Android Studio.
The screenshot
Thanks in advance.
maybe it just some bugs appeared on install?
Try to just:
1. File - > clear cache and exit
2. Reinstall studio
3. Install studio 3.0 in early access
Hope it will help)

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

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

Blank Graphical Layout?

I don't get this. I've searched everywhere and no one's answers have solved this for me.
Why does this keep happening? I can't do anything! The XML Code is still there, but it doesn't show anything in the Graphical Editor. The Palette comes up if I change it to "4in WVGA (Nexus S)" or some other configuration, but I still can't see anything and the Theme drop down menu is unselectable. All my XML documents are like that.
Just delete any custom device screen configuration you have added . It will solve the issue :)
That just happen to me and after some attempts I found the reason.
When I first opened the project in eclipse I found some errors related with the version of Java. I changed the JDK compliance to 1.6 (Project->Properties->Java Compiler) and all errors dissapear but all graphical layouts went blank.
I uncheked "Enable project specific settings" (Project->Properties->Java Compiler) and now all the graphical layouts are working.
When everything fails, close eclipse and start it all over again, it solved my problem.
I also had that problem, it happened to me when i imported my project. after some time I came to reason just change the workspace of eclipse to folder, which contains your folder.
I changed workspace on opening eclipse, there can be some other way as well
hope this will solve it
If it has never worked for you (or something went wrong upgrading your SDK, as in my case), you may need to install an extra package. For me the issue was fixed when I installed Android Native Development Tools under NDK Plugins (SDK version 20).
I had this problem since I switched the option Show previews in the palette. I switched to show only icons, everything is ok now.

Categories

Resources