我正在尝试在Linux上使用Android创建AVD.当我android create avd在Cordova项目文件夹中运行时,我收到以下消息:
-k --package : Package path of the system image for this AVD (e.g.
'system-images;android-19;google_apis;x86'). [required]
Run Code Online (Sandbox Code Playgroud)
我的问题是我不知道该选项要添加什么,并且无法在线找到任何好的参考资料.显然我安装了系统映像:
但是我如何参考这些?我根据示例对它进行了一次尝试,我收到了这个错误:
david@david-Virtual-Machine:~/projects/test-test$ android create avd --package "system-images;android-25;google-apis;x86" --name "foo"
*************************************************************************
The "android" command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager
*************************************************************************
Running //home/david/Android/Sdk/tools/bin/avdmanager create avd --package system-images;android-25;google-apis;x86 --name foo
Error: Package path is not valid. Valid system image paths are:
Run Code Online (Sandbox Code Playgroud)
(在我的平台文件夹中,列出的唯一平台是android-25)
有什么建议?
我不知道是什么导致了这个错误.它似乎是一个没有修复的错误.任何人都可以告诉我如何解决这个问题吗?令我感到沮丧的是,我永无止境.谢谢.
Operations to perform:
Apply all migrations: admin, contenttypes, optilab, auth, sessions
Running migrations:
Rendering model states... DONE
Applying optilab.0006_auto_20160621_1640...Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 353, in execute_from_command_line
utility.execute()
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 345, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 348, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 399, in execute
output = self.handle(*args, **options)
File "C:\Python27\lib\site-packages\django\core\management\commands\migrate.py", line 200, in handle
executor.migrate(targets, plan, fake=fake, fake_initial=fake_initial)
File "C:\Python27\lib\site-packages\django\db\migrations\executor.py", line 92, in migrate
self._migrate_all_forwards(plan, …Run Code Online (Sandbox Code Playgroud) 我正在加载一个模板,该模板使用我的代码引用客户端js文件,如下所示:
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.0.1/vue.js"></script>
<link rel="stylesheet" type="text/css" href="../css/app.css">
</head>
<body>
<div id="container">
<div id="map">
<script src="../js/app.js" type="text/javascript"></script>
<div id="offer-details">
<form id="offer-form" v-on:submit="makeOffer(tags, description, code)">
<input id="description"/>
<input id="tags"/>
<input id="code"/>
<input type="submit"/>
</form>
</div>
</div>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我的浏览器显示以下(details.js)成功加载.
var vm = new Vue({
el: "#details",
data: {
offer: {
publickey: '',
privatekey: '',
name: '',
service: '',
value: '',
currency: '',
tags: '',
description: '',
code: ''
},
methods: {
makeOffer: function makeOffer(){console.log(vm.publickey)}
}
}
}) …Run Code Online (Sandbox Code Playgroud) 我按照说明在这里注册和使用自定义元素:
https://alligator.io/vuejs/custom-elements/
我正在使用Vue的标准Webpack模板.
我跑的时候
npm run build
Run Code Online (Sandbox Code Playgroud)
我希望在dist目录中获得一个名为element.js的打包Web组件文件.但是没有任何事情发生.有谁知道是否需要额外的步骤?文档没有说清楚.
这在我的项目中产生了以下文件:
<template>
<div id="app">
<example myProp="I can pass props!"></example>
</div>
</template>
<script>
import Example from './components/example.Vue'
export default {
name: 'app',
components: {
Example
}
}
</script>
<style>
</style>
Run Code Online (Sandbox Code Playgroud)
main.js
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import vueCustomElement from 'vue-custom-element'
Vue.config.productionTip = false
Vue.use(vueCustomElement);
/* eslint-disable no-new …Run Code Online (Sandbox Code Playgroud) 我正在尝试导出我的firebase应用程序,所以我可以在mocha测试规范内部以及我正在尝试测试的源代码中调用它.
我的Mocha测试规范如下所示:
import Vue from 'vue'
import Edit from '@/components/Edit'
import filedata from '../../../static/filedata.js'
import submitFile from '../../../helpers/submitFile.js'
import firebaseapp from '../../../src/db.js'
var db = firebaseapp.database()
var storage = firebaseapp.storage()
describe('Edit.vue', () => {
it('should let me add files without choosing a category', () => {
// add files to appear on the homepage
var Constructor = Vue.extend(Edit)
var vm = new Constructor().$mount()
console.log(filedata + ' is the file data')
var ref = storage.ref('categories')
console.log(ref)
submitFile(filedata)
}) ...
Run Code Online (Sandbox Code Playgroud)
submitFile文件如下所示:
var …Run Code Online (Sandbox Code Playgroud) 我一直绞尽脑汁,无法弄清楚为什么在导入'views'时会出现导入错误.当我访问索引页面时收到以下消息:
"
Request Method: GET
Request URL: http://127.0.0.1:8000/moments/
Django Version: 1.6.1
Exception Type: ImportError
Exception Value:
No module named views
Exception Location: C:\Python27\lib\site-packages\django\utils\importlib.py in import_module, line 40
"
Run Code Online (Sandbox Code Playgroud)
这是我的urls.py
from django.conf.urls import patterns, url
from moments_app import views
urlpatterns = patterns('',
url(r'^$', "views.index", name='index'),
url(r'^$', "views.choose_dataset", name='choose'),
url(r'^get_moments/', "views.get_moments", name='get_moments'),
url(r'^learn/$', "views.learn", name='learn'),
url(r'^(?P<moment_id>\d+)/$', "views.detail", name='detail'),
)
Run Code Online (Sandbox Code Playgroud)
我在moments_app文件夹中显然有一个名为views的模块.此外,moments_app在我的道路上.有没有人对可能导致这种情况的原因有任何想法?
我正在尝试为以下功能设置 pytest-bdd 套件。
Feature: Tree
# BUILD TOP-DOWN
Scenario: Add properties to tree
Given a new tree is created with name default
When the name of the tree is asked for
Then default is returned
Run Code Online (Sandbox Code Playgroud)
由于某种原因,when尽管字符串看起来相同,但我的步骤未被识别:
from pytest_bdd import scenario, given, when, then
from models import Tree
@scenario("../features/Tree.feature", "Add properties to tree")
def test_tree():
pass
@given("a new tree is created with name default", target_fixture="tree")
def tree():
return Tree(name="default")
@when("the name of the tree is asked for")
def get_name(tree): …Run Code Online (Sandbox Code Playgroud) 我正在尝试创建一个名为'_users'的简单数据库,并使用Couch-DB将新用户插入其中.
我在shell中使用Node来运行以下代码:
UserProfile.js
var nano = require('nano')('http://localhost:5984')
module.exports = {
addUser: function(id, name, password){
var usersDB = nano.use('_users')
var options = {
"_id": "org.couchdb.user:"+id,
"name": id,
"roles": [],
"type": "user",
"password": password
}
usersDB.insert(options, function(err, body, header) {
console.log('insert is being called')
if (err) {
console.log(err.message);
return;
}
console.log(body);
});
}
};
Run Code Online (Sandbox Code Playgroud)
节点repl
> var nano = require('nano')('http://localhost:5984')
undefined
> var usersdb = nano.db.destroy('_users')
undefined
> var usersdb = nano.db.create('_users')
undefined
> var profile = require('./UserProfile.js')
undefined
> profile.addUser('cheese', 'flubber', …Run Code Online (Sandbox Code Playgroud) 我可以将MongoDB打包在Electron应用程序中,这样我就不需要在客户端的机器上安装它了吗?我正在OSX上开发一个应用程序,它可能会在Windows上使用.我是否需要在客户端单独安装Mongo?
我有以下步骤定义,这会导致错误,因为@given找不到夹具,即使它是在 中定义的target_fixture:
import pytest
from pytest_bdd import scenario, given, when, then, parsers
from admin import Admin
@scenario('../features/Admin.feature',
'register a new user')
def test_admin():
pass
@given('I\'m logged in as an admin at <host_name> with email <admin_email> and password <admin_password>', target_fixture="admin_login")
def admin_login(host_name, admin_email, admin_password):
admin = Admin(admin_email, admin_password)
admin.login(host_name)
# assert admin.status_code == 200
return admin
@when('I call the register method for host <host_name> with email <user_email> and password <user_password> and firstName <first_name> and last name <last_name>') …Run Code Online (Sandbox Code Playgroud) javascript ×4
python ×4
node.js ×3
vue.js ×3
django ×2
pytest ×2
pytest-bdd ×2
webpack ×2
android ×1
cordova ×1
couchdb ×1
couchdb-nano ×1
django-views ×1
ecmascript-6 ×1
electron ×1
firebase ×1
import ×1
mongodb ×1
nosql ×1
sdk ×1
sqlite ×1