我正在使用来自cordova的设备插件,所以我有这样的一行let model = device.model || "";
会导致Cannot find name 'device'.
错误.我认为使用ESLint我需要做
"eslintConfig": {
"globals": {
"device": true
}
}
但是TSLint对应的是什么?
最后得到Android stuido与cordova-android 4.0一起工作,但我读到我们必须安装白名单插件,但我不知道如何配置此插件与cordova-android 4.0一起使用.我得到错误消息如下
04-13 16:30:31.291 856-856/com.vs.VSMF W/Web Console? No Content- Security-Policy meta tag found. Please add one when using the cordova-plugin-whitelist plugin. at file:///android_asset/www/plugins/cordova-plugin-whitelist/whitelist.js:25
04-13 16:30:41.290 856-856/com.vs.VSMF D/SystemWebChromeClient? file:///android_asset/www/plugins/cordova-plugin-whitelist/whitelist.js: Line 25 : No Content-Security-Policy meta tag found. Please add one when using the cordova-plugin-whitelist plugin.
Run Code Online (Sandbox Code Playgroud)
这似乎是configure.xml的错误
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns = "http://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
id = "com.vs.VSMF"
version = "1.0.0">
<name>VSMF</name>
<description>
VSMF project template.
</description>
<author href="" email="dong_dh@hotmail.com">
Hua Dong
</author>
<!--
Enable individual API permissions …
Run Code Online (Sandbox Code Playgroud) 我正在使用PhoneGap构建来打包我的应用程序是否有任何PhoneGap或第三方插件,我可以包含在我的config.xml中以获取运行时的应用程序版本?
任何关于获得应用程序版本的最佳方式的建议都会受到关注.
它似乎cordova
缓存编译的插件,当我更改插件的源代码(.java
Windows上的文件)时,强制cordova重新编译插件的唯一方法是删除然后再添加该插件,这是一个痛苦.有没有办法清理cordova缓存或强制它重新编译添加的插件?
当我构建我的cordova
项目时,我收到一条警告消息:
缺少文件:/home/vijay/workspace/Repos_temp/QuickTraq_Android/plugins/nl.x-services.plugins.toast/plugin.xml
缺少文件:/home/vijay/workspace/Repos_temp/QuickTraq_Android/plugins/cordova-plugin-device-rotation-vector/plugin.xml
当我添加插件或删除插件时会发生这种情况.
当我添加插件或构建项目但当我删除插件错误时,这就像发出警告一样
错误:ENOENT,在Object.fs.openSync上没有这样的文件或目录'/home/vijay/workspace/Repos_temp/QuickTraq_Android/plugins/com.grumpysailor.cordova-plugin-device-rotation-vector/plugin.xml'(fs. js:439:18)在Object.fs.read.exports.parseElementtreeSync的Object.fs.readFileSync(fs.js:290:15)处(/ usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/util) /xml-helpers.js:121:27)在/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/dependencies.js:56:35在Array.forEach(native)at runUninstallPlatform(/ usr/local/lib)中的Object.module.exports.package.generateDependencyInfo(/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/dependencies.js:53:45) /node_modules/cordova/node_modules/cordova-lib/src/plugman/uninstall.js:218:53)在Function.module.exports.uninstallPlatform(/ usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src) /plugman/uninstall.js:81:12)/ usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/c ordova/plugin.js:205:58 at _fulfilled(/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
我的插件删除失败..有没有办法解决这个问题?
android phonegap-plugins cordova phonegap-build cordova-plugins
其实我正在尝试为SQLite安装一个ngCordova插件.但它给我的错误:访问https://github.com/brodysoft/Cordova-SQLitePlugin.git/info/refs致命时,与github.com:443有关的未知SSL协议错误:HTTP请求失败.在做一些研究时,我遇到了将sslVerify设置为false的解决方案.我无法使用命令提示符设置命令git config http.sslVerify"false".它给了我错误:无法锁定配置文件/.gitconfig:没有这样的文件或目录.我也试过通过编辑gitconfig文件手动完成它; 但它没有发生
我为Cordova创建了一个插件,我想编辑AndroidManifest以在"application"标签中添加一个属性.我知道配置文件添加新标签,但我没有找到是否可以更新现有标签.
例如,我有这个AndroidManifest:
<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" package="com.test.testCordova" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="CordovaApp" android:theme="@android:style/Theme.Black.NoTitleBar" android:windowSoftInputMode="adjustResize">
<intent-filter android:label="@string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" />
</manifest>
Run Code Online (Sandbox Code Playgroud)
我想添加android:isGame=true
的<application>
标签.
如果我不能从中做到这一点plugin.xml
,我将创建一个钩子来AndroidManifest
自己编辑,但我希望它没有必要.
我正在构建一个Cordova Android插件.我想使用第三方View
内的Intent
是由插件创建(特别是剪刀).通常(在非Cordova项目中)我会转到我的项目build.gradle
文件并添加如下:
dependencies {
compile 'com.lyft:scissors:1.0.1' }
Run Code Online (Sandbox Code Playgroud)
但似乎build.gradle
我的插件项目中的文件并不意味着被触及?向插件项目添加依赖项的正确方法是什么,通过Cordova支持构建并通过Android Studio构建?同样的问题,但对于本地项目(不在GitHub上托管).
android gradle cordova android-gradle-plugin cordova-plugins
我处在一个非常讨厌的境地......
我的客户想要在Ionic Framework v1中使用Cordova应用程序,并且相机不能将图像保存到图库.但是,当我将保存到gallery的参数设置为false时,它仍然保存到图库.
在拍摄照片并取消照片时,Android上会出现此问题.然后它将该图片保存到图库,有时甚至会保存所有其他图片.
我真的很欢迎任何帮助; 到目前为止,我发现的所有解决方案都让我觉得很难理解,因为我对Java的了解是零.
这是我的JS代码
function capturePhoto() {
var maxDimension = 1280;
var options = {
quality: 80,
destinationType: Camera.DestinationType.DATA_URL,
sourceType: Camera.PictureSourceType.CAMERA,
correctOrientation: true,
targetWidth: maxDimension,
targetHeight: maxDimension,
saveToPhotoAlbum: false
};
Run Code Online (Sandbox Code Playgroud)
这是相机选项.
$cordovaCamera.getPicture(options).then(function (imageData) {
var src = "data:image/jpeg;base64," + imageData;
$scope.photoPreviewSrc = src;
}).catch(function (err) {
});
}
Run Code Online (Sandbox Code Playgroud)