Zygote Поле String # value отсутствует в версиях Android> = 6.0 Ошибка Android - PullRequest
0 голосов
/ 04 июля 2018

Я использую Google API для создания картографического приложения. Я получаю эту ошибку:

E / zygote: поле String # value отсутствует в версиях Android> = 6.0

Я не знаю, как от этого избавиться. Я искал на всех сайтах, включая этот:

Поле значения String # отсутствует в версиях Android> = 6.0

Также не было опубликовано решение.

Но я не использую какую-либо базу огня. Буду признателен за любую помощь.

Logcat с ошибкой:

Выбранная удаленная версия com.google.android.gms.maps_dynamite, версия> = 220 07-03 21: 40: 15,346 22106- 22106 / com.example.sislarodriguez.aplicacionessimilaresv1 W / zygote: Неподдерживаемый загрузчик классов 07-03 21: 40: 15,356 22106- 22106 / com.example.sislarodriguez.aplicacionessimilaresv1 W / zygote: Пропуск повторяющаяся проверка класса из-за неподдерживаемого загрузчика классов 07-03 21: 40: 15,385 22106- 22106 / com.example.sislarodriguez.aplicacionessimilaresv1 I / Google Maps Android API: версия клиента сервиса Google Play: 12451000 07-03 21: 40: 15,393 22106- 22106 / com.example.sislarodriguez.aplicacionessimilaresv1 I / Google Maps Android API: версия пакета услуг Google Play: 12685026 07-03 21: 40: 15,478 22106- 22106 / com.example.sislarodriguez.aplicacionessimilaresv1 E / zygote: The Поле String # value отсутствует в версиях Android> = 6.0 07-03 21: 40: 15,572 22106- 22111 / com.example.sislarodriguez.aplicacionessimilaresv1 I / zygote: Do full сбор кеша кода, код = 494 КБ, данные = 295 КБ 07-03 21: 40: 15,575 22106- 22111 / com.example.sislarodriguez.aplicacionessimilaresv1 I / zygote: после кода коллекция кеша, код = 493 КБ, данные = 263 КБ 07-03 21: 40: 15.663 22106- 22148 / com.example.sislarodriguez.aplicacionessimilaresv1 D / NetworkSecurityConfig: Конфигурация безопасности сети не указана с использованием платформы дефолт 07-03 21: 40: 15,712 22106- 22111 / com.example.sislarodriguez.aplicacionessimilaresv1 I / zygote: сделать частичное сбор кеша кода, код = 494 КБ, данные = 271 КБ После сбора кеша кода, код = 494 КБ, данные = 271 КБ Увеличение емкости кеша кода до 2МБ

Фрагмент, в который я загружаю карту.

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapView;
import com.google.android.gms.maps.MapsInitializer;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.model.CameraPosition;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;

public class FragmentShops extends Fragment {

MapView mMapView;
private GoogleMap googleMap;


@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
                         @Nullable Bundle savedInstanceState) {

    View view = inflater.inflate(R.layout.fragment_shops, container, false);

    mMapView = (MapView) view.findViewById(R.id.mapView);
    mMapView.onCreate(savedInstanceState);

    mMapView.onResume();

    try {
        MapsInitializer.initialize(getActivity().getApplicationContext());
    } catch (Exception e) {
        e.printStackTrace();
    }

    mMapView.getMapAsync(new OnMapReadyCallback() {
        @Override
        public void onMapReady(GoogleMap mMap) {

            googleMap = mMap;
            //googleMap.setMyLocationEnabled(false);

            // For dropping a marker at a point on the Map
            LatLng simi = new LatLng(19.37,-99.14);
            googleMap.addMarker(new MarkerOptions().position(simi).title("Marker Title").snippet("Marker Description"));

            // For zooming automatically to the location of the marker
            CameraPosition cameraPosition = new CameraPosition.Builder().target(simi).zoom(15).build();
            googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
        }
    });


    return view;
}

@Override
public void onResume() {
    super.onResume();
    mMapView.onResume();
}

@Override
public void onPause() {
    super.onPause();
    mMapView.onPause();
}

@Override
public void onDestroy() {
    super.onDestroy();
    mMapView.onDestroy();
}

@Override
public void onLowMemory() {
    super.onLowMemory();
    mMapView.onLowMemory();
}
}

Мой фрагмент макета

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".FragmentShops">

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:layout_marginBottom="4dp"
    android:layout_marginLeft="4dp"
    android:layout_marginRight="4dp"
    android:layout_marginTop="4dp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent">

    <TableRow
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="2dp"
        android:layout_marginBottom="2dp"
        android:background="@drawable/sb_ovalframe">

        <AutoCompleteTextView
            android:id="@+id/au_searchunit"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:layout_weight="2.5"
            android:background="@android:color/transparent"
            android:completionThreshold="1"
            android:gravity="start"
            android:imeOptions="actionSearch"
            android:inputType="text"
            android:hint="@string/shopsearch"
            android:textSize="@dimen/title_size" />

        <ImageButton
            android:id="@+id/btn_searchunit"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="0.5"
            android:background="@drawable/btn_searchoval"
            android:gravity="center"
            app:srcCompat="@drawable/icon_search" />
    </TableRow>

    <ImageView
        android:id="@+id/separator"
        android:layout_width="match_parent"
        android:layout_height="1dp"
        app:srcCompat="@android:color/darker_gray"
        android:contentDescription="@string/separator"
        android:layout_marginBottom="4dp"/>

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="1dp">

        <com.google.android.gms.maps.MapView
            android:id="@+id/mapView"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

    </FrameLayout>


</LinearLayout>
</android.support.constraint.ConstraintLayout>

Мой AndroidManifest.xml

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

<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">
    <activity
        android:name=".StartActivity"
        android:theme="@style/StartScreenTheme">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" />
    <activity android:name=".LoginActivity" />
    <activity
        android:name=".StatusJobs"
        android:label="@string/notificaciones"
        android:theme="@style/ActiveBar" />

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

    <activity android:name=".ConfigNotificationActivity"></activity>
</application>

</manifest>

Мое приложение build.gradle Модуль

apply plugin: 'com.android.application'

android {
compileSdkVersion 27
defaultConfig {
    applicationId "com.example.sislarodriguez.aplicacionessimilaresv1"
    minSdkVersion 19
    targetSdkVersion 27
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    vectorDrawables.useSupportLibrary = true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-vector-drawable:27.1.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
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'
implementation files('libs/MPAndroidChart-v3.0.3.jar')
implementation 'com.android.support:cardview-v7:27.1.1'
}

Заранее спасибо.

Ответы [ 2 ]

0 голосов
/ 15 февраля 2019

У меня была похожая проблема при запуске моего приложения на Android 9. Этот SO ответ мне помог: https://stackoverflow.com/a/52181547/6363572

Вы можете попробовать добавить следующую строку в AndroidManifest.xml:

<uses-library android:name="org.apache.http.legacy" android:required="false"/>
0 голосов
/ 22 октября 2018

У меня была похожая проблема, и она была решена путем запуска в эмуляторе с включенным и обновленным Google Play. (Карты Google не будут работать без обновленного магазина Google Play.)

По сути, создайте новое виртуальное устройство с Google Play (а не только с Google API). Также можно использовать отладку по USB с реальным устройством.

См. Этот вопрос для деталей.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...