>

안드로이드 스튜디오에서 Google지도 활동을 만들었습니다. 또한 주어진 링크에서 API 키를 생성하여 적절한 위치에 배치했습니다. 그러나 앱을 실행하면 아무것도 표시하지 않고 충돌이 발생합니다. 로그 캣은 다음과 같습니다

2018-12-19 16:13:00.080 17295-17295/? I/ik7.locationap: Not late-enabling -Xcheck:jni (already on)
2018-12-19 16:13:00.312 17295-17295/? W/ik7.locationap: Unexpected CPU variant for X86 using defaults: x86
2018-12-19 16:13:00.667 17295-17295/com.example.nik7.locationapp W/ik7.locationap: JIT profile information will not be recorded: profile file does not exits.
2018-12-19 16:13:00.669 17295-17295/com.example.nik7.locationapp I/chatty: uid=10087(com.example.nik7.locationapp) identical 10 lines
2018-12-19 16:13:00.670 17295-17295/com.example.nik7.locationapp W/ik7.locationap: JIT profile information will not be recorded: profile file does not exits.
2018-12-19 16:13:00.733 17295-17295/com.example.nik7.locationapp I/InstantRun: starting instant run server: is main process
2018-12-19 16:13:01.001 17295-17295/com.example.nik7.locationapp I/zzbz: Making Creator dynamically
2018-12-19 16:13:01.022 17295-17295/com.example.nik7.locationapp W/ik7.locationap: Unsupported class loader
2018-12-19 16:13:01.023 17295-17295/com.example.nik7.locationapp W/ik7.locationap: Skipping duplicate class check due to unsupported classloader
2018-12-19 16:13:01.033 17295-17295/com.example.nik7.locationapp I/DynamiteModule: Considering local module com.google.android.gms.maps_dynamite:0 and remote module com.google.android.gms.maps_dynamite:221
2018-12-19 16:13:01.033 17295-17295/com.example.nik7.locationapp I/DynamiteModule: Selected remote version of com.google.android.gms.maps_dynamite, version >= 221
2018-12-19 16:13:01.033 17295-17295/com.example.nik7.locationapp V/DynamiteModule: Dynamite loader version >= 2, using loadModule2NoCrashUtils
2018-12-19 16:13:01.113 17295-17295/com.example.nik7.locationapp W/ik7.locationap: Unsupported class loader
2018-12-19 16:13:01.131 17295-17295/com.example.nik7.locationapp W/ik7.locationap: Skipping duplicate class check due to unsupported classloader
2018-12-19 16:13:01.180 17295-17295/com.example.nik7.locationapp I/Google Maps Android API: Google Play services client version: 12451000
2018-12-19 16:13:01.192 17295-17295/com.example.nik7.locationapp I/Google Maps Android API: Google Play services package version: 14799040
2018-12-19 16:13:01.319 17295-17295/com.example.nik7.locationapp W/ik7.locationap: Accessing hidden field Ljava/nio/Buffer;->address:J (light greylist, reflection)
2018-12-19 16:13:01.712 17295-17295/com.example.nik7.locationapp D/OpenGLRenderer: HWUI GL Pipeline
2018-12-19 16:13:01.877 17295-17341/com.example.nik7.locationapp I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
2018-12-19 16:13:01.878 17295-17341/com.example.nik7.locationapp I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
2018-12-19 16:13:01.878 17295-17341/com.example.nik7.locationapp I/OpenGLRenderer: Initialized EGL, version 1.4
2018-12-19 16:13:01.878 17295-17341/com.example.nik7.locationapp D/OpenGLRenderer: Swap behavior 1
2018-12-19 16:13:01.883 17295-17341/com.example.nik7.locationapp W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2018-12-19 16:13:01.883 17295-17341/com.example.nik7.locationapp D/OpenGLRenderer: Swap behavior 0
2018-12-19 16:13:01.907 17295-17341/com.example.nik7.locationapp D/EGL_emulation: eglCreateContext: 0xe8310280: maj 2 min 0 rcv 2
2018-12-19 16:13:01.913 17295-17341/com.example.nik7.locationapp D/EGL_emulation: eglMakeCurrent: 0xe8310280: ver 2 0 (tinfo 0xe7093fa0)
2018-12-19 16:13:02.025 17295-17341/com.example.nik7.locationapp D/EGL_emulation: eglMakeCurrent: 0xe8310280: ver 2 0 (tinfo 0xe7093fa0)
2018-12-19 16:13:02.034 17295-17338/com.example.nik7.locationapp D/EGL_emulation: eglCreateContext: 0xe9d05f00: maj 1 min 0 rcv 1
2018-12-19 16:13:02.229 17295-17338/com.example.nik7.locationapp D/EGL_emulation: eglMakeCurrent: 0xe9d05f00: ver 1 0 (tinfo 0xe9d03470)
2018-12-19 16:13:02.564 17295-17319/com.example.nik7.locationapp D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2018-12-19 16:13:03.305 17295-17319/com.example.nik7.locationapp E/AndroidRuntime: FATAL EXCEPTION: Thread-6
    Process: com.example.nik7.locationapp, PID: 17295
    java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/ProtocolVersion;
        at ez.b(:[email protected]@14.7.99 (100700-223214910):3)
        at ey.a(:[email protected]@14.7.99 (100700-223214910):3)
        at fa.a(:[email protected]@14.7.99 (100700-223214910):15)
        at com.google.maps.api.android.lib6.drd.al.a(:[email protected]@14.7.99 (100700-223214910):6)
        at ed.a(:[email protected]@14.7.99 (100700-223214910):21)
        at ed.run(:[email protected]@14.7.99 (100700-223214910):8)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.ProtocolVersion" on path: DexPathList[[zip file "/data/user_de/0/com.google.android.gms/app_chimera/m/00000015/MapsDynamite.apk"],nativeLibraryDirectories=[/data/user_de/0/com.google.android.gms/app_chimera/m/00000015/MapsDynamite.apk!/lib/x86, /system/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at ad.loadClass(:[email protected]@14.7.99 (100700-223214910):4)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at ez.b(:[email protected]@14.7.99 (100700-223214910):3) 
        at ey.a(:[email protected]@14.7.99 (100700-223214910):3) 
        at fa.a(:[email protected]@14.7.99 (100700-223214910):15) 
        at com.google.maps.api.android.lib6.drd.al.a(:[email protected]@14.7.99 (100700-223214910):6) 
        at ed.a(:[email protected]@14.7.99 (100700-223214910):21) 
        at ed.run(:[email protected]@14.7.99 (100700-223214910):8) 
