[英]Unable to instantiate appComponentFactory when using Google Maps Android Marker Clustering Utility
When I try to run my app and load te map from Google to show nearby places, it will show the map but not the places. 当我尝试运行我的应用并从Google加载地图以显示附近的地点时,它将显示地图,但不显示地点。 I have been searching on Stackoverflow but haven't found a solution that works... 我一直在搜索Stackoverflow,但没有找到有效的解决方案...
this is part of my error : 这是我的错误的一部分:
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
my manifest looks like this: 我的清单看起来像这样:
<?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>
and my Gradle file: 和我的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'
}
If anyone can point me in the right directions. 如果有人能指出我正确的方向。 I have tried the following solution but without luck. 我尝试了以下解决方案,但没有运气。
Thanks in advance! 提前致谢!
The solution for me was to use Invalidate cache and restart . 对我来说,解决方案是使用Invalidate缓存并重新启动 。
Click File in Menu option of Android Studio and search for option Invalidate cache and restart . 在Android Studio的“菜单”选项中单击“文件”,然后搜索“使缓存无效并重新启动”选项。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.