aikashi
I hate code!
Profile
Posts: 27
Reg: Jul 01, 2013
Ohio
270
08/21/14 11:43 AM (10 years ago)

No Resource Found and R cannot be resolved to variable error

So I followed everything in Mark's Video - 'Twenty Minute Tutorial : Working With The Buzztouch Android v3 Project Files' but I am getting the following errors Description Resource Path Location Type error: Error: No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version'). AndroidManifest.xml /myapp1 line 66 Android AAPT Problem Description Resource Path Location Type R cannot be resolved to a variable BT_activity_host.java /myapp1/src/com/basicsofjurisprudence line 122 Java Problem R cannot be resolved errors are many in number. So before this I was getting Unable to resolve target 'android-9' error in Play Service but I was able to resolve that by downloading API Level 9. At the moment I have API Level 3,8,9,14,19,20 installed along with Google Play Services and latest SDK Tools. I have also tried Project --> Clean but that doesnt seem to help. Please help me as to how to proceed as I am unable to figure out whats wrong. Also both Project and Play Services are set at Android Open Source 14 Level API.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
08/21/14 12:53 PM (10 years ago)
Hi @aikashi, Do you have any plugins included that are iOS only? You'll get this sort of error if this is the case. Check them all, make sure they're for Android as well, delete the ones that aren't, and then do a Project > Clean. Hopefully that helps. Mark
 
aikashi
I hate code!
Profile
Posts: 27
Reg: Jul 01, 2013
Ohio
270
like
08/21/14 01:00 PM (10 years ago)
Thanks Northwest but I am only using Simple Menu and HTML Docs Plugin and nothing else.
 
aikashi
I hate code!
Profile
Posts: 27
Reg: Jul 01, 2013
Ohio
270
like
08/21/14 01:00 PM (10 years ago)
Thanks Northwest but I am only using Simple Menu and HTML Docs Plugin and nothing else.
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
08/21/14 01:15 PM (10 years ago)
Did you add google play services to your app by right clicking on your app>properties>android ?
 
aikashi
I hate code!
Profile
Posts: 27
Reg: Jul 01, 2013
Ohio
270
like
08/21/14 01:16 PM (10 years ago)
Yes I did add Google Play Services to the app as instructed in the Mark's video
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
08/21/14 01:20 PM (10 years ago)
Cool I also noticed eclipse told you to add api 9.I had the similar problem when eclipse asked me to update. I eventually just did a fresh install of the adt bundle to fix it. Hopefully its not that though but thats been the only other reason Ive had those errors show up
 
aikashi
I hate code!
Profile
Posts: 27
Reg: Jul 01, 2013
Ohio
270
like
08/21/14 01:30 PM (10 years ago)
Should i reinstall ADT then? Any other precautions you would suggest me to take while uninstalling and reinstalling ADT?
 
aikashi
I hate code!
Profile
Posts: 27
Reg: Jul 01, 2013
Ohio
270
like
08/21/14 01:34 PM (10 years ago)
Also if possible could you direct me the steps I need to take to uninstall & reinstall ADT plugin?
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
08/21/14 01:37 PM (10 years ago)
You don't need to reinstall the ADT plugin. The problem is somewhere in your package. You could try to clean it again. It's hard to diagnose without actually being able to see some of the stuff that's being flagged. If you go to the lines in the code that it says are problematic, does anything jump out to you? Mark
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
08/21/14 04:02 PM (10 years ago)
I dont think you need to reinstall either though.I did because it kept telling me my version wasnt the newest,when the adt download manager said everything was up to date, so I dont know what kind of bug I had. I just downloaded a new copy from online and downloaded everything because I was annoyed lol. This error: Error: No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version') is the main error I get when first importing the app into eclipse. The error means its not recognizing that you added google play services. Then import google play services in eclipse . then add google play services to your app project. Its at "8:30" on marks video. The only other reasons Ive experienced that gives me the "No Resource Found and R cannot be resolved to variable error" is editing the xml layouts and not having correct sytax or extra characters and having "libraries" in the lib folder. Other than that Im lost too lol
 
