调试Android应用错误

时间:2018-08-24 13:16:28

标签: android-studio

在从旧的应用程序项目中将Gradle更新到更高版本后,尝试调试时出现此错误。知道如何解决吗?它与googlemap有关,因为当应用启动并尝试进入包含地图的页面时,该应用将崩溃。 :(

E/AndroidRuntime: FATAL EXCEPTION: main
              Process: my.sdi.android, PID: 22208
              java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.CALL dat=tel:xxxxxxxxxxxx cmp=com.android.server.telecom/.components.UserCallActivity } from ProcessRecord{183b711 22208:my.sdi.android/u0a88} (pid=22208, uid=10088) with revoked permission android.permission.CALL_PHONE
                  at android.os.Parcel.readException(Parcel.java:1943)
                  at android.os.Parcel.readException(Parcel.java:1889)
                  at android.app.IActivityManager$Stub$Proxy.startActivity(IActivityManager.java:4365)
                  at android.app.Instrumentation.execStartActivity(Instrumentation.java:1610)
                  at android.app.Activity.startActivityForResult(Activity.java:4472)
                  at android.app.Activity.startActivityForResult(Activity.java:4430)
                  at android.app.Activity.startActivity(Activity.java:4791)
                  at android.app.Activity.startActivity(Activity.java:4759)
                  at my.sdi.android.LoginActivity$3.onClick(LoginActivity.java:84)
                  at android.view.View.performClick(View.java:6256)
                  at android.view.View$PerformClick.run(View.java:24701)
                  at android.os.Handler.handleCallback(Handler.java:789)
                  at android.os.Handler.dispatchMessage(Handler.java:98)
                  at android.os.Looper.loop(Looper.java:164)
                  at android.app.ActivityThread.main(ActivityThread.java:6541)
                  at java.lang.reflect.Method.invoke(Native Method)
                  at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)


E/ACRA: ACRA caught a SecurityException for my.sdi.android
    java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.CALL dat=tel:xxxxxxxxxxxx cmp=com.android.server.telecom/.components.UserCallActivity } from ProcessRecord{183b711 22208:my.sdi.android/u0a88} (pid=22208, uid=10088) with revoked permission android.permission.CALL_PHONE
        at android.os.Parcel.readException(Parcel.java:1943)
        at android.os.Parcel.readException(Parcel.java:1889)
        at android.app.IActivityManager$Stub$Proxy.startActivity(IActivityManager.java:4365)
        at android.app.Instrumentation.execStartActivity(Instrumentation.java:1610)
        at android.app.Activity.startActivityForResult(Activity.java:4472)
        at android.app.Activity.startActivityForResult(Activity.java:4430)
        at android.app.Activity.startActivity(Activity.java:4791)
        at android.app.Activity.startActivity(Activity.java:4759)
        at my.sdi.android.LoginActivity$3.onClick(LoginActivity.java:84)
        at android.view.View.performClick(View.java:6256)
        at android.view.View$PerformClick.run(View.java:24701)
        at android.os.Handler.handleCallback(Handler.java:789)
        at android.os.Handler.dispatchMessage(Handler.java:98)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6541)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

1 个答案:

答案 0 :(得分:0)

我遇到同样的问题
如果您已经为清单添加了权限
quote=input("Enter a quote ") # Make sure to split by " " character split=quote.split(" ") # Make sure to get the length of the list of words in the split variable for count in range(0, len(split)): # Print each word, not the whole array print(split[count])
使用<uses-permission android:name="android.permission.CALL_PHONE"/>代替Intent.ACTION_DIAL
它将调出电话拨号程序,就像其他应用程序的行为一样(相同的用户体验)。