问题标签 [phonegap-cli]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
97 浏览

javascript - PhoneGap GPS 检测插件不起作用

我正在使用 phonegap cli 创建一个 Android 移动应用程序。它需要启用 GPS。我从 npm 尝试了这个插件gps 检测,如果未启用 GPS,它将打开位置设置。即使我尝试使用默认模板 phonegap Hello World,它也无法正常工作。你们知道检测 GPS 是否启用或禁用的任何插件或 JavaScript 代码吗?

0 投票
1 回答
346 浏览

cordova - PhoneGap Build 使用了错误的 index.html 文件

当我将 PhoneGap 项目上传到 PhoneGap Build、安装并启动应用程序时,使用了错误的 index.html 文件。配置文件有:

在我的项目中,www 文件如下所示:

发生的情况是它选择了 fr/index.html 文件,并且似乎使用 fr 文件夹作为根目录,因为自定义图标和启动屏幕都不起作用。它添加了PhoneGap。

如果我删除了错误的 index.html 文件,它就可以工作。我有两个这样的原因是根文件夹中的所有文件都可以在不同的语言文件夹中访问。所以 index.html 是主要的英文,而 fr/index.html 是同一页面的法文版本等等。

有没有办法确保它以根 index.html (www/index.html) 为目标?

0 投票
4 回答
6327 浏览

angularjs - 离子移动应用程序提供白屏

我创建了一个离子应用程序,它在浏览器中运行得非常好,但是当我将它转换为应用程序时,它会出现白屏。

我已经安装了白名单插件并允许配置中的所有 url 并且还保留了元标记。我无法找到任何其他解决方案。

当保留简单的 html 文件时,我可以查看它。

任何帮助将不胜感激。可能是调试的好方法也会很好。

0 投票
1 回答
480 浏览

ios - 如果长时间保持在后台,为什么我的phonegap应用程序会重新启动

如果长时间保持在后台,我的 phonegap 应用程序会重新启动。例如,如果我第二天打开我的应用程序,它会重新启动,而不是从我离开的地方开始。否则,它似乎完美地保留了状态。

我看到安装在 iphone 上的其他一些应用程序也会发生这种情况,比如 instagram、twitter,但对于 facebook 和 whatsapp 则没有。如果长时间处于后台,iOS会杀死应用程序吗?我可以防止这种情况吗?

我在 iOS9 上使用 Phonegap CLI 6.0.1 (cordova build version 4.0.1) 测试。让我知道是否需要任何其他信息。谢谢!

0 投票
2 回答
2525 浏览

javascript - 未捕获的类型错误:无法读取未定义的属性“OneSignal”,来源:file:///android_asset/www/js/app

我正在尝试将 OneSignal 初始化为 PhoneGap 应用程序。

我尝试了很多方法。但它总是给出以下错误,

未捕获的类型错误:无法读取未定义的属性“OneSignal”,来源:file:///android_asset/www/js/app.js 错误。

这是我的 app.js 文件

请有人帮我将 OneSignal 初始化为我的 PhoneGap 应用程序。

0 投票
1 回答
281 浏览

angularjs - Ionic、Phonegap - iframe 和 youtube 视频不再显示

由于某种原因,当我使用 phonegap 应用程序时,iframe 不再出现。当我尝试运行 iframe 工作的旧版本的应用程序时,它们不再工作。

phonegap 版本:5.3.6,

科尔多瓦版本:6.0.0,

离子版本:1.7.14

有人不知道为什么会这样吗?

0 投票
1 回答
425 浏览

android - Phonegap/Cordova 构建 APK 退出代码 1?

我已经在 OSX 上使用 phonegap 完成了最后一年的项目,我想制作一个 APK 用于用户测试。

当我在我的 android 平板电脑上测试应用程序时,我使用

它可以很好地构建并进入我的 android 设备,可以正常工作,所有插件都可以正常工作,但是我希望能够制作自己的 .APK 文件,以便朋友可以对其进行测试并给我反馈。

我被告知使用

当我使用此命令时,它会出现退出代码 1,说我可能没有构建此项目所需的平台或操作系统,尽管在运行上一个命令时它说构建正常。

CLI 中的错误代码

我已确保我的 $PATH 中已安装了 android 工具和平台工具,检查了 SDK 管理器以确保我已将版本 14 安装到最新安装,检查了 Platforms.JSON 文件以确保将版本设置为最低,config.xml 说<preference name="android-minSdkVersion" value="16" />

老实说,不知道该怎么做

0 投票
1 回答
80 浏览

angularjs - 无论我做什么,PhoneGap 都不想使用 REST 服务

我有一个使用 AngularJS 的 PhoneGap 应用程序。我正在对我的 Node 后端使用一个非常简单的 $http 调用:

