Java Audio Errors on Building APK
Hi - I have NO SOUNDS in my app. But, when I build the apk, I get 6 errors, something about symbols. Any idea how I fix this. See the report below.
Thanks for your help.
================================================== =
Buildfile: C:\Users\Rich\AppData\Local\Temp\And5479.tmp\build .xml
-set-mode-check:
-set-release-mode:
-release-obfuscation-check:
[echo] proguard.config is ${proguard.config}
-pre-build:
-check-env:
[checkenv] Android SDK Tools Revision 25.2.5
[checkenv] Installed at C:\Program Files (x86)\Android\android-sdk
-setup:
[echo] Project Name: RuntimeAndroid
[gettype] Project Type: Application
-build-setup:
[getbuildtools] Using latest Build Tools: 27.0.3
[echo] Resolving Build Target for RuntimeAndroid...
[gettarget] Project Target: Android 4.4.2
[gettarget] API level: 19
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: C:\Users\Rich\AppData\Local\Temp\And5479.tmp\bin
[mkdir] Created dir: C:\Users\Rich\AppData\Local\Temp\And5479.tmp\bin\r es
[mkdir] Created dir: C:\Users\Rich\AppData\Local\Temp\And5479.tmp\bin\r sObj
[mkdir] Created dir: C:\Users\Rich\AppData\Local\Temp\And5479.tmp\bin\r sLibs
[mkdir] Created dir: C:\Users\Rich\AppData\Local\Temp\And5479.tmp\gen
[mkdir] Created dir: C:\Users\Rich\AppData\Local\Temp\And5479.tmp\bin\c lasses
[mkdir] Created dir: C:\Users\Rich\AppData\Local\Temp\And5479.tmp\bin\d exedLibs
[echo] ----------
[echo] Resolving Dependencies for RuntimeAndroid...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
[echo] ----------
[echo] Building Libraries with 'release'...
[subant] No sub-builds to iterate on
-code-gen:
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.
-pre-compile:
-compile:
[javac] Compiling 382 source files to C:\Users\Rich\AppData\Local\Temp\And5479.tmp\bin\c lasses
[javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
[javac] C:\Users\Rich\AppData\Local\Temp\And5479.tmp\src\A pplication\CSoundPlayer.java:32: error: cannot find symbol
[javac] import android.media.AudioAttributes;
[javac] ^
[javac] symbol: class AudioAttributes
[javac] location: package android.media
[javac] C:\Users\Rich\AppData\Local\Temp\And5479.tmp\src\A pplication\CSoundPlayer.java:55: error: cannot find symbol
[javac] public AudioAttributes attributes;
[javac] ^
[javac] symbol: class AudioAttributes
[javac] location: class CSoundPlayer
[javac] C:\Users\Rich\AppData\Local\Temp\And5479.tmp\src\A pplication\CSoundPlayer.java:107: error: cannot find symbol
[javac] .setContentType(AudioAttributes.CONTENT_TYPE_MUSIC )
[javac] ^
[javac] symbol: variable AudioAttributes
[javac] location: class CSoundPlayer
[javac] C:\Users\Rich\AppData\Local\Temp\And5479.tmp\src\A pplication\CSoundPlayer.java:106: error: cannot find symbol
[javac] .setUsage(AudioAttributes.USAGE_GAME)
[javac] ^
[javac] symbol: variable AudioAttributes
[javac] location: class CSoundPlayer
[javac] C:\Users\Rich\AppData\Local\Temp\And5479.tmp\src\A pplication\CSoundPlayer.java:105: error: package AudioAttributes does not exist
[javac] attributes = new AudioAttributes.Builder()
[javac] ^
[javac] C:\Users\Rich\AppData\Local\Temp\And5479.tmp\src\A pplication\CSoundPlayer.java:110: error: cannot find symbol
[javac] soundPool = new SoundPool.Builder().setAudioAttributes(attributes) .setMaxStreams(6).build();
[javac] ^
[javac] symbol: class Builder
[javac] location: class SoundPool
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 6 errors
[javac] 3 warnings
BUILD FAILED
C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:716: The following error occurred while executing this line:
C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:730: Compile failed; see the compiler error output for details.
Total time: 9 seconds
================================================== ==
Build Errors - Java API's - SDK Manager setup
Hmmm - I check my SDK manager - I have JAVA API's installed up to API 28. My Java folder shows C:\Program Files\Java\jdk1.8.0_144 and C:\Program Files\Java\jre1.8.0_171.
How do I control which one is used by MMF?
My paths in Windows are set correctly as shown above.
I noticed that my Java folder is in the "Program Files" and my Android folder is in the "Program Files (x86)" folder. There is an Android folder in the "Program Files" folder, but it is empty. Does that make a difference?
If I could send screen-shots of my SDK Manager set-up, would that help? I don't see any options for attaching jpgs.
Thanks a bunch - Rich