设计开发

[ZT]如何解决:Android中 Error generating final archive: Debug Certificate expired on … 的错误

问题概述:

在导入一个app后提示如下错误:

“Error generating final archive: Debug Certificate expired on 10/09/18 16:30”

 

原因分析:

android要求所有的程序必须有签名,否则就不会安装该程序。在我们开发过程中,adt使用debug keystore,在 preference->android->buid中设置。debugkeystore默认有效期为一年,如果你是从一年前开始完android程序,那么在一年后导入这个app的时候很可能出现debug keystore过期,导致你无法生成 apk文件。

此时你只要删除debug keystore就行,系统又会为你生成有效期为一年的私钥。

 

解决方法:

进入C:\Documents and Settings\Administrator\.android 删除路径下的debug.keystore及 ddms.cfg。

(不同环境下的目录可能略有不同,可在eclipse中查找此路径:Window->Preferences->Android->Build下 Default debug keystore)

然后重新导入即可。

原文:http://www.cnblogs.com/yyangblog/archive/2011/01/07/1929657.html

XCode中cpp文件第一行出现Parse Issue: Expected unqualified-id错误的原因

移植Win32下的cpp文件到xcode中编译时发现,代码可以顺利通过编译,但在xcode中一查看cpp文件就会出现标题中的那个错误,虽然不影响编译运行程序,但是所有的h中的关键字都不能高亮且会导致一些关联的语法错误,起初以为是header search path的问题,但排查一通后发现问题原来是出在源文件的编码方式上!

xcode默认是使用UTF-8作为源代码文本文件的字符编码的,曾经为了统一这个,Win32下的cpp也改为了UTF-8,但是windows下的UTF-8文本文件头中会加入几个字节的编码标示,比如UTF-8是EF BB BF,UTF-16也有,是什么记不清了,是2个byte的。

导致xcode parse source时出错的就是这个字节标识,删掉就可以了。

deprecated conversion from string constant to char *

可能是xcode4用的gcc版本比较高的原因,在移植代码的时候出现了这样一个警告,正好提高了一下对const char*的认识。

void foo(char* szArg);

这样的函数这样 foo(“test”); 调用就会提示这个警告,以前可能没太注意过,因为传递的参数字符串是被作为常量处理的,而函数原型却要得不是const指针,也就是说函数内实现是允许修改指针内存的,所以编译器就爆了,理所应当的一个warning,改成const char*参数类型就可以了。

Your debugger is not using the correct symbols

今个用WinDBG研究IDT时突然出现!idt命令提示Your debugger is not using the correct symbols,不知何故,试了一些网上提到的解决方法,都不太好使,结果发现只要简单的.reload一下就可以了,真是莫名其妙。

关于短信SMS的class

最近在研究GSM通信模块相关的AT指令时,发现短信部分经常提到个短信的class,不知为何,搜了一下,特此记录:

What are the classes of SM-MT (mobile terminated) messages?

Classes identify the message’s importance as well as the location where it should be stored. There are 4 message classes.
Class 0: Indicates that this message is to be displayed on the MS immediately and a message delivery report is to be sent back to the SC. The message does not have to be saved in the MS or on the SIM card (unless selected to do so by the mobile user).
Class 1: Indicates that this message is to be stored in the MS memory or the SIM card (depending on memory availability).
Class 2: This message class is Phase 2 specific and carries SIM card data. The SIM card data must be successfully transferred prior to sending acknowledgement to the SC. An error message will be sent to the SC if this transmission is not possible.
Class 3: Indicates that this message will be forwarded from the receiving entity to an external device. The delivery acknowledgement will be sent to the SC regardless of whether or not the message was forwarded to the external device.

Eclipse配合ADT为Android项目添加Proguard混淆的简单新方法

之前我曾经写过一篇如何为用ADT创建的Android项目添加Proguard混淆支持的文章(
为Eclipse ADT创建的android项目通过ant添加proguard混淆支持
),当时我就说过,相信随着Google Android的不断更新发展以及Eclipse ADT插件的不断改进,总有一天,做Android项目时能够和J2ME项目一样方便的一键打包混淆。现在新版的SDK和ADT就已经添加了这样的功能(SDK Tools中已经整合了Proguard的发行包,连这步配置都省了!),虽然还不是一键,但也就是小改一个配置文件的事,相对以前的手改ant xml build file的做法来说已经是极大的简化了添加混淆支持的难度了。

先说说我写这篇文章时用的开发环境:Eclipse 3.5.2+ADT 9.0.0+SDK Tools R9+SDK Platform-tools R2。

声明我不保证在其他版本的IDE ADT和SDK Tools下我的方法是否可行且不会产生问题!

Continue reading…

The source file is different from when the module was built.

*******************************

Source file: D:\Projects\StereoMatch\stereomatcher.cpp

Module: D:\Projects\StereoMatch\Debug\StereoMatch.exe

Process: [4024] StereoMatch.exe

The source file is different from when the module was built. Would you like the debugger to use it anyway?

*******************************

***********************************

At StereoMatcher.cpp, line 166 (‘ComputeCorrespondence()’, line 128)

The breakpoint will not currently be hit. The source code is different from the original version.

Continue reading…