$5.00 To Someone Who helps Me Fix My Problem

Offer / request Android-related Jobs.
Search for a team or team-members.

$5.00 To Someone Who helps Me Fix My Problem

Postby arberb » Tue Apr 27, 2010 10:36 pm

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. public class MainActivity extends Activity {
  3.  
  4.     Button myButton;
  5.  
  6.     private SoundManager mSoundManager;
  7.  
  8.  
  9.  
  10.     @Override
  11.  
  12.     public void onCreate(Bundle icicle) {
  13.  
  14.         super.onCreate(icicle);
  15.  
  16.         this.setContentView(R.layout.main);
  17.  
  18.  
  19.  
  20.         mSoundManager = new SoundManager();
  21.  
  22.         mSoundManager.initSounds(getBaseContext());
  23.  
  24.         mSoundManager.addSound(1, R.raw.a);
  25.  
  26.  
  27.  
  28.         myButton = (Button)this.findViewById(R.id.my_button);
  29.  
  30.         myButton.setOnClickListener(new OnClickListener() {
  31.  
  32.                 @Override
  33.  
  34.                 public void onClick(View v) {
  35.  
  36.                     try {
  37.  
  38.                         mSoundManager.playSound(1);
  39.  
  40.                     } catch (Exception e) {
  41.  
  42.                         e.printStackTrace();
  43.  
  44.                     }
  45.  
  46.             }
  47.  
  48.         });
  49.  
  50.  
  51.  
  52.     }
  53.  
  54. }
  55.  
  56.  
Parsed in 0.034 seconds, using GeSHi 1.0.8.4


I have that but it crashes my application and the debug
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. 20:51:12.061    916     ERROR   AndroidRuntime  Uncaught handler: thread main exiting due to uncaught exception
  2.  
  3. 20:51:12.092    916     ERROR   AndroidRuntime  java.lang.RuntimeException: Unable to start activity ComponentInfo{org.me.zx/org.me.zx.MainActivity}: android.content.res.Resources$NotFoundException: File res/raw/a.ogg from drawable resource ID #0x7f040000
  4.  
  5. 20:51:12.092    916     ERROR   AndroidRuntime      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)
  6.  
  7. 20:51:12.092    916     ERROR   AndroidRuntime      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)
  8.  
  9. 20:51:12.092    916     ERROR   AndroidRuntime      at android.app.ActivityThread.access$1800(ActivityThread.java:112)
  10.  
  11. 20:51:12.092    916     ERROR   AndroidRuntime      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
  12.  
  13. 20:51:12.092    916     ERROR   AndroidRuntime      at android.os.Handler.dispatchMessage(Handler.java:99)
  14.  
  15. 20:51:12.092    916     ERROR   AndroidRuntime      at android.os.Looper.loop(Looper.java:123)
  16.  
  17. 20:51:12.092    916     ERROR   AndroidRuntime      at android.app.ActivityThread.main(ActivityThread.java:3948)
  18.  
  19. 20:51:12.092    916     ERROR   AndroidRuntime      at java.lang.reflect.Method.invokeNative(Native Method)
  20.  
  21. 20:51:12.092    916     ERROR   AndroidRuntime      at java.lang.reflect.Method.invoke(Method.java:521)
  22.  
  23. 20:51:12.092    916     ERROR   AndroidRuntime      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
  24.  
  25. 20:51:12.092    916     ERROR   AndroidRuntime      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
  26.  
  27. 20:51:12.092    916     ERROR   AndroidRuntime      at dalvik.system.NativeStart.main(Native Method)
  28.  
  29. 20:51:12.092    916     ERROR   AndroidRuntime  Caused by: android.content.res.Resources$NotFoundException: File res/raw/a.ogg from drawable resource ID #0x7f040000
  30.  
  31. 20:51:12.092    916     ERROR   AndroidRuntime      at android.content.res.Resources.openRawResourceFd(Resources.java:814)
  32.  
  33. 20:51:12.092    916     ERROR   AndroidRuntime      at android.media.SoundPool.load(SoundPool.java:172)
  34.  
  35. 20:51:12.092    916     ERROR   AndroidRuntime      at org.me.zx.SoundManager.addSound(SoundManager.java:27)
  36.  
  37. 20:51:12.092    916     ERROR   AndroidRuntime      at org.me.zx.MainActivity.onCreate(MainActivity.java:22)
  38.  
  39. 20:51:12.092    916     ERROR   AndroidRuntime      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
  40.  
  41. 20:51:12.092    916     ERROR   AndroidRuntime      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)
  42.  
  43. 20:51:12.092    916     ERROR   AndroidRuntime      ... 11 more
  44.  
  45. 20:51:12.092    916     ERROR   AndroidRuntime  Caused by: java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
  46.  
  47. 20:51:12.092    916     ERROR   AndroidRuntime      at android.content.res.AssetManager.openNonAssetFdNative(Native Method)
  48.  
  49. 20:51:12.092    916     ERROR   AndroidRuntime      at android.content.res.AssetManager.openNonAssetFd(AssetManager.java:412)
  50.  
  51. 20:51:12.092    916     ERROR   AndroidRuntime      at android.content.res.Resources.openRawResourceFd(Resources.java:811)
  52.  
  53. 20:51:12.092    916     ERROR   AndroidRuntime      ... 16 more
Parsed in 0.041 seconds, using GeSHi 1.0.8.4


I will pay 5$ if someone helps me fix this. Contact me at beqiraj@gmail.com
arberb
Junior Developer
Junior Developer
 
Posts: 12
Joined: Mon Apr 19, 2010 12:08 pm

Top

Postby dziobas » Wed Apr 28, 2010 11:20 pm

#1
Restart Eclipse, rebuild project

#2
as a last resort try to put files into assets/



--
Pawel Zieba
http://dziobas.blogspot.com
dziobas
Freshman
Freshman
 
Posts: 2
Joined: Wed Apr 28, 2010 11:14 pm

Postby dziobas » Wed May 05, 2010 2:25 pm

No reply means that helped, I suppose.
dziobas
Freshman
Freshman
 
Posts: 2
Joined: Wed Apr 28, 2010 11:14 pm

Top

Return to Jobs / Teams

Who is online

Users browsing this forum: No registered users and 3 guests