AutocompleteSupportFragments показывает, что иногда я не могу загрузить поиск в kotlin android - PullRequest
0 голосов
/ 28 марта 2020

Я использую AutocompleteSupportFragment в моем kotlin android приложении для получения названия места, долготы и широты, которое иногда показывает ошибку «Поиск не найден», но иногда работает отлично. Когда я читаю в документации Google, он просит, чтобы я прикрепил платежный аккаунт и обновил gradle et c. Я прикрепил платежный аккаунт к этому API, но теперь он снова показывает мне иногда ошибку, что "поиск не найден". Теперь я пытаюсь обновить свои библиотеки проекта и код. Когда я использую эту библиотеку, которая приведена ниже:

implementation 'com.google.android.libraries.places:places:1.0.0'

она работает отлично, но когда я обновил свой gradle с обновленной библиотекой, то есть:

 implementation 'com.google.android.libraries.places:places:2.2.0'

Компилятор показывает мне ошибку, чтобы добавить

tools:replace="android:appComponentFactory"

но опять же он показывает мне ошибку

Merging Errors: Error: tools:replace specified at line:14 for attribute android:appComponentFactory, but no new value specified app main manifest (this file), line 13 Error: Validation failed, exiting app main manifest (this file)

Теперь я могу поделиться своими файлами с вами Это мой manifestMerger

<?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.sprintsolutions.petsbuyandsell">

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <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"/>
    <uses-permission android:name="android.permission.CAMERA"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>


    <application
            tools:replace="android:appComponentFactory"
            android:allowBackup="false"
            android:icon="@mipmap/icon"
            android:label="@string/app_name"
            android:roundIcon="@mipmap/icon"
            android:usesCleartextTraffic="true"
            android:supportsRtl="true"
            android:largeHeap="true"
            android:hardwareAccelerated="false"
            android:theme="@style/AppTheme">

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


        <activity android:name="com.sprintsolutions.petsbuyandsell.ContactUsActivity"
                  android:screenOrientation="portrait"/>

        <activity
                android:name="com.sprintsolutions.petsbuyandsell.AboutUsActivity"
                android:screenOrientation="portrait">

        </activity>

        <activity android:name="com.sprintsolutions.petsbuyandsell.FullImageActivity"
                  android:screenOrientation="portrait"/>

        <activity
                android:name="com.sprintsolutions.petsbuyandsell.ForgetPasswordActivity"
                android:screenOrientation="portrait"/>
        <activity
                android:name="com.sprintsolutions.petsbuyandsell.SplashActivity"
                android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>

                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <activity
                android:name="com.sprintsolutions.petsbuyandsell.SignUpActivity"
                android:screenOrientation="portrait">
        </activity>
        <activity
                android:name="com.sprintsolutions.petsbuyandsell.MainActivity"
                android:screenOrientation="portrait"
                android:windowSoftInputMode="adjustPan|stateHidden"/>
        <activity
                android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
                android:theme="@style/Base.Theme.AppCompat"/>
        <activity
                android:name="com.facebook.FacebookActivity"
                android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
                android:label="@string/app_name"/>
        <activity
                android:name="com.facebook.CustomTabActivity"
                android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.VIEW"/>

                <category android:name="android.intent.category.DEFAULT"/>
                <category android:name="android.intent.category.BROWSABLE"/>

                <data android:scheme="@string/fb_login_protocol_scheme"/>
            </intent-filter>
        </activity>



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



        <meta-data
                android:name="com.facebook.sdk.ApplicationId"
                android:value="@string/facebook_app_id"/>

        <activity
                android:name="com.sprintsolutions.petsbuyandsell.MapsActivity"
                android:label="@string/title_activity_maps"
                android:screenOrientation="portrait"/>

        <activity
                android:name="com.sprintsolutions.petsbuyandsell.LoginActivity"
                android:screenOrientation="portrait"/>


    </application>

</manifest>

Теперь я могу поделиться файлами gradle

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'



android {

    configurations.all {
        resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
    }

    signingConfigs {
        release {

            storeFile file('/Users/HP/AndroidStudioProjects/PetMarket/upload')
            storePassword 'a@b12345678'
            keyAlias = 'upload'
            keyPassword 'a@b12345678'
        }
    }
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.sprintsolutions.petsbuyandsell"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        signingConfig signingConfigs.release
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    androidExtensions {
        experimental = true
    }

    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }

}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:exifinterface:28.0.0'
    implementation 'com.android.support:customtabs:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support:support-media-compat: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.android.libraries.places:places:2.2.0'
    implementation 'com.karumi:dexter:5.0.0'
    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 'com.android.support:design:28.0.0'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.android.volley:volley:1.1.1'
    implementation 'com.nabinbhandari.android:permissions:3.8'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'com.github.bumptech.glide:glide:4.8.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
    implementation 'com.makeramen:roundedimageview:2.3.0'
    implementation 'de.hdodenhof:circleimageview:3.0.0'
    api 'com.theartofdev.edmodo:android-image-cropper:2.7.+'
    implementation 'com.tbuonomo.andrui:viewpagerdotsindicator:3.0.3'
    implementation 'com.facebook.android:facebook-android-sdk:[5,6)'
    implementation 'com.google.android.gms:play-services-auth:16.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.twitter.sdk.android:twitter:3.3.0'

}

1 Ответ

0 голосов
/ 29 марта 2020

Вам нужно перейти на androidx, чтобы он заработал

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