首页 \ 问答 \ android:未能在设备“device”上安装.apk:超时(android: Failed to install .apk on device “device”: timeout)

android:未能在设备“device”上安装.apk:超时(android: Failed to install .apk on device “device”: timeout)

几天前,我尝试在我的Galaxy S2上安装.apk时遇到了麻烦。 我选择手机作为目标,单击确定,然后在控制台中获取以下错误:

未能在设备'设备号'上安装AvatarRun.apk:超时启动取消!

不用改变任何代码并再次运行,我也可以得到这个错误:

未能在设备'设备号'上安装AvatarRun.apk:找不到设备com.android.ddmlib.InstallException:找不到设备启动取消!

我尝试打开命令窗口并导航到android-sdk \ platform-tools并运行:

adb kill-server adb start-server

这并没有解决这个问题。

这似乎只是一个巧合,但是在多次失败之后,我将Manifest中的最小SDK从10更改为7,并在下一次尝试中加载了.apk,但之后发生了交互并产生了相同的错误。

任何人都可以提出一种方法来查找是什么导致此错误?


A few days ago I started having troubles while trying to install a .apk on my Galaxy S2. I select my phone as the target, click OK and in the Console get the following error:

Failed to install AvatarRun.apk on device 'device number': timeout Launch canceled!

Without changing anything in code and running again I can also get the error:

Failed to install AvatarRun.apk on device 'device number': device not found com.android.ddmlib.InstallException: device not found Launch canceled!

I have tried opening a command window and navigating to android-sdk\platform-tools and running:

adb kill-server adb start-server

This did not fix the issue.

This seems to just be a coincidence, but after failing many times I changed the minimum SDK in the Manifest from 10 to 7 and the .apk loaded on the next try, but has worked intermitently since and generates the same errors.

Can anyone suggest a method for finding what is causing this error?


原文:https://stackoverflow.com/questions/15560225
更新时间:2023-06-06 09:06

最满意答案

有几个问题:

  1. 您不能像在SET id := RESERVATION.RES_ID;那样任意引用表列SET id := RESERVATION.RES_ID; 。 您只能在有效的SQL语句(例如SELECT )或NEW / OLD引用列。
  2. 您不能在定义触发器的同一个表上发出DML语句(在您的情况下为UPADTE )。 MySQL中禁止这种变异行为。
  3. 如果我理解正确并且您需要的所有值都在同一行,那么您只需要使用BEFORE触发器。 见下面的例子。

您的触发器可以归结为此

CREATE TRIGGER tg_bu_reservation
BEFORE UPDATE ON reservation
FOR EACH ROW
  SET NEW.res_total_price = (NEW.res_return_date - NEW.res_rent_date) * NEW.res_car_ppd;

注意:因为它现在是一个语句触发器,所以不需要BEGIN...END块并更改DELIMITER

这是SQLFiddle演示


There are several issues:

  1. You can't arbitrarily refer to table columns like you did in SET id := RESERVATION.RES_ID;. You can refer to columns only either in a valid SQL statement (e.g. SELECT) or through NEW/OLD.
  2. You can't issue DML statement (in your case UPADTE) on the same table on which you defined the trigger. This mutating behavior is prohibited in MySQL.
  3. If I understand correctly and all values you need are in the same row, all you need is to use a BEFORE trigger. See example below.

Your trigger can be boiled down to this

CREATE TRIGGER tg_bu_reservation
BEFORE UPDATE ON reservation
FOR EACH ROW
  SET NEW.res_total_price = (NEW.res_return_date - NEW.res_rent_date) * NEW.res_car_ppd;

Note: since it's a one statement trigger now there is no need in BEGIN...END block and changing a DELIMITER.

Here is SQLFiddle demo

相关问答

更多
  • SELECT 'id' FROM 'user' WHERE 'username' 改为` (回报) 你在谈论表名和列名你应该使用反引号。 当你在谈论字符串(比如值)时,请使用单/双引号 SELECT 'id' FROM 'user' WHERE 'username' Change ' to ` (back quote) what you are talking about table names and column names you should use backquote. when you ar ...
  • $query = "UPDATE newlogo SET active=1 WHERE name='".$name."'"; // make the new logo active $query = "UPDATE newlogo SET active=1 WHERE name='".$name."'"; // make the new logo active
  • 尝试逃避反向 $result=mysql_query("SELECT * FROM rivase_chat_posts WHERE sender='$user' AND `to`='$user2' OR sender='$user2' AND `to`='$user'"); 因为它是MySQL中的保留字 try escaping to with backticks $result=mysql_query("SELECT * ...
  • 绝对不要在通过API执行语句时尝试更改分隔符。 DELIMITER是MySQL客户端内置的命令 ,它不被MySQL服务器端解析器识别。 无论如何你都不需要它。 DELIMITER的目的是消除可能出现在触发器或存储例程体内的分号的不明确性。 由于API一次只能执行一条语句,因此不存在歧义。 无论如何,SQL解析器只是将整个字符串视为一个语句。 同样,不要使用$$结束创建触发器语句。 您不需要任何语句终结符,但SQL解析器接受; 作为一个可选的语句终结者,因为很多人把它放在那里,即使他们不需要。 接下来的问题是 ...
  • 有几个问题: 您不能像在SET id := RESERVATION.RES_ID;那样任意引用表列SET id := RESERVATION.RES_ID; 。 您只能在有效的SQL语句(例如SELECT )或NEW / OLD引用列。 您不能在定义触发器的同一个表上发出DML语句(在您的情况下为UPADTE )。 MySQL中禁止这种变异行为。 如果我理解正确并且您需要的所有值都在同一行,那么您只需要使用BEFORE触发器。 见下面的例子。 您的触发器可以归结为此 CREATE TRIGGER tg_bu ...
  • 该函数被称为mysql_query。 注意_ The function is called mysql_query. Note the _
  • 你在sql语法中缺少一个简单的引用。 你的: function addPost($pName, $pAuthor, $pContent, $pCat = null) { $query = mysql_query("INSERT INTO cm_posts VALUES(null,'$pName','$pAuthor','$pContent,'$pCat')") or die(mysql_error()); } 正确: function addPost($pName, $pAuthor, $pContent ...
  • 您应该使用反引号转义列名username ,尝试 SELECT * FROM admin_logins WHERE `Username` = '$username' 您的代码很容易出现SQL注入 。 使用PDO或MYSQLI 使用PDO扩展的示例: prepare("SELECT * FROM admin_logins WHERE `Username` = ?"); $stmt->bindParam(1, $username); if ($stmt->exec ...
  • 也许您正在寻找XOR逻辑运算符 ? SELECT col1, col2 FROM table1 WHERE ( col1 IN ( 1, 3, 4 ) XOR col2 IN ( 1, 3, 4 ) ); XOR如何工作的一个小例子: SELECT true XOR true; -- false SELECT true XOR false; -- true SELECT false XOR true; -- true SELECT false XOR false; -- false 这几 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)