0

I am trying to include SmartLocation github library in my project and getting so confusing errors.

build.grade(app):

apply plugin: 'com.android.application'
apply plugin: 'android-apt'
def AAVersion = '4.0.0' 
android {
    compileSdkVersion 23
    buildToolsVersion "23.0.0"

    defaultConfig {
        applicationId "project.com.selfieoffice"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.0.0'
    compile ('io.nlopez.smartlocation:library:3.2.5') {
        transitive = false
    }
    apt "org.androidannotations:androidannotations:$AAVersion"
    compile "org.androidannotations:androidannotations-api:$AAVersion"
}

main/AndroidManifest :

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/apk/res-auto"
    package="project.com.selfieoffice">
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        tools:replace="android:value"
        android:screenOrientation="landscape"
        android:theme="@style/AppTheme">
        <meta-data
            tools:replace="android:value"
            android:name="com.google.android.gms.version" />
        <activity android:name=".activities.MainActivity_">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>

debug/AndroidManifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/apk/res-auto"
    package="project.com.selfieoffice"
    android:versionCode="1"
    android:versionName="1.0" >
    <uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="23" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION" />
    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:screenOrientation="landscape"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        tools:replace="android:value" >
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="6587000"
            tools:replace="android:value" />
        <activity android:name="project.com.selfieoffice.activities.MainActivity_" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <service
            android:name="io.nlopez.smartlocation.activity.providers.ActivityGooglePlayServicesProvider$ActivityRecognitionService"
            android:exported="false" />
        <service
            android:name="io.nlopez.smartlocation.geofencing.providers.GeofencingGooglePlayServicesProvider$GeofencingService"
            android:exported="false" />
        <service
            android:name="io.nlopez.smartlocation.geocoding.providers.AndroidGeocodingProvider$AndroidGeocodingService"
            android:exported="false" />
    </application>
</manifest>

Errors:

/Users/zulqurnainjutt/Desktop/AndroidProjects/SelfieOffice/app/build/intermediates/manifests/full/debug/AndroidManifest.xml Error:(20) No resource identifier found for attribute 'replace' in package 'project.com.selfieoffice' Error:(28) No resource identifier found for attribute 'replace' in package 'project.com.selfieoffice' Error:Execution failed for task ':app:processDebugResources'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/zulqurnainjutt/Library/Android/sdk/build-tools/23.0.0/aapt'' finished with non-zero exit value 1

What is wrong with this project? why can't i include smart location library.

if i do something it gives message of android manifest merging as mentioned in library page Problems section , is anyone using this lib can help ?

Zulqurnain Jutt
  • 1,083
  • 3
  • 15
  • 41

1 Answers1

0

I just solved my problem , thanks to @Dipali shah by following these steps:

  • Removing tools:replace tags from all places of my Android manifests , debug and main both

  • Replacing my xmlns:tools="http://schemas.android.com/apk/res-auto" as xmlns:tools="http://schemas.android.com/tools"

  • Adding/replacing <meta-data tools:replace="android:value" android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> in tag above tag, in main Android manifest

  • Check if you have google play services already there , if not then do this => Right click app package click open module settings go to dependency tab , click + and select com.google.android.gms:play-services:xxxx and OK.

  • Clean and Rebuilt enjoy

Zulqurnain Jutt
  • 1,083
  • 3
  • 15
  • 41