2018-12-19 16:13:03.338 17295-17295/com.example.nik7.locationapp E/SchedPolicy: set_timerslack_ns write failed: Operation not permitted
2018-12-19 16:13:03.379 17295-17319/com.example.nik7.locationapp I/Process: Sending signal. PID: 17295 SIG: 9

이것은 강제 로그입니다. 제한을 제거하여 시도했지만 작동하지 않았습니다. 여기서 문제는 무엇입니까? 나는 또한 api 23 마시멜로를 잡았다. 대신에 api 키를 입력하는 것 외에는 아무 것도하지 않았습니다

편집 : 또한 매니페스트에 키를 포함했지만 여전히 앱이 다운되었습니다

<meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="YOUR_API_KEY"/>

  • 답변 # 1

    수정 :

    API 28의 문제인 것 같습니다

    이 문제를 해결하려면 매니페스트 파일의 응용 프로그램에서 다음 코드를 추가하십시오.

    <uses-library android:name="org.apache.http.legacy" android:required="false"/>
    
    

    Google Play 서비스가 설치되어 있지 않기 때문일 수 있습니다. 실제 전화에서 앱을 실행하면 정상적으로 작동합니다.

  • 답변 # 2

    이 문제를 해결하려면 매니페스트의 내부에이 코드 줄을 추가하십시오

    <uses-library android:name="org.apache.http.legacy" android:required="false"/>
    
    

    또는  build.gradle의 play-services-maps를

    implementation 'com.google.android.gms:play-services-maps:16.1.0'
    
    

    나를 위해 일했다

관련 자료

  • 이전 ssl - android 저장소 - ssl_certificate_verify_failed 오류
  • 다음 mysql - 데이터베이스에서 기본 키에 대한 목록으로 데이터 가져 오기