Unresolved references for every variable I create? - android-studio

I am very new to Kotlin and Android Studio, I am trying to create some variables whilst I follow a youtube tutorial and keep getting errors saying "unresolved reference: "variable name" ".
code
errors
video im watching: https://www.youtube.com/watch?v=FjrKMcnKahY&t=388s&ab_channel=freeCodeCamp.org
I have set the ids for all my seek bars and text views etc
activity_main.xml screenshot

Related

Fatal lint error: Why using recyclerView.setHasFixedSize(true) with wrap_content for size in scrolling direction gives fatal lint error?

While trying to generate a signed APK for release. I found the following error.
This error occurred only after I updated my Android Studio to 4.1.3.
On inspection, I found that recyclerView.setHasFixedSize(true) if used with wrap_content for size in scrolling direction, gives fatal lint error. I have resolved it by removing that line in all activities but still, I need to know why is this error fatal now, there was no such error before the update.
The error is based on the RecyclerView's height, not the items inside. I noticed this error didn't show for any of my viewbinding RecyclerViews, but shows up for my findById recyclerviews, even when height is match_parent. It turns out lint is not that smart. If you have any RecyclerView in your project that uses wrap_content and has the same id as your other recyclerviews, lint gets confused and will complain, even if your other layouts all use match_parent in their RecyclerView.
My fix was to rename the id for one of my RecyclerView causing the problem (a recyclerview inside a dialog, so it's necessary to use wrap_content in there)
please refer this question you will get to know reason behind it. This question is already asked in some form.
Understanding RecyclerView setHasFixedSize
This error is sheer nonsense, I think.
I just suppress it as method annotation:
#SuppressWarnings("InvalidSetHasFixedSize")
or as suppression comment like this:
//noinspection InvalidSetHasFixedSize
myRecyclerView.setHasFixedSize(true);
source
I don't see the point of resizing RecyclerViews to fit the content, and I know with absolute certainty that mine don't. It's almost insulting that Lint spits out these warnings (and as a "fatal error" no less).

Successive errors when trying to 'Run' the recorded script [duplicate]

This question already has an answer here:
Visual Studio Coded UI test won't run - startup object empty
(1 answer)
Closed 5 years ago.
I created a brand new Coded UI Project and started to record the project. Once, I was done with recording, I click Generate code to create the code for the script.
When I click the 'Start' button after clicking 'Build' > 'Build Solution', I run into the following error: 'A Project with and Output Type of Class Library cannot be started directly. In order to debug this project, add an executable project to this solution which references the library project. Set the executable project as the startup project'
So, I went ahead right clicked the project and clicked 'Set as Startup Project' and saved and tried to run again. However, still the issue was not resolved.
I also right click the project and went to its Properties > Application > change output type to Windows Application'. Then, I get the error message 'Program does not contain a static Main method suitable for an entry point'
When I google the solution for this, the solution is to change it back to output type Class Library'
So, basically it keeps going back and forth and one solution actually leads to error for the other.
Is there a way I can Play the recorded piece by resolving these errors?
The issue is that the coded UI tests are a class library, and per the error they cannot be started.
To sole this:
You can write a program to launch them through something such as a terminal - this occasionally seen done with selenium based tests
You can right click on the test method and click "Debug Tests", or "Run Tests", depending on what you want to do.
You can click on the windows drop down, select "Test Explorer, build the solution, and run/debug accordingly from there..

Error: Could not load the "cm_photo_library_white" image referenced from a nib in the bundle with identifier ""

I started getting this error recently, possibly after the recent update?
To test I created a new project, added to the storyboard a Tab Bar Controller with its 2 VCs. I set one of the pages tab bar items to any of the added icons from Material. Build/Run the app, when the tabbarcont tries to load I get the error:
Error: Could not load the "cm_photo_library_white" image referenced from a nib in the bundle with identifier...
Any Suggestions, others seeing this?
Just got into iOS development, and found Material. Plan to use it and Firebase on an app! Love what you've done with Material. Expect kickbacks once my app starts out int he wild :)
I have some error.
I select icon in StoryBoard with Xcode autocomplete.
StoryBoard
It can't work.
But button.setImage(Icon.cm.arrowBack, for: .normal) work :)