无论如何,PhoneGap 永远不会打到后端。我已经在普通浏览器中对其进行了测试,并且可以按预期工作。

我显然已经阅读了很多关于它的内容,并且大多数人使用白名单来修复它,但是在我的 中config.xml,我的白名单几乎是尽可能开放的:

我必须改变什么?断断续续地与这个错误搏斗了几天,在我的空闲时间无法真正创建新的酷功能有点烦人。

编辑:我正在phonegap serve使用PhoneGap Developer App 为该应用程序提供服务并对其进行测试。

0 投票
0 回答
534 浏览

windows - Can't install Enterprise App developed in cordova(phonegap) on windows phone 8.1

I have developed a cordova app for windows phone 8.1 by adding windows platform.

Cordova Version: 6.0.0, Windows Platform Version: 4.3.1, Visual Studio 2015 Update 2

The app runs successfully when running in Debug Mode with ARM or AnyCpu selected on developer registered windows phone 8.1.

Steps performed while signing the app :

1.Add the required values(Package Name, Package Display Name, Version) on the following line in the packageapp.phone.appmanifest.

  • Left below line as it is(ie. the one that was generated while project creation)

<mp:PhoneIdentity PhoneProductId="xxxxxxxxxxxxxxxxxxxxxxxxxx" PhonePublisherId="xxxxxxxxxxxxxxxxxxx" />

  • Kept Id same as Name in Identity.

<Application Id="xxxxxxxxxxxxxx" StartPage="www/index.html">

  • Added Display Name, Publisher Display Name, Description, default language

  • Changed the following in config.xml. This id in the widget tag is same as Name in the Identity Tag.

<widget id="xxxxxxxxxxxxxx" version="1.0.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <name>App Name</name> </widget>

  1. Clean Solution and Build it in Release mode (ARM) and the appx file gets generate successfully at below location of project :

    PathToProject\platforms\windows\build\phone\Release\ARM

  2. Installed software "Microsoft Intune Company Portal for Windows Phone"

4.Place AET.aet , AET.aetx , AET.xml file in "C:\Program Files (x86)\Microsoft Corporation\Microsoft Intune Company Portal for Windows Phone"

  1. Open PowerShell from start menu and Run as Administration.

  2. Navigate to "C:\Program Files (x86)\Microsoft Corporation\Microsoft Intune Company Portal for Windows Phone" in power shell.

  3. Run command

    Set-ExecutionPolicy -ExecutionPolicy AllSigned

8.Run following script in PowerShell:

.\Sign-WinPhoneCompanyPortal.ps1 -InputAppx "PathToAppxFile\App.appx" -PfxFilePath "PathToPFXFile\PFXName.pfx" -PfxPassword xxxxxxxxxx -AetxPath "C:\Program Files (x86)\Microsoft Corporation\Microsoft Intune Company Portal for Windows Phone\AET.aetx"

  1. Give Output Parameter name of signed .appx file you want to generate. For example MyApp.appx

  2. Copy .aetx file to phone storage and tap on .aetx file. This will enroll device to access company app.

  3. After installing .aetx file in device copy signed .appx file to phone storage and tap on file for installation.

I have also tried Project-->Store-->Create App Packages-->No and got successful Validation Result while creating App Package. I even tried uploading .appxupload file to Windows Dev Center and it was successful.

Issue : While signing the app using enterprise certificate and installing it on the device I get the an Error. Please find attached screenshot for the same.

enter image description here

I have also tried the following links to no avail:

  1. Windows Phone 8.1 HTML Company Apps - Can't install company app, "Can't install company app" on Windows Phone 8
  2. https://stackoverflow.com/questions/32766973/sideloading-universal-windows-phone-8-1-company-app-on-windows-phone-8-1
  3. Install an appx manually on multiple Windows Phone 8.1 devices
  4. How to install Windows Phone 8.1 app in other phones in the simplest way?.

Note: The project has been developed using command line and not by using default template of Visual Studio

My App has been submitted in App Store and can be downloaded and installed on the device successfully signed with same certificate. Can somebody please shed some light where I am missing.

Thanks in advance.

0 投票
0 回答
149 浏览

android - PhoneGap 原生应用程序错误。“非法访问”

我是 PhoneGap 应用程序开发框架的新手。我创建了一个简单的应用程序,它可以获取用户位置并将其绘制在 Google 地图上。我正在使用 PhoneGap 桌面应用程序,我可以通过 ping IP 在 IE 和 Firefox 上运行我的应用程序。但它会引发错误“错误(1):只允许安全来源。” 当我在 Chrome 浏览器中运行时。

我使用 PhoneGap 云构建平台并为 Android 原生应用程序创建了包。安装后,在运行应用程序时出现错误:“错误(1):非法访问。”

谁能告诉我解决这些问题的方法?

谢谢你。