简体   繁体   English

Android phonegap / cordova应用程序可在模拟器中使用,但不能在手机上使用

[英]Android phonegap/cordova app works in emulator but not on phone

I'm currently working on a phonegap/cordova 3.0 application with some friends which is supposed to have functionality which allows it to store reminders for future events and remind users when these events are approaching. 我目前正在与一些朋友一起使用phonegap / cordova 3.0应用程序,该应用程序应该具有允许其存储将来事件的提醒并在这些事件临近时提醒用户的功能。 I have installed the localNotification plugin (by Sebastián Katzer) in the phonegap app via the command line. 我已经通过命令行在phonegap应用程序中安装了localNotification插件(由SebastiánKatzer开发)。 I have cut my code down to a minimum and when it is run on an emulated device on my computer it works fine (Its just supposed to make a notification appear in the notifications tray at the moment) but when I install the app on a phone it doesn't work (it doesn't throw any errors either). 我已将代码缩减到最低限度,并且当它在计算机上的模拟设备上运行时,它可以正常工作(它只是应该使通知此时出现在通知托盘中),但是当我在手机上安装该应用程序时它不起作用(也不会引发任何错误)。 Here's my code I'd appreciate if anyone could give me any help/advice! 如果有人可以给我任何帮助/建议,这是我的代码,我将不胜感激!

<html>
<head>
    <title>Test Storing Events</title>
    <script type="text/javascript" src="cordova.js"></script>
    <script type="text/javascript" src="js/index.js"></script>

    <script>
    function addEvent()
    {
        window.plugin.notification.local.add({ message: 'Great app!' });
    }
    </script>
</head>
<body>
        <h1>Apache Cordova</h1>
        <input type="button" onclick="addEvent()" style="width: 100px; height: 100px;" value="Click me">
</body>

Hopefully this isn't too late. 希望这还不算太晚。 I have had problems with this plug-in recently. 我最近在使用此插件时遇到了问题。 To start with, look in logcat (I assume you have the Android tools installed so can run "adb logcat" at the command line). 首先,查看logcat(我假设您已安装Android工具,因此可以在命令行中运行“ adb logcat”)。 You will probably find Android is logging that no icon has been specified. 您可能会发现Android正在记录未指定图标的情况。 Older versions of Android chose one anyway but the version I had at one point (4.3 possibly) would simply beep and log the error. 无论如何,较旧的Android版本还是选择了一个版本,但是我在某一时刻拥有的版本(可能为4.3)只会发出哔哔声并记录错误。

Just try an earlier version of this plugin by specifying the version number in the config.xml setup. 只需在config.xml设置中指定版本号,即可尝试使用该插件的较早版本。 "version="0.7.0" works for me “ version =” 0.7.0“对我有用

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android应用程序可在模拟器上运行,但无法安装在我的手机上 - Android app works on emulator but will not install on my phone 带有Google API的Android应用程序只能在模拟器上使用,而不能在手机上使用 - Android app with Google API works on emulator but not on phone PhoneGap + jQuery android应用; ajax请求在浏览器中运行,但不在手机或模拟器上运行 - PhoneGap + jQuery android app; ajax request runs in browser but not on phone or emulator Phonegap应用程序可在模拟器中运行,但不能在设备上运行 - Phonegap app works in emulator but not on a device Android应用程序可以在真实手机上运行,​​但不能在模拟器上运行-Android开发吗? - Android app works on real phone but not on the emulator - Android Development? APP可在模拟器中运行,但不能在真实手机中运行 - The APP works in emulator but not in real phone Cordova / Phonegap Android仿真器构建错误 - Cordova/Phonegap Android Emulator Build Error 从手机运行时,Android App崩溃,但在模拟器中工作正常 - Android App crashes when run from phone but works fine in emulator Android小部件在模拟器中运行良好,但在手机上它变成了Google App小部件 - Android widget works well in emulator but on phone it turns into the Google App widget Android Gridview可以在模拟器上运行,但不能在手机上运行! - Android Gridview works on Emulator but no the Phone!
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM