google-api-java-client setup for Android - android

I have never used Maven before.
I am following these instructions to setup google-api-client-java for Android.
I have also checked out the sample applications and trying to build calendar-android-sample but getting some Maven related errors.
Are there any other steps to integrate google api's ?
I have these errors -
The container 'Maven Dependencies' references non existing library 'C:\Users\Salil.m2\repository\com\google\apis-samples\shared-sample-calendar\v2-1.1.0\shared-sample-calendar-v2-1.1.0.jar'
Error resolving version for plugin 'org.apache.maven.plugins:maven-deploy-plugin' from the repositories [local (C:\Users\Salil.m2\repository), central (http://repo1.maven.org/maven2)]: Plugin not found in any plugin repository
Error resolving version for plugin 'org.apache.maven.plugins:maven-deploy-plugin' from the repositories [local (C:\Users\Salil.m2\repository), central (http://repo1.maven.org/maven2)]: Plugin not found in any plugin repository

I think is more simple to just add the dependencies jars into your lib folder(from your project) and then add the lib folder to your dependencies path(you do this using your IDE).

Related

Correct way for to use analitic-kit with just a flavor?, putting json file into flavor folder HAPlugin cannot find file

Two flavors but just i need to use Analitic-kit in: online flavor (when comment all about analitic-kit can build ),i need rigth way ,(thank you any suggestions)
Trying this
app
/src
/main
/online
agconnect-services.json
/offline
I get
HAPlugin cannot find "agconnect-services.json" in path: "C:\Users\XL\AndroidStudio\ProjectDemoWithAnalitic\app". Please check the file.*
****
dependencies {
classpath 'com.huawei.agconnect:agcp:1.4.0.300'
classpath 'com.huawei.hms.plugin:analytics:5.0.1.300'
}
Solution:
Please remove the following code:
classpath 'com.huawei.hms.plugin:analytics:5.0.1.300'
apply plugin:'com.huawei.hms.plugin.analytics'
Description:
Based on the Analytics Kit Integration Documentation, the HMS Core SDK integration consists of the following steps:
Add the AppGallery Connect configuration file of the app to your Android Studio project.
Add the Maven repository address and Analytics service dependencies in the build.gradle file of your project.
maven {url 'https://developer.huawei.com/repo/'}
classpath 'com.huawei.hms.plugin:analytics:5.0.1.300'
Add the plug-in configuration and SDK version to the build.gradle file in the app directory.
apply plugin:'com.huawei.hms.plugin.analytics'
implementation 'com.huawei.hms:hianalytics:5.0.1.301'
Click Sync Now or Sync Project with Gradle Files to build a project.
The function of the plug-in is to check whether the integration with Analytics is complete. Besides, the plug-in does not support the flavor. Therefore, if you use flavors, you are advised not to use the analytics plug-in.

How to make it possible to add my Library on GitHub to Android Gradle Files?

I have a project hosted on GitHub at https://github.com/BoardiesITSolutions/NavigationDrawerManager.
I've seen some projects on GitHub state adding it to their gradle file in Android Studio to the dependencies section but this doesn't seem to be working for me.
I have tried compile: 'com.github.boardiesitsolutions.NavigationDrawerManager:+' but it keeps saying it can't find it, I've also tried replacing the + with the version number but no luck, Android Studio keeps saying it can't find it. I've added the repository MavenCentral as well.
Is there something I need to do from GitHub to make it accessible for Gradle?
I don't see it on maven.
You can use this website to use non-mavenized libraries with Gradle.
Just add maven { url "https://jitpack.io" } to repositories section of build.gradle and use compile 'com.github.BoardiesITSolutions:NavigationDrawerManager:0b14c84445' in dependencies.

How do I host Github repository to Gradle

I have a repository on Github, I would like to use my repository in Android Studio using: dependencies {compile 'com.google.code.gson: Gson: 2+'} for gradle. Does someone know how to do this?
You could use JitPack.io to expose your repository as a Maven dependency. Then including it in Android Studio is easy with gradle:
compile 'com.github.YourUsername:RepoName:ReleaseVersion'
There are more instructions on the website.
I don't know if I really got the question...I understood that you want to compile some jar files that are not local to your project and are hosted in your repository. If it is the matter, I guess you should use a custom maven repository, not a Github one. If this is the problem I can give you more details on how to create a custom maven repo.
It's like #dometheshooter said.
See:
How to publish aar file to Apache Archiva with Gradle
Guide to publish an aar to maven using gradle
How to deploy JAR to Maven remote repository
Guide to uploading artifacts to the Central Repository
Guide to deploying 3rd party JARs to remote repository

Gradle fails to find the dependency

I have used this tool to publish my library to sonatype https://github.com/chrisbanes/gradle-mvn-push. I can see that it's uploaded and signed correctly. but when I try to add the dependency to another project gradle can't find it
here is what i get: Error:Failed to find: com.github.mohd-bh:app:1.0.0
though I already included mavenCentral() in repositories block.
You can use this link http://search.maven.org/ to search the maven repository.
When I searched for your library, I could not find it.
Sonatype requires that you push your library from the staging server to the release server by using their website tool. You may not have done that which would result in the library not being published to maven.

facebook-androidk-sdk 3.0.1 as library project in maven android

I'm using maven to manage my dependency, how can i add the facebook-androidk-sdk 3.0.1 as library project in pom.
Where i can get the latest code for facebook sdk 3.0.1
I treed to build the apk, but I'm gettting following error please advice how to fix this issue
'drawable' with value '#drawable/com_facebook_picker_list_selector_background_transition'
Samith
The Facebook SDK is a normal Android library, in order to use it with Maven you need to do the following:
Create the apklib
Install the apklib in your local or remote repository
Add the apklib dependency to your project pom.xml
Take a look at the documentation for commands examples:
https://code.google.com/p/maven-android-plugin/wiki/ApkLib
You can obtain the Facebook SDK here: https://developers.facebook.com/android/downloads/

Categories

Resources