Android/에러해결

[Android] Google Search등록

lipnus 2019. 1. 24. 13:11
반응형

http://java-lang-programming.com/en/lints/1


에러내용

에러라기 보다는 Warning정도

App is not indexable by Google Search; consider adding at least one Activity with an ACTION-VIEW intent filter. See issue explanation for more details. less... (⌘F1) 

Inspection info:Adds URLs to get your app into the Google index, to get installs and traffic to your app from Google Search.  Issue id: GoogleAppIndexingWarning  More info: https://g.co/AppIndexing/AndroidStudio


이유

구글서치가 적용되지 않았다



해결1 - 무시하기

android {
    compileSdkVersion 25
    buildToolsVersion rootProject.buildToolsVersion

    defaultConfig {
        // something
    }
   +lintOptions {
        disable 'GoogleAppIndexingWarning'
        baseline file("lint-baseline.xml") // your choice of filename/path here
    }
} 



해결2 - Deep Search적용

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

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

        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />

               +<action android:name="android.intent.action.VIEW" /  >

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

                <!-- Accepts URIs that begin with "java-lang-programming://android-app-google-plus-demo" -- >
                <data
                    android:host="java-lang-programming"
                    android:scheme="android-app-google-plus-demo" / >
            </intent-filter>
        </activity>
        <activity
            android:name=".ui.MainActivity2"
            android:label="@string/title_activity_main2"
            android:theme="@style/AppTheme.NoActionBar" />
    </application>

</manifest>


반응형