- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
去年我对 Phonegap Build 的体验有些生疏,我遇到了问题。
这是config.xml
:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="uk.co.example.app" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:gap="http://phonegap.com/ns/1.0">
<name>Example App</name>
<description>
The Example app
</description>
<author href="http://www.example.co.uk/" email="user@example.co.uk">
Example User
</author>
<content src="index.html" />
<preference name="DisallowOverscroll" value="true" />
<preference name="android-minSdkVersion" value="14" />
<plugin name="cordova-plugin-device" source="npm" spec="~1.1.1" />
<plugin name="cordova-plugin-dialogs" source="npm" spec="~1.2.0" />
<plugin name="cordova-plugin-file-transfer" source="npm" spec="~1.5.0" />
<plugin name="cordova-plugin-network-information" source="npm" spec="~1.2.0" />
<plugin name="cordova-plugin-whitelist" source="npm" spec="~1.2.1" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="file://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
</widget>
还有www/index.html
:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta http-equiv="Content-Security-Policy" content="default-src * 'self' 'unsafe-inline' 'unsafe-eval'; script-src * 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *" />
<title>Example App</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
<base href="/">
</head>
<body>
<div>
<div ng-app="app" ng-csp ng-cloak ng-class="{'reverse':reverse}">
<div loadingspinner id="loadingspinner"></div>
<div ng-view></div>
</div>
</div>
</body>
<script type="text/javascript" src="js/bundle.js"></script>
<script type="text/javascript" src="cordova.js"></script>
</html>
文件结构如下所示:
config.xml
www/
index.html
css/
style.css
js/
bundle.js
现在,CSS 文件可以正常加载并工作,但 Javascript 文件却不能。如果我设置一些 JS 内联,那么可以工作,但是我尝试使用的任何外部 Javascript,无论多小或多简单,都不起作用,即使它只是触发警报。然而,它在网络浏览器中运行良好,并且我相信路径是正确的 - 该文件位于 www/js/bundle.js
。
我认为这与内容安全策略和白名单插件有关,因为自从我上次使用 Phonegap Build 开发应用程序以来就引入了这些插件,这似乎相当合乎逻辑,但我看不出问题是什么。远程调试器没有显示任何错误,所以我不知道发生了什么。谁能看到我哪里出了问题吗?
如果有帮助的话,这是在 Android 上的。我还没有在 iOS 上尝试过,因为我没有 iOS 设备,所以它可能是特定于平台的。
最佳答案
从代码中删除下一个元标记,所有内容都应该有效:
<meta http-equiv="Content-Security-Policy" content="default-src * 'self' 'unsafe-inline' 'unsafe-eval'; script-src * 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *" />
关于javascript - Phonegap Build 应用程序找不到 Javascript 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40469138/
Xcode 4 中的以下操作有什么作用? 为测试而构建 为运行而构建 为分析而构建 为存档而构建 我不确定何时使用这些(或是否使用其中任何一个)。 最佳答案 Running 用于运行您的应用(在 Ma
工具: Jenkins 版1.470 Maven 2 颠覆 环境 假设我的构建有许多项目 A-D。如图所示,依赖关系图存在。也就是说:B 依赖于 A 中的类,C 依赖于 B 中的类,D 依赖于 A 中
我正在创建一个软件项目,我想使用 autotools 为我生成 makefile 等脚本,我手动创建了 Makefile.am 和 configure.in 文件,我正在使用 autogen.sh 脚
什么yarn build命令做什么? 是 yarn build和 npm build相同?如果不是有什么区别? 最佳答案 yarn build和 npm build默认情况下不是现有的命令。我想你是说
如果我有一个包含许多相互依赖的项目的大型代码库,例如,projects/A、projects/B 和 projects/C ,其中 A 需要 B,B 需要 C,每个项目都有一个Cake 构建脚本,例如
我正在尝试使用 Wix/Detox 来测试我的 react-native 应用程序(iOS 版本)。我已成功遵循 https://github.com/wix/detox/blob/master/do
我们有许多编译 .NET 代码的 Nant 脚本。这些构建需要 5 到 10 分钟才能运行,我想找到一种方法来加速它们。 我们的 Nant 脚本看起来像
你好 当我在 windows 下使用 gnu 构建 ffmpeg-3.4.1 时,谁能帮我解决这个错误: /tmp/9747a756ee05ef34cc3fcf51eabde826/sysroot/u
构建解决方案/项目/程序意味着什么?我想确保我的定义是正确的(所以我在交谈时听起来不像个白痴)。在 IDE 中,您可以(如果我错了,请纠正我)编译源代码/编程代码为计算机可读的机器代码。您可以调试程序
为什么 Eclipse 在构建 Android 项目时会陷入无限循环,用于构建工作区...和(重新)构建工作区...和(重新)构建工作区... 这是一个已知的错误吗? 摆脱这个循环的正确方法是什么?
我的 Angular 项目是 @Angular4.3.3 ng build -prod 构建需要 77 秒 ng build --prod --build-optimizer=true 构建需要 19
所以我刚刚使用命令创建了一个 React Native 项目 react-native init "项目名称" 我进入应用程序级别的 build.gradle 以连接 firebase,但出现错误提示
我想弄清楚 TFS Online 2017 中的两个预定义变量之间是否存在差异:$(Build.Repository.LocalPath)和 $(Build.SourcesDirectory) .我有
编译项目时,当系统用户名匹配时,此脚本应将 Xcode 项目的构建版本递增 1。请记住,这些只是 Target->Build Phases->Run Script in Xcode 中脚本(不是 Ap
是否有一种工具可以在给定 MS Build 项目文件的情况下构建一个视觉对象,显示将在何时以及从哪个导入文件执行哪个目标? 如果给定一个解决方案文件,它会构建项目构建顺序的视觉效果? 最佳答案 是的,
我正在尝试使用 Bazel 进行以下设置。通过调用“bazel build”,Python 脚本应该生成未知数量的具有随机名称的 *.cc 文件,然后将这些文件编译成单个静态库(.a 文件),所有这些
我正在将我的 Cmake 项目迁移到 Bazel。我项目的根目录是 build我用来运行 Cmake 的文件夹。 迁移到 Bazel ,我需要创建一个 BUILD我的项目根目录下的文件。但是,在 ma
关闭。这个问题是opinion-based 。目前不接受答案。 想要改进这个问题吗?更新问题,以便 editing this post 可以用事实和引文来回答它。 . 已关闭 5 年前。 此帖子已于
当我的Dockerfile如下所示时,它运行良好。 ... RUN pip install git+https://user_name:my_password@github.com/repo_name
当前的自动构建功能集是否可以从存储库中添加新标签并标记生成的图像?还是我需要3party服务将新标签自动推送到Docker Registry? 最佳答案 目前不行。 当前(2014年10月)尚无Doc
我是一名优秀的程序员,十分优秀!