NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Cannot find symbol: Class R

 
Post new topic   Reply to topic    NetBeans Forums -> Java ME Users
View previous topic :: View next topic  
Author Message
gimmegimme



Joined: 02 Feb 2017
Posts: 2

PostPosted: Mon Feb 06, 2017 4:22 pm    Post subject: Cannot find symbol: Class R Reply with quote

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.


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)

Back to top
AliMustafa



Joined: 10 Apr 2017
Posts: 2

PostPosted: Mon Apr 10, 2017 7:52 am    Post subject: Reply with quote

Reported post
I appreciate all you do.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java ME Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo