应用程序崩溃代码

时间:2016-06-06 10:16:48

标签: android

我现在有一个大问题。我有一个proyect发送,并在最后一刻有最后一个功能的问题。所有proyect工作正常,除了las功能卷(“dados”),因为大多数代码是西班牙语(我的母语)你会看到很多西班牙语,但骰子类完全是英语。

https://drive.google.com/file/d/0B148ladEOxa1dXJkaGx6dkVtZlU/view

我不知道该怎么做,我试着调试,但我没有看到任何错误。 Problaby我错过了什么......

非常感谢你的帮助 // 这是错误:

06-06 10:36:46.763 8836-8836/es.dam.sergio.proyectofinal E/AndroidRuntime: FATAL EXCEPTION: main
                                                                           Process: es.dam.sergio.proyectofinal, PID: 8836
                                                                           java.lang.RuntimeException: Unable to start activity ComponentInfo{es.dam.sergio.proyectofinal/es.dam.sergio.proyectofinal.dados}: java.lang.SecurityException: Neither user 10058 nor current process has android.permission.WAKE_LOCK.
                                                                               at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
                                                                               at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
                                                                               at android.app.ActivityThread.access$800(ActivityThread.java:151)
                                                                               at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
                                                                               at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                               at android.os.Looper.loop(Looper.java:135)
                                                                               at android.app.ActivityThread.main(ActivityThread.java:5254)
                                                                               at java.lang.reflect.Method.invoke(Native Method)
                                                                               at java.lang.reflect.Method.invoke(Method.java:372)
                                                                               at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
                                                                               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
                                                                            Caused by: java.lang.SecurityException: Neither user 10058 nor current process has android.permission.WAKE_LOCK.
                                                                               at android.os.Parcel.readException(Parcel.java:1546)
                                                                               at android.os.Parcel.readException(Parcel.java:1499)
                                                                               at android.os.IPowerManager$Stub$Proxy.acquireWakeLock(IPowerManager.java:337)
                                                                               at android.os.PowerManager$WakeLock.acquireLocked(PowerManager.java:974)
                                                                               at android.os.PowerManager$WakeLock.acquire(PowerManager.java:942)
                                                                               at es.dam.sergio.proyectofinal.dados.onCreate(dados.java:33)
                                                                               at android.app.Activity.performCreate(Activity.java:5990)
                                                                               at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
                                                                               at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
                                                                               at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) 
                                                                               at android.app.ActivityThread.access$800(ActivityThread.java:151) 
                                                                               at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) 
                                                                               at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                               at android.os.Looper.loop(Looper.java:135) 
                                                                               at android.app.ActivityThread.main(ActivityThread.java:5254) 
                                                                               at java.lang.reflect.Method.invoke(Native Method) 
                                                                               at java.lang.reflect.Method.invoke(Method.java:372) 
                                                                               at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) 
                                                                               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 
06-06 10:36:48.444 8836-8836/es.dam.sergio.proyectofinal I/Process: Sending signal. PID: 8836 SIG: 9

//

这是清单:

<application
    android:allowBackup="true"
    android:icon="@mipmap/portada"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <uses-permission android:name="android.permission.WAKE_LOCK"/>
    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".Reglas"></activity>
    <activity android:name=".reglasMain"></activity>
    <activity android:name=".reglasClanes"></activity>
    <activity android:name=".reglasExperiencia"></activity>
    <activity android:name=".map"></activity>
    <activity android:name=".barImage"></activity>
    <activity android:name=".bosqueImage"></activity>
    <activity android:name=".calleImage"></activity>
    <activity android:name=".parkingImage"></activity>
    <activity android:name=".acciones"></activity>
    <activity android:name=".dados"></activity>
    <activity android:name=".hojapj"></activity>
    <activity android:name=".atributospj"></activity>
    <activity android:name=".datospj"></activity>
    <activity android:name=".talentospj"></activity>
    <activity android:name=".tecnicaspj"></activity>
    <activity android:name=".conocimientospj"></activity>
    <activity android:name=".disciplinaspj"></activity>
    <activity android:name=".transfondopj"></activity>
    <activity android:name=".virtudespj"></activity>
    <activity android:name=".estadisticaspj"></activity>



</application>

添加权限后的第二个错误。

