Titanium audio player stops playing mp3 after a moment - titanium

In my Titanium iOS app I'm using the Ti audio player:
var mp3URL = "http://www.noiseaddicts.com/samples/47.mp3";
var audioPlayer = Ti.Media.createAudioPlayer({
url: mp3URL,
allowBackground: true
});
I borrowed this boilerplate code and am using it unchanged, aside from minor UI tweaks:
http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Media.AudioPlayer
When I click the Play button, it begins to play the clip (I can hear it, and it's correct), but then automatically stops a split-second later. I can replicate this 100% of the time and it always happens. I am not double-clicking the button or anything. Quick single click.
My full source code (excluding some of the UI stuff) for the audio piece is here: http://pastie.org/9624811
I am using Titanium SDK 3.4.0 GA, targeting iPhone 4S (v. 8.0) with XCode 6.0.1.
This gets logged in the output:
[INFO] : State: starting (1)
[INFO] : State: waiting_for_data (2)
[INFO] : State: unknown (9)
[INFO] : State: waiting_for_queue (3)
[INFO] : State: stopping (6)
[INFO] : State: stopped (7)
[INFO] : State: initialized (0)
Any ideas?

The AudioPlayer has a problem playing that specific MP3 file. I found this Titanium ticket that's been open for a long time.
https://jira.appcelerator.org/browse/TIMOB-4992
I tried a sample MP3 from this site and it worked perfectly:
http://www.stephaniequinn.com/samples.htm

Related

Appium testcases on real devices won't recognize the elements they are supposed to click on

I wrote some tests for a react native app, provided here and there some testIDs (was working with testProps, so fine for Android and iOS) and tests were running smoothly on virtual devices (iOS Simulator and Android emulator). Now I have build an apk file and ipa from the react native app and if I want to run the appium tests on a real device with the (until now) perfectly working appium tests, the test doesn't seem to find the accessibility labels. I also inspected the pages with the appium inspector, but it doesn't seem to find the provided accessibility labels in the apk file.
The logs aren't helpful either since it's just saying :
[MJSONWP (b824eb6b)] Calling AppiumDriver.findElements() with args:
["accessibilityid","nextbutton.button","b824eb6b-2100-4e76-bf55-4c1fc341555a"]
[BaseDriver] Valid locator strategies for this request: xpath, id, class name,
accessibility id, -android uiautomator [BaseDriver] Waiting up to 0 ms for condition [WD
Proxy] Matched '/elements' to command name 'findElements' [WD Proxy] Proxying [POST
/elements] to [POST http://localhost:8200/wd/hub/session/c4a35d0d-d5be-4849-
a3fc-13364f4fc77c/elements] with body: {"strategy":"accessibility
id","selector":"nextbutton.button","context":"","multiple":true} [WD Proxy] Got response
with status 200: {"sessionId":"c4a35d0d-d5be-4849-a3fc-13364f4fc77c","value":[]} [MJSONWP
(b824eb6b)] Responding to client with driver.findElements() result: [] [HTTP] <-- POST
/wd/hub/session/b824eb6b-2100-4e76-bf55-4c1fc341555a/elements 200 102 ms - 74 [HTTP]
[HTTP] --> POST /wd/hub/session/b824eb6b-2100-4e76-bf55-4c1fc341555a/elements [HTTP]
{"using":"accessibility id","value":"nextbutton.button"}
Environment
Appium version: 1.15.1
Desktop OS/version used to run Appium: MacOS Catalina
Real device or emulator/simulator: Android 7, Galaxy S6 edge
#
Anyone else experienced this issue?
In my experience, finding elements by id or xpath gives the best results. Are you sure you are grabbing the correct accessibility_id?
According to the appium reference, accessibility_id
Read a unique identifier for a UI element. For XCUITest it is the
element's accessibility-id attribute. For Android it is the element's
content-desc attribute.
http://appium.io/docs/en/commands/element/find-elements/

Appcelerator Errors When Running Android

I'm having issues when trying to run the Android Emulator with Appcelerator. I'm new to this program and not having much luck finding an answer on how to fix this error. My app development knowledge up til now is Xcode and Apache Cordova. I've uninstalled/reinstalled Appcelerator along with different versions of Node with no luck. iPhone runs fine, so I'm guessing it's something with Java, but I can't figure out how or where to find it or fix it.
I'm running Appcelerator v7.1.2 with Node v8.16.0 and npm v6.4.1. Any help is greatly appreciated!
Below is what it is showing when I try to run for Android.
[INFO] : Deploy type: development
[INFO] : Building for target: emulator
[INFO] : Building for emulator: Pixel_2_XL_API_29
[INFO] : Targeting Android SDK API: 29
[INFO] : Building for the following architectures: arm64-v8a, armeabi-v7a, x86
[INFO] : Signing with keystore: /Users/user/Library/Application Support/Titanium/mobilesdk/osx/8.3.0.GA/android/dev_keystore (tidev)
[INFO] : Debugging disabled
[INFO] : Profiler disabled
[INFO] : Transpile javascript: true
[INFO] : Generate source maps: true
[INFO] : Forcing rebuild: /Users/user/Documents/Appcelerator_Studio_Workspace/MyFirstApp/build/android/build-manifest.json does not exist
[INFO] : Starting Hyperloop assembly
[INFO] : [Hyperloop] Generating system metabase
**[ERROR] Application Installer abnormal process termination. Process exit value was 1
[ERROR] : hyperloop:generateMetabase: Failed to generated metabase: warning: [options] bootstrap class path not set in conjunction with -source 6
error: Source option 6 is no longer supported. Use 7 or later.
error: Target option 6 is no longer supported. Use 7 or later.
[ERROR] : An error occurred during build after 735ms
[ERROR] : warning: [options] bootstrap class path not set in conjunction with -source 6
[ERROR] : error: Source option 6 is no longer supported. Use 7 or later.
[ERROR] : error: Target option 6 is no longer supported. Use 7 or later.**
As a different user has the same question and provided additional information it is likely that it is the same issue:
use Java 1.8
use Node 10.13.x
especially the Java version is required. Node might work in a newer version but the official supported version is 10.13.x at the moment

Build Failed - validate build/release

Just a few days ago I could both run (in the simulator and on my iphone device) and package my iOS app for the iOS iTunes Store. But now I cannot get past this error during package:
[ERROR] : ** BUILD FAILED **
[ERROR] : The following build commands failed:
[ERROR] : Validate build/Release-iphoneos/Trivia\ Rain.app
[ERROR] : (1 failure)
TRACE | titanium exited with exit code 1
ERROR | Error: ti run exited with error code 1
at ChildProcess.<anonymous> (/Users/natej/.appcelerator/install/4.1.2/package/node_modules/appc-cli-titanium/plugins/run.js:84:66)
at ChildProcess.emit (events.js:117:20)
at Process.ChildProcess._handle.onexit (child_process.js:810:12)
Since a few days ago when the package worked perfectly, I have changed nothing related to my keychains, keystore, profiles, certificates, etc. I have made a few code changes, but after my changes, the app compiled fine, runs in simulator, and deploys/runs on my iphone 6 device. I have double checked that my certs and distribution profiles are all valid, and nothing has changed from a few days ago.
I have cleaned my project, restarted Appcelerator Studio, restarted my mac. Still I cannot get past this error.
Any ideas?
I came back 4 days later after having these problems, having changed nothing (no code, no settings, no Appcelerator updates)...and it simply worked this time.
In summary, Appcelerator is buggy. :-|

Can get Play 2.2 details when running JUnit testing with Play 2.3

I'm having issue with play framework and JUnit test with play 2.3
When running: "activator test" then it runs fine, but...
[info] Loading project definition from /.../test/toto/project
[info] Set current project to toto (in build file:/home/jenkins/.../)
[info] Compiling 6 Java sources to /home/jenkins/automated_tests/.../toto/target/scala-2.11/test-classes...
[warn] application - do execute tests in class utils.UtilsTest
[warn] application - do execute tests in class test_marketcity.BasicTest
[info] Passed: Total 14, Failed 0, Errors 0, Passed 14
[success] Total time: 29 s, completed Feb 12, 2015 9:48:51 AM
There's nothing about the test which have been run, only the full total of test (14 here). With play 2.2 I had a more detailled log containing also each test:
[info] x firstTest (x means here it failed)
[info] + secondTest (+ means here it succeeded)
Should I have to put a specific option here to get more details ?
Thx
It is a common issue with tests on activator. I usually run activator clean before tests to get the output. Sometimes running tests from sbt helps.

Unable to Compile Applications

No matter which project I choose, I am getting the same error when I go to run the app in the simulator (iPhone). I am using the latest iPhone SDK and Titanium SDK (though I also had problems before that).
[INFO] Compiling JavaScript...one moment
[INFO] No JavaScript errors detected.
[INFO] One moment, building ...
[INFO] Titanium SDK version: 1.6.1
[INFO] iPhone Device family: iphone
[INFO] iPhone SDK version: 4.3
[INFO] iPhone simulated device: iphone
[INFO] Performing full rebuild. This will take a little bit. Hold tight...
[INFO] Skipping JS compile, running from simulator
[ERROR]
[ERROR] Error: Traceback (most recent call last):
File "/Library/Application Support/Titanium/mobilesdk/osx/1.6.1/iphone/builder.py", line 1091, in main
execute_xcode("iphonesimulator%s" % link_version,["GCC_PREPROCESSOR_DEFINITIONS=__LOG__ID__=%s DEPLOYTYPE=development TI_DEVELOPMENT=1 DEBUG=1 TI_VERSION=%s" % (log_id,sdk_version)],False)
File "/Library/Application Support/Titanium/mobilesdk/osx/1.6.1/iphone/builder.py", line 1012, in execute_xcode
output = run.run(args,False,False,o)
File "/Library/Application Support/Titanium/mobilesdk/osx/1.6.1/iphone/run.py", line 39, in run
sys.exit(rc)
SystemExit: 65
Things to try, if you haven't tried them yet:
Create a new project. Just using the default generated code and none of your own code or code imported from elsewhere, try to run it in the emulator. Does it work? If so, copy everything except the build directory from a project that doesn't work into your new project. Does it work now? This is what I (and, judging from Internet forums, a lot of other people) needed to do to get the Kitchen Sink app to run, for example.
The error above is for the iPhone. What happens if you install the Android SDK and try compiling as an Android app? This is not really a solution, but it would be useful information for someone trying to help you.
Not exactly a slam-dunk here's-how-to-fix-it answer, but hopefully something that gets you on the right track (or if it's stuff you already tried, edit your post to mention that!).