Eclipse issue

Discussion in 'Archive - LWC 2.1' started by Mark, Nov 18, 2012.

  1. Mark In the know

    Member Since:
    Oct 16, 2012
    Message Count:
    29
    Likes Received:
    4
    Trophy Points:
    25
    I import the built "source" into Eclipse to do some tweaks and change the package name (Play wants a "com.example.app" format), I export the signet & aligned APK, I already uploaded it to Play Store but every time someone starts the lwp, it crashes! I've tried many different things and figured it out that the "error" is made at the moment when I import source code into Eclipse (like in the video on LWC page!). What am I doing wrong here? :(
  2. Mark In the know

    Member Since:
    Oct 16, 2012
    Message Count:
    29
    Likes Received:
    4
    Trophy Points:
    25
    Forgot to post the log :D

    java.lang.RuntimeException: Unable to instantiate service com.snailreactors.thestorm.SBLiveWallpaper: java.lang.ClassNotFoundException: com.snailreactors.thestorm.SBLiveWallpaper
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:2347)
    at android.app.ActivityThread.access$1600(ActivityThread.java:130)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1277)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4745)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    at dalvik.system.NativeStart.main(Native Method)
    Caused by: java.lang.ClassNotFoundException: com.snailreactors.thestorm.SBLiveWallpaper
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:2344)
    ... 10 more
  3. Mark In the know

    Member Since:
    Oct 16, 2012
    Message Count:
    29
    Likes Received:
    4
    Trophy Points:
    25
    And, this is my manifest file w/ copying protection

    <?xml version="1.0" encoding="utf-8"?>

    <manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.snailreactors.louisthesnail" android:versionCode="2"
    android:versionName="1.1">
    <!-- Devices >= 3 have version of Google Play that supports licensing. -->
    <uses-sdk android:minSdkVersion="7" />
    <!-- Required permission to check licensing. -->
    <uses-permission android:name="com.android.vending.CHECK_LICENSE" />

    <uses-feature android:name="android.software.live_wallpaper" />

    <application
    android:label="@string/application_name"
    android:icon="@drawable/icon">

    <service
    android:label="@string/service_name"
    android:name="com.snailreactors.louisthesnail"
    android:permission="android.permission.BIND_WALLPAPER">
    <intent-filter>
    <action android:name="android.service.wallpaper.WallpaperService" />
    </intent-filter>
    <meta-data android:name="android.service.wallpaper" android:resource="@xml/lwp_resource" />
    </service>

    <activity
    android:label="Settings"
    android:name="com.snailreactors.louisthesnail.LiveWallpaperSettings"
    android:theme="@android:style/Theme.WallpaperSettings"
    android:exported="true">
    </activity>

    </application>
    <supports-screens
    android:smallScreens="false"
    android:normalScreens="true"
    android:largeScreens="true" />
    </manifest>
  4. Vas Origin

    Member Since:
    Jan 4, 2012
    Message Count:
    770
    Likes Received:
    175
    Trophy Points:
    500
    One of the issues that I see:

    Your manifest indicates that the package name is com.snailreactors.louisthesnail
    In the error log, it is trying to find com.snailreactors.thestorm.SBLiveWallpaper
    This is inconsistent.

    Somewhere in your app, you might have missed a line that makes a reference to the package.
    I would open up all the java files and search for this string com.snailreactors.thestorm and change whatever it finds to com.snailreactors.louisthesnail

    Side note:
    If you had already uploaded the app before, changing its package name and then posting an update to Google Play might give you an error. Usually Google Play requires all updates to the app to have the same package name as the original.
  5. Mark In the know

    Member Since:
    Oct 16, 2012
    Message Count:
    29
    Likes Received:
    4
    Trophy Points:
    25
    Sorry!!!! I posted the log for the other lwp, i have the same problem there.....
    THIS is the right log, and the problem is the same as you can see.

    java.lang.RuntimeException: Unable to instantiate service com.snailreactors.louisthesnail.SBLiveWallpaper: java.lang.ClassNotFoundException: com.snailreactors.louisthesnail.SBLiveWallpaper in loader dalvik.system.PathClassLoader[/data/app/com.snailreactors.louisthesnail-1.apk]
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:1933)
    at android.app.ActivityThread.access$2500(ActivityThread.java:117)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:989)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:130)
    at android.app.ActivityThread.main(ActivityThread.java:3687)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
    at dalvik.system.NativeStart.main(Native Method)
    Caused by: java.lang.ClassNotFoundException: com.snailreactors.louisthesnail.SBLiveWallpaper in loader dalvik.system.PathClassLoader[/data/app/com.snailreactors.louisthesnail-1.apk]
    at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:1930)
    ... 10 more
  6. Vas Origin

    Member Since:
    Jan 4, 2012
    Message Count:
    770
    Likes Received:
    175
    Trophy Points:
    500
    When exactly does this error come up?
  7. Mark In the know

    Member Since:
    Oct 16, 2012
    Message Count:
    29
    Likes Received:
    4
    Trophy Points:
    25
    When I tap on LWP on my device it crashes, even the background doesn't show up. Just crash and on my computer, the log I posted before shows up.
  8. Vas Origin

    Member Since:
    Jan 4, 2012
    Message Count:
    770
    Likes Received:
    175
    Trophy Points:
    500
    Can you please post/send a screenshot of your Eclipse project tree, with the package com.snailreactors.louisthesnail expanded?
  9. Mark In the know

    Member Since:
    Oct 16, 2012
    Message Count:
    29
    Likes Received:
    4
    Trophy Points:
    25
  10. Mark In the know

    Member Since:
    Oct 16, 2012
    Message Count:
    29
    Likes Received:
    4
    Trophy Points:
    25
    ''drawable'' folders just create all by themselves.
  11. Mark In the know

    Member Since:
    Oct 16, 2012
    Message Count:
    29
    Likes Received:
    4
    Trophy Points:
    25
    Have you seen the pic already? I need the help soon, please :( Anybody?
  12. Vas Origin

    Member Since:
    Jan 4, 2012
    Message Count:
    770
    Likes Received:
    175
    Trophy Points:
    500
    The package under src is out of sync. It's hard to say what happened, but the package under src should look like the one under gen.
    That's why you are getting those errors. Possibly something went wrong during import or refactoring. I would recommend for you to backup whatever changes you made, and start the process anew. Delete the existing project from eclipse, then import a fresh copy, and make sure that the package under src is in the same format as the one under gen (com.snailreactors.louisthesnail).
  13. Mark In the know

    Member Since:
    Oct 16, 2012
    Message Count:
    29
    Likes Received:
    4
    Trophy Points:
    25
    Doesn't make any difference... Or am I doing it wrong?
    [IMG]
  14. Vas Origin

    Member Since:
    Jan 4, 2012
    Message Count:
    770
    Likes Received:
    175
    Trophy Points:
    500
    Can you post the full log (in red) under LogCat?
  15. Mark In the know

    Member Since:
    Oct 16, 2012
    Message Count:
    29
    Likes Received:
    4
    Trophy Points:
    25
    You have already seen it, it's up there in this thread!
    And, again the log(for " The storm, as the last screenshot. The first one was for Louis the Snail):

    java.lang.RuntimeException: Unable to instantiate service com.snailreactors.thestorm.SBLiveWallpaper: java.lang.ClassNotFoundException: com.snailreactors.thestorm.SBLiveWallpaper
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:2347)
    at android.app.ActivityThread.access$1600(ActivityThread.java:130)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1277)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4745)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    at dalvik.system.NativeStart.main(Native Method)
    Caused by: java.lang.ClassNotFoundException: com.snailreactors.thestorm.SBLiveWallpaper
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:2344)
    ... 10 more
  16. Mark In the know

    Member Since:
    Oct 16, 2012
    Message Count:
    29
    Likes Received:
    4
    Trophy Points:
    25
    MANIFEST

    <?xml version="1.0" encoding="utf-8"?>

    <manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.snailreactors.thestorm" android:versionCode="2"
    android:versionName="1.1">

    <uses-sdk android:minSdkVersion="7" />
    <uses-feature android:name="android.software.live_wallpaper" />

    <application
    android:label="@string/application_name"
    android:icon="@drawable/icon">

    <service
    android:label="@string/service_name"
    android:name="com.snailreactors.SBLiveWallpaper"
    android:permission="android.permission.BIND_WALLPAPER">
    <intent-filter>
    <action android:name="android.service.wallpaper.WallpaperService" />
    </intent-filter>
    <meta-data android:name="android.service.wallpaper" android:resource="@xml/lwp_resource" />
    </service>

    <activity
    android:label="Settings"
    android:name="com.snailreactors.LiveWallpaperSettings"
    android:theme="@android:style/Theme.WallpaperSettings"
    android:exported="true">
    </activity>

    </application>
    <supports-screens
    android:smallScreens="false"
    android:normalScreens="true"
    android:largeScreens="true" />
    </manifest>
  17. Mark In the know

    Member Since:
    Oct 16, 2012
    Message Count:
    29
    Likes Received:
    4
    Trophy Points:
    25
    Please post the answer. I can't upload any LWPs even without Eclipse, because in Eclipse I change the package name which is, according to Play, "Illegal", it needs to be in com.company.app form and NOT in company.app, like the LWC does it. Basically, I change the package name and sign the app in Eclipse and it becomes useless. Without importing, the app works. My SDKs are the latest, updated yesterday!!
  18. Mark In the know

    Member Since:
    Oct 16, 2012
    Message Count:
    29
    Likes Received:
    4
    Trophy Points:
    25
    I fixed something, but there goes this error:

    11-22 18:06:28.467: E/AndroidRuntime(437): FATAL EXCEPTION: main
    11-22 18:06:28.467: E/AndroidRuntime(437): java.lang.RuntimeException: Unable to instantiate service com.snailreactors.SBLiveWallpaper: java.lang.ClassNotFoundException: com.snailreactors.SBLiveWallpaper in loader dalvik.system.PathClassLoader[/data/app/com.snailreactors.louisthesnail-1.apk]
    11-22 18:06:28.467: E/AndroidRuntime(437):at android.app.ActivityThread.handleCreateService(ActivityThread.java:1929)
    11-22 18:06:28.467: E/AndroidRuntime(437):at android.app.ActivityThread.access$2500(ActivityThread.java:117)
    11-22 18:06:28.467: E/AndroidRuntime(437):at android.app.ActivityThread$H.handleMessage(ActivityThread.java:985)
    11-22 18:06:28.467: E/AndroidRuntime(437):at android.os.Handler.dispatchMessage(Handler.java:99)
    11-22 18:06:28.467: E/AndroidRuntime(437):at android.os.Looper.loop(Looper.java:123)
    11-22 18:06:28.467: E/AndroidRuntime(437):at android.app.ActivityThread.main(ActivityThread.java:3683)
    11-22 18:06:28.467: E/AndroidRuntime(437):at java.lang.reflect.Method.invokeNative(Native Method)
    11-22 18:06:28.467: E/AndroidRuntime(437):at java.lang.reflect.Method.invoke(Method.java:507)
    11-22 18:06:28.467: E/AndroidRuntime(437):at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
    11-22 18:06:28.467: E/AndroidRuntime(437):at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
    11-22 18:06:28.467: E/AndroidRuntime(437):at dalvik.system.NativeStart.main(Native Method)
    11-22 18:06:28.467: E/AndroidRuntime(437): Caused by: java.lang.ClassNotFoundException: com.snailreactors.SBLiveWallpaper in loader dalvik.system.PathClassLoader[/data/app/com.snailreactors.louisthesnail-1.apk]
    11-22 18:06:28.467: E/AndroidRuntime(437):at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
    11-22 18:06:28.467: E/AndroidRuntime(437):at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
    11-22 18:06:28.467: E/AndroidRuntime(437):at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
    11-22 18:06:28.467: E/AndroidRuntime(437):at android.app.ActivityThread.handleCreateService(ActivityThread.java:1926)
    11-22 18:06:28.467: E/AndroidRuntime(437):... 10 more
  19. Vas Origin

    Member Since:
    Jan 4, 2012
    Message Count:
    770
    Likes Received:
    175
    Trophy Points:
    500
    Another issue I see - under <service> in the manifest, it should read:
    android:name=".SBLiveWallpaper"
    instead of:
    android:name="com.snailreactors.louisthesnail"

    and under <activity>:
    android:name=".LiveWallpaperSettings"

    On a side note, there's nothing illegal about company.app as a package name.
  20. Mark In the know

    Member Since:
    Oct 16, 2012
    Message Count:
    29
    Likes Received:
    4
    Trophy Points:
    25
    Doesn't help.....
    [IMG]

    Log:
    11-23 09:15:37.777: W/dalvikvm(408): threadid=1: thread exiting with uncaught exception (group=0x40015560)
    11-23 09:15:37.787: E/AndroidRuntime(408): FATAL EXCEPTION: main
    11-23 09:15:37.787: E/AndroidRuntime(408): java.lang.RuntimeException: Unable to instantiate service com.snailreactors.SBLiveWallpaper: java.lang.ClassNotFoundException: com.snailreactors.SBLiveWallpaper in loader dalvik.system.PathClassLoader[/data/app/com.snailreactors.louisthesnail-1.apk]
    11-23 09:15:37.787: E/AndroidRuntime(408):at android.app.ActivityThread.handleCreateService(ActivityThread.java:1929)
    11-23 09:15:37.787: E/AndroidRuntime(408):at android.app.ActivityThread.access$2500(ActivityThread.java:117)
    11-23 09:15:37.787: E/AndroidRuntime(408):at android.app.ActivityThread$H.handleMessage(ActivityThread.java:985)
    11-23 09:15:37.787: E/AndroidRuntime(408):at android.os.Handler.dispatchMessage(Handler.java:99)
    11-23 09:15:37.787: E/AndroidRuntime(408):at android.os.Looper.loop(Looper.java:123)
    11-23 09:15:37.787: E/AndroidRuntime(408):at android.app.ActivityThread.main(ActivityThread.java:3683)
    11-23 09:15:37.787: E/AndroidRuntime(408):at java.lang.reflect.Method.invokeNative(Native Method)
    11-23 09:15:37.787: E/AndroidRuntime(408):at java.lang.reflect.Method.invoke(Method.java:507)
    11-23 09:15:37.787: E/AndroidRuntime(408):at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
    11-23 09:15:37.787: E/AndroidRuntime(408):at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
    11-23 09:15:37.787: E/AndroidRuntime(408):at dalvik.system.NativeStart.main(Native Method)
    11-23 09:15:37.787: E/AndroidRuntime(408): Caused by: java.lang.ClassNotFoundException: com.snailreactors.SBLiveWallpaper in loader dalvik.system.PathClassLoader[/data/app/com.snailreactors.louisthesnail-1.apk]
    11-23 09:15:37.787: E/AndroidRuntime(408):at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
    11-23 09:15:37.787: E/AndroidRuntime(408):at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
    11-23 09:15:37.787: E/AndroidRuntime(408):at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
    11-23 09:15:37.787: E/AndroidRuntime(408):at android.app.ActivityThread.handleCreateService(ActivityThread.java:1926)
    11-23 09:15:37.787: E/AndroidRuntime(408):... 10 more
    11-23 09:15:46.077: D/AndroidRuntime(417): Shutting down VM
    11-23 09:15:46.077: W/dalvikvm(417): threadid=1: thread exiting with uncaught exception (group=0x40015560)
    11-23 09:15:46.097: E/AndroidRuntime(417): FATAL EXCEPTION: main
    11-23 09:15:46.097: E/AndroidRuntime(417): java.lang.RuntimeException: Unable to instantiate service com.snailreactors.SBLiveWallpaper: java.lang.ClassNotFoundException: com.snailreactors.SBLiveWallpaper in loader dalvik.system.PathClassLoader[/data/app/com.snailreactors.louisthesnail-1.apk]
    11-23 09:15:46.097: E/AndroidRuntime(417):at android.app.ActivityThread.handleCreateService(ActivityThread.java:1929)
    11-23 09:15:46.097: E/AndroidRuntime(417):at android.app.ActivityThread.access$2500(ActivityThread.java:117)
    11-23 09:15:46.097: E/AndroidRuntime(417):at android.app.ActivityThread$H.handleMessage(ActivityThread.java:985)
    11-23 09:15:46.097: E/AndroidRuntime(417):at android.os.Handler.dispatchMessage(Handler.java:99)
    11-23 09:15:46.097: E/AndroidRuntime(417):at android.os.Looper.loop(Looper.java:123)
    11-23 09:15:46.097: E/AndroidRuntime(417):at android.app.ActivityThread.main(ActivityThread.java:3683)
    11-23 09:15:46.097: E/AndroidRuntime(417):at java.lang.reflect.Method.invokeNative(Native Method)
    11-23 09:15:46.097: E/AndroidRuntime(417):at java.lang.reflect.Method.invoke(Method.java:507)
    11-23 09:15:46.097: E/AndroidRuntime(417):at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
    11-23 09:15:46.097: E/AndroidRuntime(417):at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
    11-23 09:15:46.097: E/AndroidRuntime(417):at dalvik.system.NativeStart.main(Native Method)
    11-23 09:15:46.097: E/AndroidRuntime(417): Caused by: java.lang.ClassNotFoundException: com.snailreactors.SBLiveWallpaper in loader dalvik.system.PathClassLoader[/data/app/com.snailreactors.louisthesnail-1.apk]
    11-23 09:15:46.097: E/AndroidRuntime(417):at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
    11-23 09:15:46.097: E/AndroidRuntime(417):at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
    11-23 09:15:46.097: E/AndroidRuntime(417):at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
    11-23 09:15:46.097: E/AndroidRuntime(417):at android.app.ActivityThread.handleCreateService(ActivityThread.java:1926)
    11-23 09:15:46.097: E/AndroidRuntime(417):... 10 more

Share This Page