Deleting splash screen gets strange error VS 2013

I had a project with a splash screen. It was giving me trouble so I removed my application framework.
I.e. I did:
-Created a module to be the sub main
-In module create new() splash screen instance and main window instance to run application
-Went to project properties and disabled application framework
This worked without a problem. So I wanted to change my splash screen image, so I replaced the background image. When I did that I got this error:
"Two output file names resolved to the same output file path \obj\debug\.ACFSplashscreen.resources"
Which was weird. So I deleted that splash screen class, and decided to start clean. I still have that error. So I went into my file system and deleted that resources file. Now I have a new error saying it's unable to open it!
How can I find out what is looking for that file and fix it? Nothing in my code calls it anymore.
So as to have an "answer to your question";
Sometimes, if you delete a resource, it requires a simple clean of your project, followed by a build. This has been explained below:
From Microsoft
delete any intermediate and output files. With only the project and
component files left, new instances of the intermediate and output
files can then be built.
Hence, allowing you to 'fix' your error.

Error opening nib in xcode: Error updating Objective-C type information. Multiple types...registered with the same Objective-C name: AppDelegate

Just getting started with xamarin studio and iOS development... I'm trying to set up my development projects. When setting all this up, I had initially created a project called 'MyProject.iOS'. I later decided that I didn't want the 'p' in MyProject to be capitalized. I deleted the existing project (using finder), removed it from my existing solution, and created a new one named 'Myproject.iOS'.
Now, when I try to open the Myproject_iOSViewController.xib file to edit in xCode, I get the following error:
Error updating Objective-C type information. Multiple types (MyProject.iOS.AppDelegate and Myproject.iOS.AppDelegate) registered with the same Objective-C name: AppDelegate
Seems like something is stuck in xCode from my original project that had the same name w/ different casing. I looked in Finder and confirmed that all the old files are gone.
I believe I am experiencing the same issue that was reported here (not sure why this issue is marked as resolved): https://bugzilla.xamarin.com/show_bug.cgi?id=7550
The last commenter has a great repo and reports this solution that worked for him:
1. Close XS
2. Delete ~/Library/Caches/XamarinStudio-4.0 folder
3. Open XS : voilĂ  everything works again now !
My issue at this point is that I cannot find the ~/Library/Caches/XamarinStudio-4.0 to delete. I found a ~Library/Caches/ folder but it did not have a XamarinStudio-4.0 sub-folder in there. How can I resolve this?
I am using 4.0.9 (Build 12) of Xamarin studio.
Here is the full stack trace from the error message box that shows up when I double click the xib file:
System.ArgumentException: Multiple types (MyProject.iOS.AppDelegate and Myproject.iOS.AppDelegate) registered with the same Objective-C name: AppDelegate
at MonoDevelop.MacDev.ObjCIntegration.NSObjectProjectInfo.Update () [0x00118] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.9-branch/f9c5c24e/source/md-addins/MonoDevelop.MacDev/MonoDevelop.MacDev/ObjCIntegration/NSObjectProjectInfo.cs:98
at MonoDevelop.MacDev.ObjCIntegration.NSObjectProjectInfo.Update (Boolean force) [0x0000c] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.9-branch/f9c5c24e/source/md-addins/MonoDevelop.MacDev/MonoDevelop.MacDev/ObjCIntegration/NSObjectProjectInfo.cs:72
at MonoDevelop.MacDev.XcodeSyncing.XcodeProjectTracker.UpdateTypes (IProgressMonitor monitor) [0x0003c] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.9-branch/f9c5c24e/source/md-addins/MonoDevelop.MacDev/MonoDevelop.MacDev/XcodeSyncing/XcodeProjectTracker.cs:476
I just had this problem. I used that post to solve it. At first I could not find the folder that is referenced. This is how I found it.
Go into finder on the Mac.
Under Favorites on the left of the screen, select the primary volume. For me that was labeled Macintosh HD.
Select Go/Go to Folder from the toolbar.
In the Go to the Folder screen that pops up type in ~/Library.
From there you can navigate to the proper directory and delete it.
Hope that helps. Best of luck.

Resources