dyld: Symbol not found: _AVSpeechUtteranceMaximumSpeechRate - ios6

I'm trying to use my code to be compatible for both iOS 6 & 7, using the synthesized speech.
I wanna it to be available for iOS 7 and not available for iOS 6.
The problem is when I run in the simulator in iOS 6 it gives following error even before the simulator get to start: dyld: Symbol not found: _AVSpeechUtteranceMaximumSpeechRate
.
If I comment the line: utterance.rate = AVSpeechUtteranceMaximumSpeechRate / 4.0f; works great for iOS 6 to start even if its not designed for it.
What be the issue?
Thanks.
if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1) {
// Load resources for iOS 7 or later
AVSpeechSynthesizer *synthesizer = [[AVSpeechSynthesizer alloc] init];
AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:selectedText];
utterance.rate = AVSpeechUtteranceMaximumSpeechRate / 4.0f;
utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:#"en-US"]; // defaults to your system language
[synthesizer speakUtterance:utterance];
[synthesizer release];
}
else{
// Load resources for iOS 6 or earlier
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:#"Sorry"
message:#"This feature requires iOS 7.0 or later"
delegate:Nil
cancelButtonTitle:#"OK"
otherButtonTitles: nil] autorelease];
[alert show];
}

Just add this line at the top of your file:
AVF_EXPORT const float AVSpeechUtteranceMaximumSpeechRate NS_AVAILABLE_IOS(7_0);
With a weakly imported symbol, dyld will not crash if it doesn’t find the symbol when your app starts.

Related

React Navigation(version 4.x): Transition to the same screen

I am using createStackNavigator. I have three screens: A, B, and C
Screen B is used twice during my transition. I use this notation:
B(1): The first time we transit to screen B with some parameters
B(2): The second time we transit to screen B with different parameters
Consider this transition:
A --> B(1) --> C --> B(2)
Current behavior:
When I transit from screen A to B(1), B(1) to C, each time the new screen appears with an animation from right to left. But when I transit from C to B(2), the new screen appears from left to right. (issue 1)
When I am on B(2) and use navigation.goBack(), I see A (but I want to see C of course)
(issue 2)
Expected Behaviour:
when I transit from C to B(2), the new screen must appear from right to left (Like previous transitions)
When I am on B(2) and use navigation.goBack(), I must see C
System:
OS: macOS 10.15.3
CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU # 2.70GHz
Memory: 246.99 MB / 8.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.13.1 - ~/.nvm/versions/node/v12.13.1/bin/node
npm: 6.12.1 - ~/.nvm/versions/node/v12.13.1/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
Android SDK:
API Levels: 28, 29
Build Tools: 28.0.3, 29.0.2
System Images: android-28 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5977832
Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: https://github.com/expo/react-native/archive/sdk-36.0.1.tar.gz => 0.61.4
"react-navigation": "^4.3.7",
"react-navigation-stack": "^1.10.3",
To fix "when I transit from C to B(2), the new screen must appear from right to left (Like previous transitions)" in screen C use this code to navigate :
// this pushes B into the stack insted of navigating to B
() => navigation.push('B')
This "When I am on B(2) and use navigation.goBack(), I must see C" will be already fixed because the stack order is correct using push insted of navigate.
So your stack preview screen will be C.

Clojurescript react extension doesn't work with firefox, works with chromium, how to debug further?

