Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by anil4029 · Nov 15, 2015 at 08:49 PM · androidandroid buildsound

Sound not work on android game build in unity 5

Hey I am working on a game Its sounds work fine when I play on unity or play on android phone by build and run but when I use apk file and install on same phone sound are not working. I have no idea what's going on any one please give any reference or help... Working on window 10, unity 5 sound format : mp3 and ogg

shows error in logcat :

 11-18 09:50:41.013    3710-3730/? E/Unity﹕ Error: Cannot create FMOD::Sound instance for resource sharedassets0.resource, (File not found. )
     (Filename:  Line: 845)

Script :

 using UnityEngine;
 using System.Collections;
 
 public class PlayerControl : MonoBehaviour{
 
 bool check = false; 
 AudioSource sounds;
 public AudioClip coin;
 public AudioClip treasure;
 public AudioClip power;
 public AudioClip g_power;
 public AudioClip spring_up;
 public AudioClip cheerUp;
 
 void Start ()
 {
     sounds = GetComponent<AudioSource> (); 
 }
 
 void Update ()
 { 
     if (!check && Movement.gameStart) {
         check = true;
     }   
 
 } 
 
 void OnCollisionStay2D (Collision2D col)
 {
     if (col.gameObject.tag == "box" && GetComponent<Rigidbody2D> ().velocity.y <= 0)  
         Movement.inAir = false;    
 }
 
 
 void OnTriggerEnter2D (Collider2D col)
 {
     if (UI.sfx) {
         if (col.gameObject.tag == "coin") 
             sounds.PlayOneShot (coin, 1f);
         else if (col.gameObject.tag == "treasure") {
             sounds.PlayOneShot (treasure, 1f); 
             sounds.PlayOneShot (cheerUp, 1f); 
         } 
         if (GetComponent<Rigidbody2D> ().velocity.y <= 0) {
             if (col.gameObject.tag == "green") {
                 sounds.PlayOneShot (g_power, 1f);
                 sounds.PlayOneShot (spring_up, 1f);
             } else if (col.gameObject.tag == "blue") {
                 sounds.PlayOneShot (power, 1f);
                 sounds.PlayOneShot (spring_up, 1f);
             }
         }
     }
 }}


Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Baintastic · Nov 17, 2015 at 04:27 PM 0
Share

How are you referencing your sound files in your project? Can you include the code?

avatar image anil4029 Baintastic · Nov 17, 2015 at 04:33 PM 0
Share

I added my script...can you please check

avatar image Statement · Nov 17, 2015 at 04:44 PM 0
Share

Turn the volume up.

avatar image anil4029 Statement · Nov 17, 2015 at 04:48 PM 0
Share

I did.....

avatar image JonnyHilly · Feb 04, 2016 at 06:37 PM 0
Share

if you are loading your sound from REsources or Shared assets... try moving it onto a prefab ins$$anonymous$$d then playing it. I had F$$anonymous$$OD error when files were in Strea$$anonymous$$gAssets folder...

3 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by anil4029 · Nov 18, 2015 at 04:33 AM

I found solution : Just turn off the binary split option in player setting > publishing setting

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image cheesepant · Jan 02, 2019 at 07:06 PM 0
Share

This is not a solution for someone who needs to publish a bigger game to google play console. You need to split the game to make it small enough to upload to google play console. Has anyone ever figure out how to do it? I am on 2018.3.0f2

avatar image tuesday437 cheesepant · Apr 04, 2020 at 08:36 PM 0
Share

Did you ever figure it out?

avatar image
0

Answer by Baintastic · Nov 17, 2015 at 04:40 PM

A couple of things you can try:

  1. UI.sfx may be false for whatever reason on your Android build. Maybe remove that conditional and see if that's the issue?

  2. Run logcat on your pc while the app is running and see if you can catch some android errors that way: http://answers.unity3d.com/questions/492681/how-to-use-adb-logcat.html

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image anil4029 · Nov 17, 2015 at 04:47 PM 0
Share

It works fine when I run it by build and run but when I use that same apk file and install then sound stop working..so I think UI.sfx is fine

avatar image Baintastic anil4029 · Nov 17, 2015 at 05:59 PM 0
Share

Yep, that makes sense. Did you try out logcat?

avatar image anil4029 Baintastic · Nov 18, 2015 at 04:23 AM 0
Share

it show error : 11-18 09:50:41.013 3710-3730/? E/Unity﹕ Error: Cannot create F$$anonymous$$OD::Sound instance for resource sharedassets0.resource, (File not found. ) (Filename: Line: 845)

avatar image JonnyHilly · Feb 03, 2016 at 03:04 AM 0
Share
    I have the same issue... using Wwise audio tools, source assets are in Strea$$anonymous$$gAssets folder at build-time. Logcat shows the F$$anonymous$$OD error also .Changing split binary setting has no effect.  Did you solve the problem ?
avatar image
0

Answer by JonnyHilly · Feb 03, 2016 at 08:43 PM

Check your Edit->project settings->Audio If you have Unity Audio disabled, but any audio stuff in scene or scripts can cause this error. I had this when integrating Wwise audio tools into unty (droid build) which auto disables the unity audio option.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image tuesday437 · Apr 05, 2020 at 04:40 PM 0
Share

Is Wwise absolutely necessary when it comes to making android/ios/webgl builds? When I build my apk, there is no sounds on Samsung A50 device. Would Wwise fix this?

avatar image JonnyHilly tuesday437 · Apr 06, 2020 at 06:59 AM 0
Share

this is an old thread, wow! but no, you don't need wwise for iOS or droid. I never use it. I only used it above as I worked at a developer then that used it. It might be a good tool for very large, console or pc games. but not really needed at all for iOS / droid dev. it will just bloat your project and cause you compile problems. ( from what I remember)

avatar image tuesday437 JonnyHilly · Apr 07, 2020 at 05:15 AM 0
Share

Ok. Would you happen to know the reason behind this issue. $$anonymous$$y android apk works on some android phones but not on others. It's even wierder than two tested devices were samsung s10's and the sound worked on one of them, but not on the other.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

45 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Failed to re-package resources 1 Answer

Animation working in Unity and PC build, but not Android 1 Answer

No GearVR in My app, But it always start GearVR when I start my app! 0 Answers

WINDOWS 10 DllNotFoundException: sqlite3 0 Answers

IL2CPP did not run probbably,IL2CPP Did not run probbably 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges