
android错误
JQ_AK47
这个作者很懒,什么都没留下…
展开
-
[Android Studio1.5][NDK r13b]Execution failed for task ':app:compileDebugNdk'. Error Code:2
参考链接 1、在Windows下NDK一个bug,当jni下仅仅编译一个文件时出现会出现此问题,解决方法就是往jni文件夹加入一个空util.c文件即可。2、在app/build.gradle下面的android节点里面新增一个子节点。sourceSets.main { jniLibs.srcDirs 'libs' jni.srcDirs = []}实验有效原创 2016-11-29 09:46:37 · 765 阅读 · 0 评论 -
java.lang.IllegalStateExceptionThe specified child already has a parent
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child’s parent first.首先说下这个异常普遍出现在动态添加View时,出现。你第一次动态加载一个view到一个container时候不会报错,但是第二次动态加载到co原创 2016-09-08 16:32:55 · 2185 阅读 · 0 评论 -
NDK开发中Type 'int32_t' could not be resolved
参考网址 给出如下的建议,就是将size_t,或者int32_t这类类型申明的头文件路径加进去到path中。 size_t is defined in stddef.h which is compiler specific. In order to add it to the include path you have to add the /toolchain//prebuilt//lib原创 2016-09-18 09:57:57 · 2493 阅读 · 0 评论 -
ubuntu中adtbundle中ndk开发报 Type 'JNIEnv' could not be resolved
出现的提示信息如下: Multiple markers at this line - Syntax error - Type ‘JNIEnv’ could not be resolved - Type ‘JNICALL’ could not be resolved是由于没有将jni.h导入的缘故,而这个文件在ndk的目录下面。所以,参照以下步骤: 选中工程右键Project P原创 2016-09-18 10:08:28 · 985 阅读 · 0 评论 -
android.view.ViewRoot$CalledFromWrongThreadException 异常的解决方案Activity类runOnUiThread方法
在android平台下,进行多线程编程时,经常需要在主线程之外的一个单独的线程中进行某些处理,然后更新用户界面显示。但是,在主线线程之外的线程中直接更新页面显示的问题是:系统会报这个异常,android.view.viewroot$calledfromwrongthreadexception: only the original thread that created a view hierarch原创 2016-09-01 18:18:55 · 1811 阅读 · 0 评论 -
java.net.MalformedURLException: Protocol not found: android.widget.EditText
根据这个报错信息,经过在stackoverflow上面得知是因为程序从文本框获得文本不是可知的协议形式。我是因为从一个edittext框中获取文本时用这个语句:String path = pathText. toString(); 一不小心就犯错。 然后改成String path = pathText.getText().toString(); 就对了。原创 2016-08-24 23:52:29 · 2098 阅读 · 0 评论 -
Android之NetworkOnMainThreadException异常
网络请求在MainThread中产生的异常,也就是说我们的类似于网络请求这些耗时操作放在UI线程中了。ui线程也叫main线程(主线程)。ui线程主要负责与用户的界面交互功能。所以对延时比较忌讳。一般情况下有两种常用方法用于协调这两个之前的矛盾。 1、network有关比较耗时的操作放到一个子线程里,然后用Handler消息机制与主线程通信。。 2,使用异步机制如:asynctask原创 2016-08-24 23:46:59 · 580 阅读 · 0 评论 -
org.xmlpull.v1.XmlPullParserException: Unexpected token
org.xmlpull.v1.XmlPullParserException: Unexpected token (position:unknown @5:1 in java.io.InputStreamReader@3fe1c1a2)原创 2016-08-24 20:05:17 · 3359 阅读 · 0 评论 -
android.content.ActivityNotFoundException: Unable to find explicit activity
首先这个错误的发送的背景是:adtbundle中有两个android项目,项目1:networkapp,项目2:libQR,作为一个库项目。 项目1引用项目2中的内容。 对于怎么设置一个android项目为库项目,另外一个项目引用这个库项目的两步骤在这里有。我只做了如下两步: 1、对于项目2库项目单击左侧的android选项,勾上右侧面板中的Is Library复选框,单击ok,完成了对一个a原创 2016-09-02 17:53:47 · 874 阅读 · 0 评论 -
java.lang.IllegalStateException: Could not execute method of the activity
参考链接 参考链接 从上面连个链接可知会报这个错误是,一般情况下是一个方法在还没有到可执行的状态时先执行了。或者因为延时操作在ui线程中执行。造成ui线程不能响应用户操作。 如下我的报错是因为没有将网络请求放在子线程中执行,引起ui线程报经典的原创 2016-08-27 17:27:36 · 1240 阅读 · 0 评论 -
android.view.ViewRootImpl$CalledFromWrongThreadException:
android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.在Android平台下,进行多线程编程时,经常需要在主线程之外的一个单独的线程中进行某些处理,比如网络请求然后更新用户界面显示。但是,在原创 2016-07-26 15:43:52 · 2581 阅读 · 0 评论 -
页面布局文件出错故障排除
错误信息如下: Exception raised during rendering: Java.lang.System.arraycopy([CI[CII)V Exception details are logged in Window > Show View > Error Log 修改选择不同的API就好了。API带W表示wear可能不带AutoCompleteTextView文本输入框原创 2016-07-13 15:54:08 · 2252 阅读 · 0 评论 -
调用CallStaticObjectMethod报出JNI DETECTED ERROR IN APPLICATION: jclass is an invalid local reference:
最近遇到一个JNI的问题,一套代码在Android上首次运行是OK的,但是在第二次运行之后设备就会崩溃,查看logcat发现报JNI DETECTED ERROR IN APPLICATION错误。 (1)错误: accessed stale local reference 0x57200019 (index 6 in a table of size 6) JNI DETECTED ERROR原创 2016-12-03 20:50:00 · 6751 阅读 · 0 评论