I'm a starting Android Studio user and have searched almost everywhere to find the answer to this problem but it seems i'm the only one with is problem. For some weird reason my android studio doesn't recognize the symbol 'show'.
If anybody thinks he knows the answer please react. I'm really struggeling with this.
Thanks
You should bring your writing code to a method. You should understand that :
- One package can contain many classes
- One class can contain many methods
- One method can contain many code statements
If you dont know about class, method, learn them first
Related
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.
Noob Android Studio 3.6.1 on Mac Mojave developer here. I have a very simple app with a few activities. Every so often, the Kotlin class for one of the activities will complain of an unresolved reference to the corresponding layout XML file.
For example, in the Kotlin Class (TraceActivity.kt), I have the following code:
setContentView(R.layout.activity_trace)
and the corresponding XML file lives at:
MyApp/app/src/main/res/layout/activity_trace.xml
All pretty standard stuff I reckon. But setContentView would complain that it couldn't resolve activity_trace. This has happened on a few occasions, and I discovered that restarting would resolve the problem. But this morning, it isn't helping. And it's also started complaining about some of the strings I've added to strings.xml
I managed to get round the errors by making use of the full names for each of the items e.g.
com.mysite.myapp.R.layout.activity_trace
and
com.mysite.myapp.R.string.my_message
So my guess (as a noob) that somewhere it's losing track of where it is. And yet my other activities are perfectly happy when I omit the full location. Can anyone offer some insight here? Thank you - SO is awesome.
I am a complete newbie who has just about started android app. development using Xamarin Forms and VS2012. Only about 20-21 days of exposure I have got. I am trying to learn along the way through writing an imaginary practice app. But there are some errors I am getting. You can see them in the picture.
http://imagebin.ca/v/29PeHoLhwW1i
Can someone direct me what exactly it is saying and what I need to do in order to rectify them?Is there something wrong with the installation/environment or like some update? Or is it something else? What's with the "unzipping failed" message?
Some one kindly help me out here please. Facing great deal of difficulty in tackling this.
Many Thanks in advance.
As the error message says (see the third error message ), you need to install the "Android Support Repository" from the Android SDK manager.
The errors are telling you that Xamarin is looking for the support library, but that it cannot find the support library and thus the build failed.
#Tanis.7x and #Jason.
Just an update I want to post:
I went about reproducing this scenario: creating a new project, do some primary simple code, add 1,2 layouts et all. When I build the new project, these 9 errors don't appear. This is strange to me. Because: this is exactly what had happened to my main work also. These errors were not there. Something, somewhere happened along the line, due to which they started appearing suddenly; out of the blue. I remember, I had updated Xamarin version, also just added some packages like JSON.Net and it is only after that this error list appeared. Not before that, if I remember correctly. Which is weird to me. If you try to recreate by creating a brand new project these 9 errors won't appear. I tried recreating this twice; no errors.
Yes, I'm manually downloading the zip file. Hopefully this makes the compiler happy. I'll keep posted about the updates.
Thanks All!
Here is a screenshot of my Project:
The lines hidden behind the error window are:
pi.setValue(namePart);
pi.setType(Integer.class);
as you can see I have included the ksoap-j2se-full-2.1.2.jar and also all the imports are in place.
Still pi.setName(""); (and all the ones below it) is giving resolution error! apparently no such method exists in class PropertyInfo... I have already googled this and no one else seems to have any such problem anywhere on the Net or on StackOVerflow! Please help I'm stuck at the very starting point of learning Ksoap and Web Services!
Seems like you are using ksoap2-j2se library which is wrong. You need to use ksoap2-android library in order to get it work.
UPDATE 2
I posted an answer that fixes my original problem. See that for more information.
UPDATE
FYI for anyone wondering, in the end I found this: http://github.com/commonsguy/zxingdemo/tree/master Exactly what I needed to get it rolling was a simple demo that worked! Also, thanks to Sean for pointing me in the right direction for my googling.
I am currently trying to build a simple android app that can scan in a barcode. I have looked through multiple tutorials, tried everything to a T, and re-tried and re-tried. Nothing worked. So now I am going to ask for assistance to see where I went wrong.
To list the tutorials I have followed:
https://github.com/phonegap/phonegap-plugins/tree/master/Android/BarcodeScanner
Tried this one first.
http://www.mobiledevelopersolutions.com/home/start/twominutetutorials/tmt3
http://simonmacdonald.blogspot.com/2011/12/installing-barcode-plugin-for-phonegap.html
Plus a couple others, but more or less hit the point to the same process. Some key points, when I add the LibraryProject to my project as a Library, the app will not compile until I create an AndroidManifest.xml I tried using the one found in the LibraryProject and tried creating a bare mininmal one, both would allow to compile, but the app ForceCloses.
When I load up the App and click "Scan" it ForceCloses and in the debug log of LogCat in Eclipse I get:
java.lang.RuntimeException: Unable to instantiate activity
ComponentInfo{com.myapp/com.google.zxing.client.android.CaptureActivity}: java.lang.ClassNotFoundException:
com.google.com.zxing.client.android.CaptureActivity in loader dalvik.system.PathClassLoader[/data/app/com.myapp-1.apk]
I have tried googling, found a few issues, but no real clear or solid answers, most just point to the tutorials above. I am not sure if the tutorials are just outdated or I am being stupid and am missing something key. Been working on this for a few days now and am at my wits end.
If you can help I would appreciate it. To avoid answers regarding if I have done X or X, here is what I have done.
When I test the application, I do briefly see it trying to load BarcodeScanner, but right after I see that it ForceCloses. I am not sure what I am missing, but for references I will post the code I currently have setup to test:
AndroidManifest.xml - http://pastebin.com/qq9q0ZU7
Plugins.xml - http://pastebin.com/dZ5eKPSU
index.html - http://pastebin.com/wvht4ken
If I need to post any other items let me know.
On Android, it is much much simpler than all this you're trying to do. Throw this out and restart from http://code.google.com/p/zxing/wiki/ScanningViaIntent
Ok, so for anyone having this problem, you have two choices. You can use the ScanningViaIntent, as Sean pointed out. It works great, if you need an example look at CommonsGuy. As for the tutorials I posted above to get this working with PhoneGap, my whole problem was, after I imported the LibraryProject I did not go back through and add the files. I am not sure if a setting in my Eclipse is bad. But I basically just right clicked on the LibraryProject, went to Import -> File Structure -> Library Project's original project path, and loaded all of it back in there.
There is probably something wrong with my Eclipse setup, but yea. I now have the BarcodeScanner plugin for PhoneGap working!