Android Map错误

时间:2018-11-29 13:15:32

标签: android google-maps android-studio google-places-api

所以我试图在我的应用程序中添加一个自动完成的地方,但是我什至还没有向Java类添加任何东西,但是我有一个很长的错误并且不知道从哪里来。 xml:

<android.support.v7.widget.CardView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentStart="true"
    android:layout_centerVertical="true"
    >

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">

        <fragment
            android:id="@+id/place_autocomplete_fragment"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:name="com.google.android.gms.location.places.ui.PlaceAutocompleteFragment"
            />

    </RelativeLayout>
</android.support.v7.widget.CardView>

java:

 private String location;

Task<Void> mDatabase;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_selector);


}

错误:

E/UncaughtException: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/R$layout;
    at com.google.android.gms.location.places.ui.PlaceAutocompleteFragment.onCreateView(Unknown Source)
    at android.app.Fragment.performCreateView(Fragment.java:2112)
    at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:874)
    at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1061)
    at android.app.FragmentManagerImpl.addFragment(FragmentManager.java:1163)
    at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2132)
    at android.app.Activity.onCreateView(Activity.java:5461)
    at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:389)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:733)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
    at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
    at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
    at com.apps.ayodkay.services.selector.onCreate(selector.java:29)
    at android.app.Activity.performCreate(Activity.java:6112)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1117)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2609)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2721)
    at android.app.ActivityThread.access$900(ActivityThread.java:168)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1393)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5753)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
 Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.R$layout" on path: DexPathList[[zip file "/data/app/com.apps.ayodkay.services-1/base.apk", zip file "/data/app/com.apps.ayodkay.services-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.apps.ayodkay.services-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.apps.ayodkay.services-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.apps.ayodkay.services-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.apps.ayodkay.services-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.apps.ayodkay.services-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.apps.ayodkay.services-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.apps.ayodkay.services-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.apps.ayodkay.services-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.apps.ayodkay.services-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.apps.ayodkay.services-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.apps.ayodkay.services-1/lib/arm, /vendor/lib, /system/lib]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
    at com.google.android.gms.location.places.ui.PlaceAutocompleteFragment.onCreateView(Unknown Source) 
    at android.app.Fragment.performCreateView(Fragment.java:2112) 
    at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:874) 
    at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1061) 
    at android.app.FragmentManagerImpl.addFragment(FragmentManager.java:1163) 
    at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2132) 
    at android.app.Activity.onCreateView(Activity.java:5461) 
    at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:389) 
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:733) 
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) 
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:809) 
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:809) 
    at android.view.LayoutInflater.inflate(LayoutInflater.java:504) 
    at android.view.LayoutInflater.inflate(LayoutInflater.java:414) 
    at android.view.LayoutInflater.inflate(LayoutInflater.java:365) 
    at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469) 
    at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
    at com.apps.ayodkay.services.selector.onCreate(selector.java:29) 
    at android.app.Activity.performCreate(Activity.java:6112) 
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1117) 
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2609) 
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2721) 
    at android.app.ActivityThread.access$900(ActivityThread.java:168) 
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1393) 
    at android.os.Handler.dispatchMessage(Handler.java:102) 
    at android.os.Looper.loop(Looper.java:135) 
    at android.app.ActivityThread.main(ActivityThread.java:5753) 
    at java.lang.reflect.Method.invoke(Native Method) 
    at java.lang.reflect.Method.invoke(Method.java:372) 
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200) 
    Suppressed: java.lang.ClassNotFoundException: com.google.android.gms.R$layout
    at java.lang.Class.classForName(Native Method)
    at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
    at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
            ... 32 more
 Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

E / Android运行时:致命异常:主要     流程:com.apps.ayodkay.services,PID:25664     java.lang.NoClassDefFoundError:无法解决以下问题:Lcom / google / android / gms / R $ layout;         在com.google.android.gms.location.places.ui.PlaceAutocompleteFragment.onCreateView(未知来源)         在android.app.Fragment.performCreateView(Fragment.java:2112)         在android.app.FragmentManagerImpl.moveToState(FragmentManager.java:874)         在android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1061)         在android.app.FragmentManagerImpl.addFragment(FragmentManager.java:1163)         在android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2132)         在android.app.Activity.onCreateView(Activity.java:5461)         在android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:389)         在android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:733)         在android.view.LayoutInflater.rInflate(LayoutInflater.java:806)         在android.view.LayoutInflater.rInflate(LayoutInflater.java:809)         在android.view.LayoutInflater.rInflate(LayoutInflater.java:809)         在android.view.LayoutInflater.inflate(LayoutInflater.java:504)         在android.view.LayoutInflater.inflate(LayoutInflater.java:414)         在android.view.LayoutInflater.inflate(LayoutInflater.java:365)         在android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)         在android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)         在com.apps.ayodkay.services.selector.onCreate(selector.java:29)         在android.app.Activity.performCreate(Activity.java:6112)         在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1117)         在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2609)         在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2721)         在android.app.ActivityThread.access $ 900(ActivityThread.java:168)         在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1393)         在android.os.Handler.dispatchMessage(Handler.java:102)         在android.os.Looper.loop(Looper.java:135)         在android.app.ActivityThread.main(ActivityThread.java:5753)         在java.lang.reflect.Method.invoke(本机方法)         在java.lang.reflect.Method.invoke(Method.java:372)         在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:1405)         在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)      原因:java.lang.ClassNotFoundException:在路径:DexPathList [[zip文件“ /data/app/com.apps.ayodkay.services-1”中找不到类“ com.google.android.gms.R $ layout” /base.apk”、zip文件“ /data/app/com.apps.ayodkay.services-1/split_lib_dependencies_apk.apk”、zip文件“ /data/app/com.apps.ayodkay.services-1/split_lib_slice_0_apk.apk ”,zip文件“ /data/app/com.apps.ayodkay.services-1/split_lib_slice_1_apk.apk”、zip文件“ /data/app/com.apps.ayodkay.services-1/split_lib_slice_2_apk.apk”、zip文件“ /data/app/com.apps.ayodkay.services-1/split_lib_slice_3_apk.apk”,zip文件“ /data/app/com.apps.ayodkay.services-1/split_lib_slice_4_apk.apk”,zip文件“ / data / app / com.apps.ayodkay.services-1 / split_lib_slice_5_apk.apk”,压缩文件“ /data/app/com.apps.ayodkay.services-1/split_lib_slice_6_apk.apk”,压缩文件“ / data / app / com。” apps.ayodkay.services-1 / split_lib_slice_7_apk.apk”,zip文件“ /data/app/com/app.apps.ayodkay.services-1/split_lib_slice_8_apk.apk”、zip文件“ /data/app/com.apps.ayodkay”。 services-1 / split_lib _slice_9_apk.apk“],nativeLibraryDirectories = [/ data / app / com.apps.ayodkay.services-1 / lib / arm,/ vendor / lib,/ system / lib]]         在dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)         在java.lang.ClassLoader.loadClass(ClassLoader.java:511)         在java.lang.ClassLoader.loadClass(ClassLoader.java:469)         在com.google.android.gms.location.places.ui.PlaceAutocompleteFragment.onCreateView(未知来源)         在android.app.Fragment.performCreateView(Fragment.java:2112)         在android.app.FragmentManagerImpl.moveToState(FragmentManager.java:874)         在android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1061)         在android.app.FragmentManagerImpl.addFragment(FragmentManager.java:1163)         在android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2132)         在android.app.Activity.onCreateView(Activity.java:5461)         在android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:389)         在android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:733)         在android.view.LayoutInflater.rInflate(LayoutInflater.java:806)         在android.view.LayoutInflater.rInflate(LayoutInflater.java:809)         在android.view.LayoutInflater.rInflate(LayoutInflater.java:809)         在android.view.LayoutInflater.inflate(LayoutInflater.java:504)         在android.view.LayoutInflater.inflate(LayoutInflater.java:414)         在android.view.LayoutInflater.inflate(LayoutInflater.java:365)         在android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)         在android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)         在com.apps.ayodkay.services.selector.onCreate(selector.java:29)         在android.app.Activity.performCreate(Activity.java:6112)         在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1117)         在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2609)         在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2721)         在android.app.ActivityThread.access $ 900(ActivityThread.java:168)         在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1393)         在android.os.Handler.dispatchMessage(Handler.java:102)         在android.os.Looper.loop(Looper.java:135)         在android.app.ActivityThread.main(ActivityThread.java:5753)         在java.lang.reflect.Method.invoke(本机方法)         在java.lang.reflect.Method.invoke(Method.java:372)         在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:1405)         在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)         禁止:java.lang.ClassNotFoundException:com.google.android.gms.R $ layout         在java.lang.Class.classForName(本机方法)         在java.lang.BootClassLoader.findClass(ClassLoader.java:781)         在java.lang.BootClassLoader.loadClass(ClassLoader.java:841)         在java.lang.ClassLoader.loadClass(ClassLoader.java:504)                 ...另外32个      原因:java.lang.NoClassDefFoundError:使用启动找不到类

0 个答案:

没有答案