gpt4 book ai didi

java - 使用 Google Maps Android 标记聚类实用程序时无法实例化 appComponentFactory

转载 作者:行者123 更新时间:2023-11-29 02:23:26 24 4
gpt4 key购买 nike

当我尝试运行我的应用程序并从 Google 加载 map 以显示附近地点时,它会显示 map 而不是地点。我一直在 Stackoverflow 上搜索,但没有找到有效的解决方案...

这是我错误的一部分:

2018-12-07 23:59:28.409 1872-1872/? E/LoadedApk: Unable to instantiate appComponentFactory
java.lang.ClassNotFoundException: Didn't find class "android.support.v4.app.CoreComponentFactory" on path: DexPathList[[],nativeLibraryDirectories=[/system/priv-app/GoogleSdkSetup/lib/x86, /system/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.LoadedApk.createAppFactory(LoadedApk.java:226)
at android.app.LoadedApk.updateApplicationInfo(LoadedApk.java:338)
at android.app.ActivityThread.handleDispatchPackageBroadcast(ActivityThread.java:5388)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1733)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at com.android.server.SystemServer.run(SystemServer.java:454)
at com.android.server.SystemServer.main(SystemServer.java:294)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:838)
2018-12-07 23:59:30.224 1714-1849/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
2018-12-07 23:59:30.309 1714-1849/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
2018-12-07 23:59:30.496 6272-6388/? E/PlaceInferenceEngine: Position timestamp out of order. Previous: 1544223082635, Current: 1544219970000. Skipping this Position.
2018-12-07 23:59:40.591 1872-1885/? E/memtrack: Couldn't load memtrack module
2018-12-07 23:59:50.218 1822-1822/? E/netmgr: Failed to open QEMU pipe 'qemud:network': Invalid argument
2018-12-07 23:59:50.218 1822-1822/? E/netmgr: WifiForwarder unable to open QEMU pipe: Invalid argument
2018-12-07 23:59:50.643 1872-1885/? E/memtrack: Couldn't load memtrack module
2018-12-07 23:59:58.282 1727-1812/? E/storaged: getDiskStats failed with result NOT_SUPPORTED and size 0
2018-12-08 00:00:00.716 9163-9163/? E/ndroid.calenda: Not starting debugger since process cannot load the jdwp agent.
2018-12-08 00:00:00.916 9180-9180/? E/viders.calenda: Not starting debugger since process cannot load the jdwp agent.
2018-12-08 00:00:00.949 9163-9163/? E/PrefServiceImpl: Primary account is null
2018-12-08 00:00:21.270 1872-1885/? E/memtrack: Couldn't load memtrack module

我的 list 看起来像这样:

<?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.rhaniegghe.googlemaps">

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



<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true"
>

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

<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>

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


</application>


</manifest>

和我的 Gradle 文件:

apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.rhaniegghe.googlemaps"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

}
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
}

dependencies {

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-places:16.0.0'
implementation 'com.google.maps.android:android-maps-utils:0.5+'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

如果有人能指出我正确的方向。我尝试了以下解决方案但没有成功。

link

提前致谢!

最佳答案

我的解决方案是使用使缓存无效并重新启动

在 Android Studio 的菜单选项中单击文件并搜索选项使缓存无效并重新启动

关于java - 使用 Google Maps Android 标记聚类实用程序时无法实例化 appComponentFactory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53677981/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com