aikashi
I hate code!
Profile
Posts: 27
Reg: Jul 01, 2013
Ohio
270
like
08/21/14 08:56 PM (10 years ago)
So I deleted the projects and started from Importing the project again Now i got these errors:- [2014-08-22 09:01:54 - myapp1] WARNING: unable to write jarlist cache file F:\Udacity\Buzztouch\Project App\Jurisprudence\myapp1\bin\jarlist.cache [2014-08-22 09:01:56 - myapp1] Android requires compiler compliance level 5.0 or 6.0. Found '1.4' instead. Please use Android Tools > Fix Project Properties. [2014-08-22 09:01:57 - myapp1] Android requires compiler compliance level 5.0 or 6.0. Found '1.4' instead. Please use Android Tools > Fix Project Properties. I fixed project properties then i got this [2014-08-22 09:11:19 - GoogleAdsSampleActivity] Unable to resolve target 'android-18' Do i need to download and install every api level or is there something wrong with sdk itself. As mentioned I have got Unable to resolve target 'android-' errors earlier also for android 9 and 19. Cant seem to figure out whats going wrong?
 
aikashi
I hate code!
Profile
Posts: 27
Reg: Jul 01, 2013
Ohio
270
like
08/21/14 09:01 PM (10 years ago)
Also I wish to clarify something after downloading the latest ADT Bundle it was showing some error. I had Java 8 (x64) installed as well as JDK 8 (x64) installed. I copied the JRE folder from JDK installation in Eclipse ADT and it started running fine. So have I done m wrong in setting up the ADT itself?
 
aikashi
I hate code!
Profile
Posts: 27
Reg: Jul 01, 2013
Ohio
270
like
08/21/14 09:10 PM (10 years ago)
And I am back to original position of No Resource Found and R cannot be resolved to variable errors
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
08/22/14 12:56 AM (10 years ago)
>GoogleAdsSampleActivity Are you trying to run Google ads or AdMob? If this is your try to run a BT app, do not put ads into it, yet. Whatever you read about ads probably will not run as written, as in BT 3.0 the ads must run within fragments, which is not the usual way they are introduced and explained in various posts on the Internet. If you could publish some code where the error is, an image of the screen with error and again the relevant part of LogCat? Also, could you try to make another app, identical to this one, only going step by step in order to find what you do that introduces the error and then tell us here?
 
aikashi
I hate code!
Profile
Posts: 27
Reg: Jul 01, 2013
Ohio
270
like
08/22/14 03:49 AM (10 years ago)
Ah that, Dusko I added by mistake actually that had popped up when I was adding Gooogle Library I added the wrong folder I later figured that out but that didnt come after that So here are the screenshots from start when I add the program I get 10 errors http://tinypic.com/view.php?pic=ive3wm&s=8 http://tinypic.com/view.php?pic=23h6jps&s=8 After adding the library to program they increase to 143! http://tinypic.com/view.php?pic=ipxtmc&s=8 http://tinypic.com/view.php?pic=25pgx0g&s=8
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
08/22/14 05:18 AM (10 years ago)
Let us check one thing at a time. It looks like you do not have contents of the res folders, for instance, a file called bt_plugin_sample.xml must exist and contain data that describe the layout for class BT_plugin_sample.java. Here is what the contents of bt_plugin_sample.xml look like on my computer: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/containerView" android:background="@android:color/transparent" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center_horizontal"> <TextView android:id="@+id/dynamicText" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="20dip" android:layout_marginLeft="10dip" android:layout_marginRight="10dip" android:gravity="center_horizontal" android:layout_centerHorizontal="true" android:textSize="20dip" android:text="You have loaded the\nBuzztouch Core for Android!"> </TextView> <ImageView android:id="@+id/successImage" android:layout_below="@+id/dynamicText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="20dip" android:layout_marginLeft="10dip" android:layout_marginRight="10dip" android:layout_centerHorizontal="true" android:scaleType="center" android:src="@drawable/bt_success"> </ImageView> <Button xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/dynamicButton" android:layout_below="@id/successImage" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="10dip" android:layout_marginLeft="10dip" android:layout_marginRight="10dip" android:layout_centerHorizontal="true"> </Button> </RelativeLayout> Does it look like that on your machine? Check also the contents of the all other res files. For example, in one of the images you are referencing R.anim; see what you have in the corresponding folder res / anim and so on.
 
aikashi
I hate code!
Profile
Posts: 27
Reg: Jul 01, 2013
Ohio
270
like
08/22/14 05:42 AM (10 years ago)
Dusko thanks for looking into this. Well I do have bt_plugin_sample.xml in res-->layout and i think content is also identical. In res--> anim I have bunch of XML files bt_curlin bt_curlout bt_fadein and many more
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
08/22/14 07:23 AM (10 years ago)
Ok then. Now let us back up a little. Create a new app in the control panel, create just one screen, say of type HTML Doc, put some text into it. Put the name of that screen into the Layout section, use Non-Tabbed Layout for simplicity, then download the app into Eclipse. Right click on the name of the app, then visit Properties and in Android Project Build window put Android 4.0 (14). Under Library, click on Add and add the Google Play Services jar. Then click on Java Build Path, be sure to tick all squares in options Libraries and Order and Export, then OK below. Your first app should be ready to go. Run it and see what happens. If this is not working, then your problem is somewhere else, but it should work without problems. Let us know what happened.
 
aikashi
I hate code!
Profile
Posts: 27
Reg: Jul 01, 2013
Ohio
270
like
08/22/14 07:51 AM (10 years ago)
Still getting the same errors so I guess the problem is somewhere else. Can you let me know what should I pursue now?
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
08/22/14 08:16 AM (10 years ago)
Re-download the Eclipse and install it again. You do not have to erase anything, just download it into another folder and when it is installed, tell it where to look for the ADT. I'd take it from this address: http://developer.android.com/sdk/index.html If it is a Windows machine, please have a look at the JAVA_PATH variable, what is it pointing to?
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
08/22/14 09:21 AM (10 years ago)
Or you could send me your app package zipped up, and I can run it through my Eclipse to see what happens. I might be able to see something. MrkFleming at gmail dot com Mark
 
aikashi
I hate code!
Profile
Posts: 27
Reg: Jul 01, 2013
Ohio
270
like
08/22/14 12:47 PM (10 years ago)
Thanks both of you I am going to reinstall ADT as well as mailing it you Mark.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
08/22/14 04:29 PM (10 years ago)
Just sent this your way: "As it always seems to go when somebody else takes a look, I didn't have any problems! I was able to import the project, which gave me 10 errors (R cannot be resolved). I then hooked up the Google Play Services library to the project in the Properties section, and then all the errors went away. I've attached a screen shot of what my properties page looks like. Make sure you have the latest version of the Google Play Services installed on your box, and also the Android API that you see checked in the image. I took the liberty of creating a debug apk for you so you can test on your device. Let me know if you have any issues, or simply cannot get this working. We could do a TeamViewer session or something and I can see what's up."
 
aikashi
I hate code!
Profile
Posts: 27
Reg: Jul 01, 2013
Ohio
270
like
08/22/14 11:02 PM (10 years ago)
Hey Mark, Thanks for all the help I reinstalled the ADT and it worked just fine and the apk you sent is also working fine. I just have two last questions:- 1) If I want to run this app on devices having Gingerbread should I simply change minsdkversion to 10 or something else also needs to be done? 2) If I want the HTML document to be opened directly upon touching the menu button what shall I do? Now first an intermediate screen opens and then you have to click on open HTML document and I dont want the intermediate screen. Any way to fix that ? should I use Custom HTML/Text plugin or something else. What should I do that when the person clicks on menu button the text opens and not some intermediate screen asking him to open the html document Much thanks in anticipation
 
aikashi
I hate code!
Profile
Posts: 27
Reg: Jul 01, 2013
Ohio
270
like
08/22/14 11:16 PM (10 years ago)
Also one last thing why isnt HTML viewer fitting the breadth of the text to the screen like it used to do with earlier buzztocuh apps. Any way to fix that also would be really appreciable.
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
08/23/14 12:06 AM (10 years ago)
>1) If I want to run this app on devices having Gingerbread should I simply change minsdkversion to 10 or something else also needs to be done? No. If you run self hosted control panel, you should download the app using Prepare Android Project which will use the old files, from BT 2.0. Then follow the instructions in the PDF that comes with it, i.e. set minsdk to Google APIs = 8 in Properties for the app. If you are not on self hosted, your only option is BT 3.0, so no luck then. >you have to click on open HTML document There is a special plugin for that, here: https://www.buzztouch.com/plugins/plugin.php?pid=BB9E7E5EE65303F35F29CE0 I recommend it.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
08/23/14 09:44 AM (10 years ago)
My heart died a little bit more on each reply of this thread ... What woes has the mighty Eclipse and Java and Google have bestowed upon us?!
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.