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 :)
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.
Im trying to figure out how all of android's gradle build tasks work and Ive found the open source project online but digging through it hasnt really shed much light on how each task for a project works.
https://android.googlesource.com/platform/tools/build/+/6d7fd0d2eff092abf1aaf44d03756b24570b390c/gradle/src/main/groovy/com/android/build/gradle?autodive=0%2F%2F%2F%2F
For example I would love to know the exact script it would take to replicate assemble or package and within those I would like to know exactly how to replicate any their child tasks.
Does documentation like this exist anywhere or are developers expected to bang their heads against the computer screen cursing gradle's creators for hours on end while they figure things out on their own.
And please resist the urge to leave a "read the manual" answer unless you leave a link pointing to what I asked for.
I didnt find any documentation which would outline what I really wanted but over the last few days I put it all together from reading Gradles documentation and doing a lot of debugging. It would be nice if in the future there was clear documentation on all the steps in one place so others dont have to spend days to figure things out.
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...
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
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!