【问题标题】:Android error when compiling编译时Android错误
【发布时间】:2015-04-11 05:27:06
【问题描述】:

当我运行 MainActivity 时,一切正常,当我启动 Intent 时会显示错误,我不会共享代码,因为它是私有的,但我希望这个错误消息就足够了。

我在使用 Android 时遇到了问题,这是我收到的错误:

04-11 00:23:42.136 9030-9030/vox.office D/libEGL﹕ loaded /system/lib/egl/libEGL_mali.so 04-11 00:23:42.171 9030-9030/vox.office D/libEGL﹕ loaded /system/lib/egl/libGLESv1_CM_mali.so 04-11 00:23:42.171 9030-9030/vox.office D/libEGL﹕ loaded /system/lib/egl/libGLESv2_mali.so 04-11 00:23:42.186 9030-9030/vox.office D/﹕ Device driver API match Device driver API version: 10 User space API version: 10 04-11 00:23:42.186 9030-9030/vox.office D/﹕ mali: REVISION=Linux-r2p4-02rel0 BUILD_DATE=Tue Oct 16 15:37:13 KST 2012 04-11 00:23:42.251 9030-9030/vox.office D/OpenGLRenderer﹕ Enabling debug mode 0 04-11 00:23:45.036 9030-9030/vox.office E/SensorManager﹕ thread start 04-11 00:23:45.041 9030-9030/vox.office D/SensorManager﹕ registerListener :: handle = 0 name= LSM330DLC 3-axis Accelerometer delay= 200000 Listener= android.view.OrientationEventListener$SensorEventListenerImpl@42d8d708 04-11 00:23:45.366 9030-9030/vox.office E/SpannableStringBuilder﹕ SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length 04-11 00:23:45.366 9030-9030/vox.office E/SpannableStringBuilder﹕ SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length 04-11 00:23:45.411 9030-9033/vox.office D/dalvikvm﹕ GC_CONCURRENT freed 114K, 9% free 12434K/13639K, paused 18ms+3ms, total 44ms 04-11 00:23:49.526 9030-9030/vox.office D/SensorManager﹕ unregisterListener:: Listener= android.view.OrientationEventListener$SensorEventListenerImpl@42d8d708 04-11 00:23:49.526 9030-9030/vox.office D/Sensors﹕ Remain listener = Sending .. normal delay 200ms 04-11 00:23:49.526 9030-9030/vox.office I/Sensors﹕ sendDelay --- 200000000 04-11 00:23:49.526 9030-9030/vox.office D/SensorManager﹕ JNI - sendDelay 04-11 00:23:49.526 9030-9030/vox.office I/SensorManager﹕ Set normal delay = true 04-11 00:23:49.946 9030-9033/vox.office D/dalvikvm﹕ GC_CONCURRENT freed 270K, 11% free 12609K/14023K, paused 13ms+2ms, total 31ms 04-11 00:23:49.956 9030-9030/vox.office D/AbsListView﹕ Get MotionRecognitionManager 04-11 00:23:50.216 9030-9033/vox.office D/dalvikvm﹕ GC_CONCURRENT freed 223K, 10% free 12805K/14151K, paused 13ms+14ms, total 42ms 04-11 00:23:50.366 9030-9033/vox.office D/dalvikvm﹕ GC_CONCURRENT freed 414K, 11% free 12821K/14343K, paused 2ms+5ms, total 26ms 04-11 00:23:50.586 9030-9033/vox.office D/dalvikvm﹕ GC_CONCURRENT freed 457K, 11% free 12845K/14407K, paused 12ms+17ms, total 59ms 04-11 00:23:50.766 9030-9033/vox.office D/dalvikvm﹕ GC_CONCURRENT freed 476K, 11% free 12851K/14407K, paused 5ms+8ms, total 45ms

我得到了类似的东西Error Moving Data From One Activity to Another

这是我的问题,我遇到了同样的错误,但我的清单没问题:

 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
 package="vox.office" >


 <uses-sdk android:minSdkVersion="14"
    android:targetSdkVersion="16" />

 <application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".Text"
        android:label="@string/title_activity_text" >
        <intent-filter>
            <action android:name="vox.office.Text" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".showText"
        android:label="@string/title_activity_show_text" >
        <intent-filter>
            <action android:name="vox.office.showText" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
   </application>

  </manifest>

意图:

         Intent intent = new Intent(MainActivity.this,Text.class );
         intent.putExtra("nameFile", name);
         startActivity(intent);

感谢您的帮助:)

【问题讨论】:

  • 你能发布堆栈跟踪吗?截图太小,不显示任何错误
  • @Sunil ha 对不起,我编辑了,您可以在另一个标签页中打开图像。
  • 嗯.. 没有抛出任何异常。你怎么说你有错误?如果出现错误,您的应用程序应该抛出异常吗?您的应用程序是否关闭并显示无响应消息?您是否捕获任何异常而不打印堆栈跟踪?您在此处显示的消息似乎是常规日志消息
  • @Sunil 在 catch 块中:e.printStackTrace();是的,应用程序关闭但没有响应消息,我每秒都收到此消息“D/dalvikvm:GC_CONCURRENT freed 476K, 11% free 12851K/14407K, paused 5ms+8ms, total 45ms” tnx
  • 您能否删除 catch 语句或发布 e.printStackTrace 正在打印的内容?使用调试器查看是否抛出异常。必须有相关的堆栈跟踪

标签: android


【解决方案1】:

发现类似问题试试这个

What do these Android logcat warnings mean?

正如@ArthurT 所说,将您的构建 gradle 更改为旧版本并尝试一次

编译'com.android.support:appcompat-v7:20.0.0'

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-02
    • 2013-12-25
    • 2013-05-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多