Jump to content
RicardoR

[Problema] Build.grandle com bilbiotecas google play

Recommended Posts

RicardoR

Boas.

Estou a tentar desenvolver uma aplicação que interaja com a API do Google maps. Sendo assim, tive de importar a biblioteca do goggle services e fiz o seguinte build.gradle para o projeto root

buildscript {
   repositories {
    mavenCentral()
   }
   dependencies {
    classpath 'com.android.tools.build:gradle:0.4.2'
   }
}
apply plugin: 'android'
dependencies {
   compile "com.android.support:support-v4:13.0.0"
   compile project("MetYou")
}

e para a aplicacao o seguinte

buildscript {
   repositories {
    maven { url 'http://repo1.maven.org/maven2' }
   }
   dependencies {
    classpath 'com.android.tools.build:gradle:0.4'
   }
}
apply plugin: 'android-library'
dependencies {
   compile files('libs/google-play-services.jar')
}
android {
   compileSdkVersion 17
   buildToolsVersion '17.0.0'
}

Ao compilar dá-me sempre o erro de "Main Manifest missing from android manifest.xml"...

Alguém com uma ajuda preciosa?

Maiores cumprimentos,

Abraço ;)

Share this post


Link to post
Share on other sites
Guest id194

Estou com uma pequena duvida sobre a estrutura do teu projecto que me impede de te dar uma resposta correcta, podes mostrar um screenshot da estrutura do projecto (do Android Studio) onde apareça todos os ficheiros build.gradle?

De qualquer maneira, porquê que estás a usar a versão 0.4 do plugin Gradle para Android num script e o 0.4.2 noutro? Isso pode estar a dar conflitos... Outra coisa, estás a usar o repositório local da Google para a biblioteca de suporte mas não para o Google Play Services, usa para os dois, a gestão de dependências funciona melhor se o fizeres em vez de referencias .jars directamente.

Share this post


Link to post
Share on other sites
RicardoR

Obrigado pela resposta e desculpa só estar a responder agora.

Adicionei agr nas dependencias o reservatório do google play, mas agora está a dar outro erro: Gradle: Execution failed for task ':MetYou1:processReleaseManifest'.

> java.lang.RuntimeException

Aqui está a meu novo build.gradle

buildscript {
repositories {
 mavenCentral()
}
dependencies {
 classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android'dependencies {
compile files('libs/android-support-v4.jar')
compile ('com.google.android.gms:play-services:3.1.36')
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0" defaultConfig {
 minSdkVersion 7
 targetSdkVersion 16
}
}

e o meu AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.metyou1"
android:versionCode="1"
android:versionName="1.0" >
<permission
	 android:name="com.metyou1.permission.MAPS_RECEIVE"
	 android:protectionLevel="signature"/>
<uses-permission android:name="com.metyou1.permission.MAPS_RECEIVE"/> <uses-sdk
 android:minSdkVersion="7"
 android:targetSdkVersion="16" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-library
	 android:name="com.google.android.maps" />
<application
 android:allowBackup="true"
 android:icon="@drawable/ic_launcher"
 android:label="@string/app_name"
 android:theme="@style/AppTheme" >
 <meta-data
		 android:name="com.google.android.maps.v2.API_KEY"
		 android:value="*******"/>
 <activity
	 android:name="com.metyou1.Main"
	 android:configChanges="orientation|keyboardHidden|screenSize"
	 android:label="@string/app_name"
	 android:theme="@style/FullscreenTheme" >
	 <intent-filter>
		 <action android:name="android.intent.action.MAIN" />			 <category android:name="android.intent.category.LAUNCHER" />
	 </intent-filter>
 </activity>
 <activity android:name=".util.Registar" />
 <activity android:name=".util.Wall" />
</application>
</manifest>

Obrigado, abraço ;)

Edited by RicardoR

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.