当前位置: 首页 > 知识库问答 >
问题:

Android Studio的权限被拒绝

凤经武
2023-03-14

在android studio中运行应用程序时,我遇到了权限被拒绝的问题。在此之前,我需要声明,我的队友可以运行代码并弹出数据,但我,我们都使用相同的代码和版本,但我使用的是mac,他们使用的是win系统。

以下是logcat信息:

Late-enabling -Xcheck:jni
E/ample.inclass0: Unknown bits set in runtime_flags: 0x8000
W/ample.inclass0: Unexpected CPU variant for X86 using defaults: x86
D/libEGL: Emulator has host GPU support, qemu.gles is set to 1.
W/RenderThread: type=1400 audit(0.0:660): avc: denied { write } for name="property_service" dev="tmpfs" ino=857 scontext=u:r:untrusted_app:s0:c151,c256,c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0
W/libc: Unable to set property "qemu.gles" to "1": connection failed; errno=13 (Permission denied)
D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
W/ample.inclass0: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
W/ample.inclass0: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
W/System.err: java.net.SocketException: socket failed: EPERM (Operation not permitted)
W/System.err:     at java.net.Socket.createImpl(Socket.java:492)
W/System.err:     at java.net.Socket.getImpl(Socket.java:552)
W/System.err:     at java.net.Socket.setSoTimeout(Socket.java:1180)
W/System.err:     at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.kt:293)
W/System.err:     at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:207)
W/System.err:     at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:226)
W/System.err:     at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:106)
W/System.err:     at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:74)
W/System.err:     at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:255)
W/System.err:     at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32)
W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
W/System.err:     at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
W/System.err:     at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
W/System.err:     at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
W/System.err:     at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
W/System.err:     at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:517)
W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
W/System.err:     at java.lang.Thread.run(Thread.java:919)
D/HostConnection: HostConnection::get() New Host Connection established 0xdb7e2040, tid 5252
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache ANDROID_EMU_sync_buffer_data GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0 
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 0 0
D/EGL_emulation: eglCreateContext: 0xf1f7e5c0: maj 3 min 0 rcv 3
D/EGL_emulation: eglMakeCurrent: 0xf1f7e5c0: ver 3 0 (tinfo 0xe6d24dd0)
W/Gralloc3: mapper 3.x is not supported
D/HostConnection: createUnique: call
D/HostConnection: HostConnection::get() New Host Connection established 0xdb7e3800, tid 5252
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache ANDROID_EMU_sync_buffer_data GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0 
D/eglCodecCommon: allocate: Ask for block of size 0x1000
D/eglCodecCommon: allocate: ioctl allocate returned offset 0x3ff807000 size 0x2000
D/EGL_emulation: eglMakeCurrent: 0xf1f7e5c0: ver 3 0 (tinfo 0xe6d24dd0)
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 1 0

下面是AndroidMainfest文件:For tools sLtaretApi="31"我尝试删除并运行没有任何更改

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

    <uses-permission android:name="android.permission.INTERNET"></uses-permission>



    <application
        android:allowBackup="true"
        android:dataExtractionRules="@xml/data_extraction_rules"
        android:fullBackupContent="@xml/backup_rules"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.InClass07"
        tools:targetApi="31">
        <activity
            android:name=".MainActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

有人能给我一些解决这个问题的建议吗?感谢任何帮助。

共有1个答案

何高旻
2023-03-14

我不确定这是否适合每个人,我通过更改模拟器来解决我的问题。

我以前使用Nexus 5X Q(API29),但现在我切换到Nexus 5X API33它被解决了。我还尝试了其他API33,它工作得很好。

 类似资料:
  • 问题内容: 当我尝试运行简单的docker命令时,例如: 我收到一条错误消息: 获得权限被拒绝… /var/run/docker.sock:connect:权限被拒绝 当我检查权限 我看到这一行: 因此,我遵循许多论坛的建议并将本地用户添加到docker组: 但这无济于事。我仍然收到非常相同的错误消息。我该如何解决? 问题答案: 对于那些刚接触shell的人,命令: 需要在您的外壳中定义。默认情况

  • 问题内容: 尝试显示URI时出现以下异常。我认为这是在我的活动停止后发生的,我尝试再次访问可行的URI。还有其他问题可以解决这个问题,但是我对如何对我的代码应用任何解决方案感到非常困惑,因为我的takePhotoIntent允许拍照或从图库中选择图片(如下所示)。 我的createImageFile和我的takePhotoIntent: 问题答案: 根据Storage Access Framewo

  • 问题内容: 我对编码比较陌生,遇到了麻烦。 我有这段代码可以将数据发送到Firebase 但是,我不断收到错误: FIREBASE警告:设置为/ users /(GoogleID)失败:Permission_denied 2016-05-23 22:52:42.707 firebase.js:227未捕获(承诺)错误:PERMISSION_DENIED:权限被拒绝(…) 当我尝试查找时,它谈论的是

  • 问题内容: 很抱歉来到这里问这个问题,但是我已经读完了所有互联网,试图找到解决方案,但是我仍然遇到这个问题… 我已经成功安装了Jenkins(让我在仍有希望的时候开始)可以在我们的持续集成流程中使用它。 我试图从这样一个简单的例子开始: 但是每次启动时,都会出现此错误: 问题在于用户jenkins(服务和主节点以Jenkins的身份运行)拥有此存储库上的所有权限。我试图授予组和其他人读取和执行的权

  • 问题内容: 我正在尝试将查询写入文件以进行调试。该文件位于中。我要写入的文件是。 我正在尝试使用 但是我越来越 file_put_contents(queries.txt)[function.file-put-contents]:无法打开流:权限被拒绝 我的文件chmod’d为777,可能是什么问题? 问题答案: 尝试调整目录权限。 在终端上运行(从包含数据库文件夹的目录中运行) apache,如

  • 大家好,我正在尝试阅读一个网站的内容与以下代码 但我得到以下错误,我不知道如何解决它。 如果你有什么想法,不要害羞。