06-06 11:27:40.414 13662-13662/es.dam.sergio.proyectofinal E/AndroidRuntime: FATAL EXCEPTION: main
                                                                             Process: es.dam.sergio.proyectofinal, PID: 13662
                                                                             java.lang.RuntimeException: Unable to start activity ComponentInfo{es.dam.sergio.proyectofinal/es.dam.sergio.proyectofinal.dados}: android.view.InflateException: Binary XML file line #73: Error inflating class com.flip.diceroller.DieButton
                                                                                 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
                                                                                 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
                                                                                 at android.app.ActivityThread.access$800(ActivityThread.java:151)
                                                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
                                                                                 at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                 at android.os.Looper.loop(Looper.java:135)
                                                                                 at android.app.ActivityThread.main(ActivityThread.java:5254)
                                                                                 at java.lang.reflect.Method.invoke(Native Method)
                                                                                 at java.lang.reflect.Method.invoke(Method.java:372)
                                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
                                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
                                                                              Caused by: android.view.InflateException: Binary XML file line #73: Error inflating class com.flip.diceroller.DieButton
                                                                                 at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:757)
                                                                                 at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
                                                                                 at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
                                                                                 at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
                                                                                 at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
                                                                                 at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
                                                                                 at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:378)
                                                                                 at android.app.Activity.setContentView(Activity.java:2145)
                                                                                 at es.dam.sergio.proyectofinal.dados.onCreate(dados.java:35)
                                                                                 at android.app.Activity.performCreate(Activity.java:5990)
                                                                                 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
                                                                                 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
                                                                                 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) 
                                                                                 at android.app.ActivityThread.access$800(ActivityThread.java:151) 
                                                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) 
                                                                                 at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                 at android.os.Looper.loop(Looper.java:135) 
                                                                                 at android.app.ActivityThread.main(ActivityThread.java:5254) 
                                                                                 at java.lang.reflect.Method.invoke(Native Method) 
                                                                                 at java.lang.reflect.Method.invoke(Method.java:372) 
                                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) 
                                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 
                                                                              Caused by: java.lang.ClassNotFoundException: Didn't find class "com.flip.diceroller.DieButton" on path: DexPathList[[zip file "/data/app/es.dam.sergio.proyectofinal-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
                                                                                 at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
                                                                                 at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
                                                                                 at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
                                                                                 at android.view.LayoutInflater.createView(LayoutInflater.java:571)
                                                                                 at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
                                                                                 at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) 
                                                                                 at android.view.LayoutInflater.rInflate(LayoutInflater.java:809) 
                                                                                 at android.view.LayoutInflater.inflate(LayoutInflater.java:504) 
                                                                                 at android.view.LayoutInflater.inflate(LayoutInflater.java:414) 
                                                                                 at android.view.LayoutInflater.inflate(LayoutInflater.java:365) 
                                                                                 at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:378) 
                                                                                 at android.app.Activity.setContentView(Activity.java:2145) 
                                                                                 at es.dam.sergio.proyectofinal.dados.onCreate(dados.java:35) 
                                                                                 at android.app.Activity.performCreate(Activity.java:5990) 
                                                                                 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) 
                                                                                 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278) 
                                                                                 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) 
                                                                                 at android.app.ActivityThread.access$800(ActivityThread.java:151) 
                                                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) 
                                                                                 at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                 at android.os.Looper.loop(Looper.java:135) 
                                                                                 at android.app.ActivityThread.main(ActivityThread.java:5254) 
                                                                                 at java.lang.reflect.Method.invoke(Native Method) 
                                                                                 at java.lang.reflect.Method.invoke(Method.java:372) 
                                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) 
                                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 
                                                                                Suppressed: java.lang.ClassNotFoundException: Didn't find class "com.flip.diceroller.DieButton" on path: DexPathList[[dex file "/data/data/es.dam.sergio.proyectofinal/files/instant-run/dex/slice-support-annotations-23.1.1_b952757f2113b6ade13ca7c400dcf4dfb352b6bf-classes.dex", dex file "/data/data/es.dam.sergio.proyectofinal/files/instant-run/dex/slice-slice_9-classes.dex", dex file "/data/data/es.dam.sergio.proyectofinal/files/instant-run/dex/slice-slice_8-classes.dex", dex file "/data/data/es.dam.sergio.proyectofinal/files/instant-run/dex/slice-slice_7-classes.dex", dex file "/data/data/es.dam.sergio.proyectofinal/files/instant-run/dex/slice-slice_6-classes.dex", dex file "/data/data/es.dam.sergio.proyectofinal/files/instant-run/dex/slice-slice_5-classes.dex", dex file "/data/data/es.dam.sergio.proyectofinal/files/instant-run/dex/slice-slice_4-classes.dex", dex file "/data/data/es.dam.sergio.proyectofinal/files/instant-run/dex/slice-slice_3-classes.dex", dex file "/data/data/es.dam.sergio.proyectofinal/files/instant-run/dex/slice-slice_2-classes.dex", dex file "/data/data/es.dam.sergio.proyectofinal/files/instant-run/dex/slice-slice_1-classes.dex", dex file "/data/data/es.dam.sergio.proyectofinal/files/instant-run/dex/slice-slice_0-classes.dex", dex file "/data/data/es.dam.sergio.proyectofinal/files/instant-run/dex/slice-internal_impl-23.1.1_93238ed2e7d919a6201e977bdb17c9e84f4f91f8-classes.dex", dex file "/data/data/es.dam.sergio.

1 个答案:

答案 0 :(得分:1)

第一个问题:

java.lang.SecurityException: Neither user 10058 nor current process has android.permission.WAKE_LOCK

uses-permission位于manifest元素下,不在清单文件中的application下。

第二个问题:

  

java.lang.ClassNotFoundException:找不到类&#34; com.flip.diceroller.DieButton&#34;在路径上

您的布局XML文件引用了APK中找不到的类。问题中没有足够的信息来确切说明原因。