【发布时间】:2015-04-29 23:41:39
【问题描述】:
我点击我的应用程序中的发送按钮,模拟器出现以下错误消息:
HAX 正在工作,模拟器以快速 virt 模式运行
dyld:惰性符号绑定失败:找不到符号:_utf8_write 引用自:/Users/Nabil/Documents/Development/Android/sdk/tools/emulator64-x86 预期在:平面命名空间 dyld:找不到符号:_utf8_write 引用自:/Users/Nabil/Documents/Development/Android/sdk/tools/emulator64-x86 预期在:平面命名空间
这是我的课程代码:
public void Send (View view){
txtnum = (EditText)findViewById(R.id.txtNum);
txtmsg = (EditText)findViewById(R.id.txtMessage);
String phoneNo = txtnum.getText().toString();
String message = txtmsg.getText().toString();
try {
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(phoneNo, null, message, null, null);
Toast.makeText(getApplicationContext(), "SMS sent.",
Toast.LENGTH_LONG).show();
} catch (Exception e) {
Toast.makeText(getApplicationContext(),
"SMS faild, please try again.",
Toast.LENGTH_LONG).show();
e.printStackTrace();
}
}
和我的清单文件:
<uses-permission android:name="android.permission.SEND_SMS" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
【问题讨论】:
-
您的代码和清单看起来正确。模拟器在什么机器上运行?
-
尝试在真机上运行你的应用。
-
迈克,我正在使用 nexus one
-
@NabilElAtlas 实际上,我指的是您的计算机。至少在 Mac 上似乎是 bug in the emulator。
-
我有一个 mac os yosemite 10.10.1