Errors on exporting in Eclipse

Discussion in 'Help & Support' started by azumi, Jul 12, 2013.

  1. azumi New Guy

    Member Since:
    Jul 12, 2013
    Message Count:
    2
    Likes Received:
    1
    Trophy Points:
    0
    Hi everyone, I have built a live wallpaper and imported it into Eclipse so I could add some advertising code but when I tried to export the wallpaper in Eclipse it wouldn’t work. I followed the Youtube tutorial on this site to add Leadbolt notification ads and everything was going well until I got to the last step of exporting the package as an unsigned app. When I tried to export the package an error message appeared saying the export had failed. I looked at the “problems” window and it said there were 59 errors. If anyone has any suggestions on how to fix this problem it would be very much appreciated as I would really like to get the wallpaper to work properly :)

    Cheers, Azumi

    *****Please see below for my error messages*****

    Description Resource Path Location Type
    The value of the local variable counter is not used RandomValueList.java /leaves wallpaper/src/com/sbg/lwc line 57 Java Problem
    The value of the local variable min is not used RandomValueList.java /leaves wallpaper/src/com/sbg/lwc line 58 Java Problem
    The value of the local variable max is not used RandomValueList.java /leaves wallpaper/src/com/sbg/lwc line 59 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 991 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 956 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 953 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 987 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 962 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 933 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 940 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 943 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 949 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 523 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 621 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 924 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 927 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 502 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 506 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 510 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 516 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 290 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 291 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 294 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 297 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 285 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 282 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 281 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 280 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 289 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 288 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 287 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 286 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 271 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 270 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 269 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 268 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 279 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 278 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 277 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 274 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 254 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 259 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 241 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 247 Java Problem
    The import android.os.Debug is never used Util.java /leaves wallpaper/src/com/sbg/lwc line 13 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 263 Java Problem
    The import android.util.DebugUtils is never used Util.java /leaves wallpaper/src/com/sbg/lwc line 14 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 266 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 260 Java Problem
    The import android.content.res.Resources is never used Util.java /leaves wallpaper/src/com/sbg/lwc line 4 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 262 Java Problem
    R cannot be resolved to a variable LiveWallpaperSettings.java /leaves wallpaper/src/com/sbg/lwc line 138 Java Problem
    The method getPreferenceManager() from the type PreferenceActivity is deprecated LiveWallpaperSettings.java /leaves wallpaper/src/com/sbg/lwc line 164 Java Problem
    The import naturewallpapers cannot be resolved SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 6 Java Problem
    The value of the field Util.width is not used Util.java /leaves wallpaper/src/com/sbg/lwc line 25 Java Problem
    The value of the field Util.height is not used Util.java /leaves wallpaper/src/com/sbg/lwc line 26 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 231 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 234 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 187 Java Problem
    The import android.util.Log is never used Item.java /leaves wallpaper/src/com/sbg/lwc line 10 Java Problem
    R cannot be resolved to a variable SBLiveWallpaper.java /leaves wallpaper/src/com/sbg/lwc line 230 Java Problem
    The method getPreferenceScreen() from the type PreferenceActivity is deprecated LiveWallpaperSettings.java /leaves wallpaper/src/com/sbg/lwc line 70 Java Problem
    The method getPreferenceScreen() from the type PreferenceActivity is deprecated LiveWallpaperSettings.java /leaves wallpaper/src/com/sbg/lwc line 69 Java Problem
    The method getPreferenceScreen() from the type PreferenceActivity is deprecated LiveWallpaperSettings.java /leaves wallpaper/src/com/sbg/lwc line 65 Java Problem
    The method getPreferenceScreen() from the type PreferenceActivity is deprecated LiveWallpaperSettings.java /leaves wallpaper/src/com/sbg/lwc line 61 Java Problem
    The method getPreferenceScreen() from the type PreferenceActivity is deprecated LiveWallpaperSettings.java /leaves wallpaper/src/com/sbg/lwc line 106 Java Problem
    R cannot be resolved to a variable LiveWallpaperSettings.java /leaves wallpaper/src/com/sbg/lwc line 101 Java Problem
    R cannot be resolved to a variable LiveWallpaperSettings.java /leaves wallpaper/src/com/sbg/lwc line 100 Java Problem
    The method findPreference(CharSequence) from the type PreferenceActivity is deprecated LiveWallpaperSettings.java /leaves wallpaper/src/com/sbg/lwc line 74 Java Problem
    The method getPreferenceScreen() from the type PreferenceActivity is deprecated LiveWallpaperSettings.java /leaves wallpaper/src/com/sbg/lwc line 47 Java Problem
    The method getPreferenceScreen() from the type PreferenceActivity is deprecated LiveWallpaperSettings.java /leaves wallpaper/src/com/sbg/lwc line 41 Java Problem
    The method findPreference(CharSequence) from the type PreferenceActivity is deprecated LiveWallpaperSettings.java /leaves wallpaper/src/com/sbg/lwc line 37 Java Problem
    R cannot be resolved to a variable LiveWallpaperSettings.java /leaves wallpaper/src/com/sbg/lwc line 35 Java Problem
    The method getPreferenceScreen() from the type PreferenceActivity is deprecated LiveWallpaperSettings.java /leaves wallpaper/src/com/sbg/lwc line 60 Java Problem
    The method getPreferenceScreen() from the type PreferenceActivity is deprecated LiveWallpaperSettings.java /leaves wallpaper/src/com/sbg/lwc line 59 Java Problem
    The method getPreferenceScreen() from the type PreferenceActivity is deprecated LiveWallpaperSettings.java /leaves wallpaper/src/com/sbg/lwc line 54 Java Problem
    The method getPreferenceScreen() from the type PreferenceActivity is deprecated LiveWallpaperSettings.java /leaves wallpaper/src/com/sbg/lwc line 53 Java Problem
    The method getPreferenceManager() from the type PreferenceActivity is deprecated LiveWallpaperSettings.java /leaves wallpaper/src/com/sbg/lwc line 25 Java Problem
    R cannot be resolved to a variable LiveWallpaperSettings.java /leaves wallpaper/src/com/sbg/lwc line 28 Java Problem
    The import naturewallpapers cannot be resolved LiveWallpaperSettings.java /leaves wallpaper/src/com/sbg/lwc line 3 Java Problem
    R cannot be resolved to a variable LiveWallpaperSettings.java /leaves wallpaper/src/com/sbg/lwc line 32 Java Problem
    R cannot be resolved to a variable LiveWallpaperSettings.java /leaves wallpaper/src/com/sbg/lwc line 33 Java Problem
    The method getPreferenceManager() from the type PreferenceActivity is deprecated LiveWallpaperSettings.java /leaves wallpaper/src/com/sbg/lwc line 29 Java Problem
    R cannot be resolved to a variable LiveWallpaperSettings.java /leaves wallpaper/src/com/sbg/lwc line 31 Java Problem
  2. Vas Origin

    Member Since:
    Jan 4, 2012
    Message Count:
    770
    Likes Received:
    167
    Trophy Points:
    500
    It's possible that your R that is imported into your classes is referencing a different package name.
    Delete the line that might look something like this import whatever.package.name.R;
    If the errors don't go away, then press Ctrl+Shift+O. If it prompts you for a further selection, pick the one that is relevant to your package name.
  3. Ai Fen Keeps coming back

    Member Since:
    Jul 13, 2013
    Message Count:
    23
    Likes Received:
    2
    Trophy Points:
    10
    Hi,
    Sorry if I'm posting on the wrong place or make a double-post.

    I have similar problem.
    I've update my 2.1 LWC and then tried to create new wallpaper. Everything is okay.
    Then I have to export to Eclipse in order to implement ads code, in this case I use Airpush.
    I was faced some problem:
    1. The package name inside "src" is wrong. It named as "com.sbg.lwc". On 2.1, the package name generated automatically as the apk name, for example "jelly.lwp". This create many errors. Please help :(
    The difference found on the folder structure:
    [2.1] .../archive/company_name/lwp_name/source/src/company_name/package-name
    [2.6].../archive/company_name/lwp_name/source/src/com/sbg/lwc ---> so, my package name become "com.sbg.lwc".

    2. There is an error on the airpush_notify.xml. Said that:
    "Description: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/ic_launcher').
    Resource: airpush_notify.xml
    PathLocation: /LiveWallpaperSettings/res/layoutline 31
    Type: Android AAPT Problem"

    I'm stuck on this step. Please help me :(

    And I was notice that the manifest have many difference with the [2.1] but there is no tutorial available for [2.6].
    Since I'm not good in programming, I'm totally confuse...
    I'm going crazy because both of LWC and Airpush have new SDK and I have to edit all but found lot of errors.
    Can someone please help me? I really need it's working soon :'(

    Help...help...help...
  4. Vas Origin

    Member Since:
    Jan 4, 2012
    Message Count:
    770
    Likes Received:
    167
    Trophy Points:
    500
    1. What errors are you getting?

    2. ic_launcher is usually a reference to the icon file. In LWC wallpapers, the icon is called icon. So the xml file should reference to it accordingly: @drawable/icon. Make the change and the error will go away.
  5. Ai Fen Keeps coming back

    Member Since:
    Jul 13, 2013
    Message Count:
    23
    Likes Received:
    2
    Trophy Points:
    10
    1. Here are the errors (I've categorize the error based on their location on "scr":

    Description: R cannot be resolved to a variable
    Resource: LiveWallpaperSettings.java
    Path: /LiveWallpaperSettings/src/com/sbg/lwc
    Location: line 138 (and many more)
    Type: Java Problem

    Description: R cannot be resolved to a variable
    Resource: SBLiveWallpaper.java
    Path: /LiveWallpaperSettings/src/com/sbg/lwc
    Location: line 226 (and many more)
    Type: Java Problem

    Description: The import zhuangaifen.wildowl.R cannot be resolved
    Resource: SBLiveWallpaper.java
    Path: /LiveWallpaperSettings/src/com/sbg/lwc
    Location: line 6
    Type: Java Problem

    FYI, for this case, my company name is "zhuangaifen" and my lwp name is "wild owl".

    I've tried your suggestion to Azumi above but it's not working.
    Please help me Vas...I think, it is because of the package name is not same but we can't refactor-rename manually. It should generate automatically then Eclipse will catch the data.

    package_name.png


    Thank you for your support Vas. I really need your help.
    Ehmmm, I saw some forum topic about ads implementation, some of them is startapp, leadbolt, etc. Is there someone who try to implement Airpush for their lwp? Please let me know Vas, maybe I can get lots of info from them.
    Thank you Vas...God bless...
  6. Vas Origin

    Member Since:
    Jan 4, 2012
    Message Count:
    770
    Likes Received:
    167
    Trophy Points:
    500
    Delete that import. Now if you still have errors, just hover over the red squiggly lines and see what solutions autofix offers you. One of them is to probably add an import. Try using autofix and tell us what happens.
  7. azumi New Guy

    Member Since:
    Jul 12, 2013
    Message Count:
    2
    Likes Received:
    1
    Trophy Points:
    0
    Hi Vas,
    Thankyou very much for your help on fixing the Eclipse errors. You were right in suggesting that
    the "R that is imported into your classes is referencing a different package name". I changed
    the package name on my project using your tutorial and after that everything worked out
    and I was able to compile the project successfully.

    Ai Fen - I think you may have the same problem as I did. You should change the package
    name so they are the same and then try to recompile the project again.
    Vas has an excellent tutorial on the subject here:
    http://www.livewallpapercreator.com...hanging-the-package-name-of-your-project.139/

    Good luck :)

    Azumi
    Vas likes this.
  8. Ai Fen Keeps coming back

    Member Since:
    Jul 13, 2013
    Message Count:
    23
    Likes Received:
    2
    Trophy Points:
    10
    Thank you Azumi...I will try ot on my project and hope that it will work :)

    Good luck ;)
  9. fatos LWC Major

    Member Since:
    Apr 2, 2013
    Message Count:
    268
    Likes Received:
    72
    Trophy Points:
    200
    Hi Guys,I have an issue. I have updated Android 4.3 APIs in the Android SDK Menager,and I just imported a live wallpaper to Eclipse. Im integrating Leadbolt ads (notifications) like always but after I added 5 permissions Im getting a yellow line under <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="17"/> and when i hover the mouse over it Im getting : Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this version. Consult the android.os.Build.VERSION_CODES javadoc for details.

    Is the problem to my Eclipse,to Leadbolt Sdk 5.1 or to LWC 2.6.1 . Maybe someone of them is not supporting Android 4.3

    Please check the picture whith my problem,click the link below
    http://tinypic.com/r/5laudl/5
  10. NewKid Seasoned Vet

    Member Since:
    Apr 1, 2012
    Message Count:
    100
    Likes Received:
    20
    Trophy Points:
    100
    Hey man, that's no problem, just read what eclipse is telling you, it looks like is suggesting you to target the latest sdk you downloaded, the one for Android 4.3, instead of using an old one (Android 2.3). That won't give you any problem, you can target the sdk version you want. Also, if you want, check all your code, you'll see yellow lines everywhere, those are not errors, thosee are some lines that aren't used and things like that, in this case is just suggesting you to target a higher sdk so you can try what's new.
  11. fatos LWC Major

    Member Since:
    Apr 2, 2013
    Message Count:
    268
    Likes Received:
    72
    Trophy Points:
    200
    Hi..Yes I know yellow lines are not errors but I updated to android 4.3 Api 18 and I want my live wallpapers to work and with android 4.3, any suggestions guys how to do it or what to do
  12. NewKid Seasoned Vet

    Member Since:
    Apr 1, 2012
    Message Count:
    100
    Likes Received:
    20
    Trophy Points:
    100
    Phase somebody correct me if I'm wrong, but I think that as long as you target a specific sdk, that app will work with that version of Android and above. For example, lwc 2.1 targeted sdk 7 which is Android 2.1 Eclair and those lwps worked with that Android version and above. As for right now lwc 2.5 targets sdk 10 which is Gingerbread so lwps made with it work with ICS and JB as well but it doesn't work Froyo and Eclair.

    Is not necessary for you to download every new sdk available, with just sdk 10 your app will work with GB+

    I'm on my phone right know, I hope I redacted this message in a way that won't confuse you even more, if you still have questions ask again ;) Regards!
  13. fatos LWC Major

    Member Since:
    Apr 2, 2013
    Message Count:
    268
    Likes Received:
    72
    Trophy Points:
    200
    Thanks for reply me back
    NewKid I updated my sdk manager and the update was whith 10 new packages...I gonna delete all packages and I will install just sdk 10......I will let you know after 10 or 15 min :)
  14. NewKid Seasoned Vet

    Member Since:
    Apr 1, 2012
    Message Count:
    100
    Likes Received:
    20
    Trophy Points:
    100
    If you do that my guess is that eclipse won't give that message anymore, but even so, there's no reason why right know your lwp shouldn't work with Android 4.3.

    You can have all the sdks and still target the one you want, that's no problem, but yeah, if you aren't going to use the new sdk you might as well delete it.
  15. fatos LWC Major

    Member Since:
    Apr 2, 2013
    Message Count:
    268
    Likes Received:
    72
    Trophy Points:
    200

    I deleted all the packages I just let android sdk 10 and it is not showing anymore but all other live wallpapers projects are having an error sayng : Warning: Ignoring platform 'android-17': build.prop is missing. Unable to resolve target 'android-17'
    I have those errors because I deleted android sdk 17
  16. NewKid Seasoned Vet

    Member Since:
    Apr 1, 2012
    Message Count:
    100
    Likes Received:
    20
    Trophy Points:
    100
    Yeah, right, is sdk 17 not 10, my bad. Download it again, restart eclipse and it will be ok
  17. fatos LWC Major

    Member Since:
    Apr 2, 2013
    Message Count:
    268
    Likes Received:
    72
    Trophy Points:
    200
    At my sdk manager I have installed sdk 7,sdk 10 and sdk 17 ,and of course and Android sdk platform tools. Should I install anything elese....?
  18. Vas Origin

    Member Since:
    Jan 4, 2012
    Message Count:
    770
    Likes Received:
    167
    Trophy Points:
    500
    You shouldn't need sdk7 for 2.6 wallpapers. It's not a problem to have extra sdks installed though.
  19. fatos LWC Major

    Member Since:
    Apr 2, 2013
    Message Count:
    268
    Likes Received:
    72
    Trophy Points:
    200
    Yes I know, but if I delete sdk 7 I will have some errors at my live wallpapers projects made whith Lwc 2.1

Share This Page