Cannot find symbol: Class R

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Cannot find symbol: Class R

gimmegimme
I successfully followed the tutorial here to integrate Android SDK/nbandroid with Netbeans 8.2: http://forums.netbeans.org/topic51543.html

I'm trying to compile the source code I obtained here:
http://www.sanfoundry.com/java-android-program-demonstrate-tip-calculator/

After searching around, I learned that the main and activity_main files are the same thing, so I went ahead and edited the main.xml file located at:
D:\Install\Programs\NetBeans 8.2\00 projects\AndroidApplication1\res\layout\

With contents of the previous links activity_main.xml file, while retaining the file name main.xml

Now, the following import statement produces an error:
import Android.CalculatedGallons1.R;

Code:

cannot find symbol
  symbol:   class R
  location: package Android.CalculatedGallons1

Import From The Same Package
----
(Alt-Enter shows hints)




The following hi-res image, shows the paths on the left as well as what Alt+enter suggested.
[Image: http://i.imgur.com/xp1UDfJl.jpg ] (http://imgur.com/xp1UDfJ)

The output of 'Clean and Build'

Code:

ant -f "D:\\Install\\Programs\\NetBeans 8.2\\00 projects\\AndroidApplication1" clean debug
Android SDK Tools Revision 25.2.5
Installed at D:\Install\Programs\AndroidSDK
Project Name: AndroidApplication1
Project Type: Application
clean:
Deleting directory D:\Install\Programs\NetBeans 8.2\00 projects\AndroidApplication1\bin
Deleting directory D:\Install\Programs\NetBeans 8.2\00 projects\AndroidApplication1\gen
Library dependencies:
No Libraries
No sub-builds to iterate on
Android SDK Tools Revision 25.2.5
Installed at D:\Install\Programs\AndroidSDK
Project Name: AndroidApplication1
Project Type: Application
Using latest Build Tools: 25.0.2
Resolving Build Target for AndroidApplication1...
Project Target:   Android 4.4.2
API level:        19
WARNING: No minSdkVersion value set. Application will install on all Android versions.
----------
Creating output directories if needed...
Created dir: D:\Install\Programs\NetBeans 8.2\00 projects\AndroidApplication1\bin
Created dir: D:\Install\Programs\NetBeans 8.2\00 projects\AndroidApplication1\bin\res
Created dir: D:\Install\Programs\NetBeans 8.2\00 projects\AndroidApplication1\bin\rsObj
Created dir: D:\Install\Programs\NetBeans 8.2\00 projects\AndroidApplication1\bin\rsLibs
Created dir: D:\Install\Programs\NetBeans 8.2\00 projects\AndroidApplication1\gen
Created dir: D:\Install\Programs\NetBeans 8.2\00 projects\AndroidApplication1\bin\classes
Created dir: D:\Install\Programs\NetBeans 8.2\00 projects\AndroidApplication1\bin\dexedLibs
----------
Resolving Dependencies for AndroidApplication1...
Ordered libraries:
------------------
----------
Building Libraries with 'debug'...
No sub-builds to iterate on
Merging AndroidManifest files into one.
Manifest merger disabled. Using project manifest only.
Handling aidl files...
No AIDL files to compile.
----------
Handling RenderScript files...
----------
Handling Resources...
Generating resource IDs...
D:\Install\Programs\NetBeans 8.2\00 projects\AndroidApplication1\res\layout\main.xml:1: error: Error: No resource found that matches the given name (at 'paddingBottom' with value '@dimen/activity_vertical_margin').

D:\Install\Programs\NetBeans 8.2\00 projects\AndroidApplication1\res\layout\main.xml:1: error: Error: No resource found that matches the given name (at 'paddingLeft' with value '@dimen/activity_horizontal_margin').

D:\Install\Programs\NetBeans 8.2\00 projects\AndroidApplication1\res\layout\main.xml:1: error: Error: No resource found that matches the given name (at 'paddingRight' with value '@dimen/activity_horizontal_margin').

D:\Install\Programs\NetBeans 8.2\00 projects\AndroidApplication1\res\layout\main.xml:1: error: Error: No resource found that matches the given name (at 'paddingTop' with value '@dimen/activity_vertical_margin').

D:\Install\Programs\AndroidSDK\tools\ant\build.xml:649: The following error occurred while executing this line:
D:\Install\Programs\AndroidSDK\tools\ant\build.xml:694: null returned: 1
BUILD FAILED (total time: 0 seconds)