I am trying to build a browser extension using clojurescript and re-agent (wrapper around react). The code is very simple (complete source and repro steps here), mostly copied from a re-agent example:
(ns clext2.core
(:require [reagent.core :as r]))
(defn timer-component []
(let [seconds-elapsed (r/atom 0)]
(fn []
(js/setTimeout #(do (println "timeout") (swap! seconds-elapsed inc)) 1000)
[:div "Seconds Elapsed: " #seconds-elapsed])))
(let [app (js/document.createElement "div")
_ (js/document.body.appendChild app)]
(r/render [timer-component] app))
I compiled this with the :simple optimization flag, copied the generated js into the example code published by Mozilla: https://github.com/cljsjs/packages/wiki/Creating-Packages, and loaded the extension on chromium and firefox.
Observations
When I test with figwheel locally, the counter renders in both chromium and firefox.
When I navigate to a real page (not using figwheel):
With firefox, the counter loads but does not increment (timeout is printed once)
With chrome, the counter loads and increments (timeout is printed every second)
Expected behavior
I would expect the counter to get visibly increment with firefox and it does not.
Browser Versions
Chromium (71.0.3578.98 (Official Build) Manjaro Linux (64-bit))
Firefox (64.0 for manjaro).
My question
I am not sure how to debug this further, what can I try next?
You are conflating the view (visual aspect) with the events (timer stuff). You should keep then separate. Please see the re-frame docs.

Codename one - Android build error

I encounter an error when trying to send my app to the server for building (android). Netbeans outputs the following message (actual username removed):
Prompting for password
Building for username: <actualUsernameHere>
/home/user/NetBeansProjects/OPKP/build.xml:338: The attribute can't be empty
BUILD FAILED (total time: 6 seconds)
Build.xml (around line 338):
<target name="build-for-android-device" depends="clean,copy-android-override,copy-libs,jar,clean-override">
<codeNameOne
jarFile="${dist.jar}"
displayName="${codename1.displayName}"
packageName = "${codename1.packageName}"
mainClassName = "${codename1.mainName}"
version="${codename1.version}"
icon="${codename1.icon}"
vendor="${codename1.vendor}"
subtitle="${codename1.secondaryTitle}"
targetType="android"
keystoreAlias="${codename1.android.keystoreAlias}"
keystore="${codename1.android.keystore}"
certPassword="${codename1.android.keystorePassword}"
automated="${automated}"
/> //line 338
</target>
Also Codename One settings won't show up...
It stared when I received this error:
Cannot use a cn1lib with java version greater then the project java version
At the same time Netbeans had a problem with JavaFX. So I downloaded the latest jdk and add a hint in codename one: java.version -> 8. This fixed both issues, but now I can't build my app.
EDIT:
Codename_settings.properties file (some info are hidden, but are present in the file):
#
#Tue Jul 11 14:27:58 CEST 2017
codename1.ios.appid=
codename1.ios.release.provision=
codename1.arg.java.version=8
codename1.arg.rim.obfuscation=false
codename1.arg.ios.project_type=ios
foobarfoo=This is a description of what we are going to do
codename1.arg.ios.interface_orientation=UIInterfaceOrientationPortrait\:UIInterfaceOrientationPortraitUpsideDown\:UIInterfaceOrientationLandscapeLeft\:UIInterfaceOrientationLandscapeRight
codename1.displayName=
codename1.android.keystoreAlias=
codename1.ios.release.certificate=
codename1.arg.ios.background_modes=,bluetooth-central,bluetooth-peripheral
codename1.android.keystorePassword=<actualPassHidden>
codename1.ios.provision=
codename1.arg.ios.add_libs=;CoreBluetooth.framework
codename1.arg.ios.dsym=false
codename1.arg.android.release=true
roid.keystoreAlias=<actualAliasHidden>
codename1.arg.ios.statusbar_hidden=false
codename1.languageLevel=5
codename1.android.keystore=<actualPathHidden>
codename1.arg.ios.pods=,Cordova
codename1.vendor=CodenameOne
codename1.arg.win.ver=8
codename1.ios.certificatePassword=
codename1.ios.debug.certificatePassword=
codename1.mainName=Main
codename1.ios.release.certificatePassword=
codename1.arg.ios.prerendered_icon=false
codename1.ios.debug.certificate=
libVersion=169
codename1.arg.android.xpermissions=<uses-permission android\:name\="android.permission.BLUETOOTH"/><uses-permission android\:name\="android.permission.BLUETOOTH_ADMIN"/><uses-permission android\:name\="android.permission.ACCESS_COARSE_LOCATION"/>
codename1.arg.ios.application_exits=false
codename1.secondaryTitle=CodenameOne_Template
codename1.description=
codename1.ios.debug.provision=
codename1.arg.build.incSources=1
codename1.arg.j2me.nativeThemeConst=0
codename1.rim.certificatePassword=
codename1.version=2.0
codename1.ios.certificate=
codename1.icon=icon.png
codename1.rim.signtoolCsk=
codename1.arg.ios.plistInject=<key>NSBluetoothPeripheralUsageDescription</key><string>${foobarfoo}</string>
codename1.arg.android.debug=false
codename1.rim.signtoolDb=
codename1.arg.ios.includePush=false
codename1.arg.ios.testFlight=false
codename1.packageName=com.ijs.opkp
Does anyone know what can be the problem?
Looking thru the entries in the properties vs. the XML it seems the displayName property is blank. I didn't check everything but that seems to be an issue.

QQmlPropertyCache: QQuickItem has FastProperty class info, but has not installed property accessors

Built Raspberry Pi 2 linux distro including Qt5.4 + QtWebKit + QML plugin using Yocto on fido branch See tutorial
Testing with the following QML script
root#raspberrypi2:~# more webkit.qml
import QtWebKit 3.0
WebView {
url: "http://www.nokia.com"
preferredWidth: 490
preferredHeight: 400
scale: 0.5
smooth: false
}
When running this script I am getting the following error:
root#raspberrypi2:~# /usr/bin/qt5/qmlscene --platform eglfs webkit.qml
Unable to query physical screen size, defaulting to 100 dpi.
To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
QQmlPropertyCache: QQuickItem has FastProperty class info, but has not installed property accessors
Aborted
Any pointers?
I had the same problem. The solution was to add the line
import QtQuick 2.0
to the QML file.

Facebook iOS SDK and iOS6

I'm currently trying to use the Facebook SDK official pod in its 3.14.1 version (also tried 3.9, same result) but I stumble upon an issue.
Here is my code:
self->_session = [[FBSession alloc] initWithAppID:[[self class] facebookAppId]
permissions:self.mandatoryPermissions
urlSchemeSuffix:nil
tokenCacheStrategy:[FBSessionTokenCachingStrategy defaultInstance]];
[self->_session openWithBehavior:FBSessionLoginBehaviorWithFallbackToWebView
completionHandler:^(FBSession *session,
FBSessionState state,
NSError *error)
{
[self sessionStateChanged:session
state:state
error:error];
}];
This is greatly inspired from code samples given by facebook : https://developers.facebook.com/docs/facebook-login/ios/v2.0 # Step 1b: Open the session using the custom class
Here is the issue :
dyld: lazy symbol binding failed: Symbol not found: _OSAtomicDecrement32
Referenced from: /var/mobile/Applications/01DD5CE2-39A9-40AE-A8FC-170F7387D434/Dubb.app/Dubb
Expected in: /usr/lib/libSystem.B.dylib
dyld: Symbol not found: _OSAtomicDecrement32
Referenced from: /var/mobile/Applications/01DD5CE2-39A9-40AE-A8FC-170F7387D434/Dubb.app/Dubb
Expected in: /usr/lib/libSystem.B.dylib
By looking at their SDK code I can't see fallbacks for the OSAtomicDecrement32 in case it doesn't exist, and it in fact exists sstarting with iOS 7.1.
Any advice?
Thanks
I actually understood what happened here after having the same issue on iOS7.0.
The call OSAtomicIncrement32 is defined as its own function on iOS >= 7.1, but it is also defined as an inline call to other functions for iOS < 7.1.
The right definition is used depending on the min deployment target, which for me was set to '7.1' in my podfile. Changing it to:
platform :ios, '7.0'
fixed the issue!
I deleted and then re-installed my pods.
Then I had to change one #import statement from:
#import <FacebookSDK/Facebook.h>
to
#import <FacebookSDK/FacebookSDK.h>
Rebuilt everything, and it worked.

Resources