BaseGameUtils cannot resolve symbol android in: "com.google.android.gms.games.Games" - java

I'm trying to make an app with G+ and Google play services.
But I can't from the beginning.
I try to import the project BaseGameUtils, and build the app (sync with Gradle) and run it.
Surprisingly it runs! and works, but when I go into the code, my imports are not found.(cannot resolve symbol)
This leads me to think that my Gradle is well configured but I am missing something (library, dependency, module) in the app, because Android Studio complains about it.
I have the latest Android Studio 0.8.9, and my SDK is updated with all the needed installs.
Can someone put a "how to" import the BaseGameUtils project/library step by step for latest Android Studio and what else is needed?
Also, my Gradle is configured so the app builds with app support v4, but as before, it cannot be resolved.
How do I add it? I already have it in Project Structure > Modules > app > Dependencies > support-v4 as library dependency.

I had the same problem. Solved it almost. It's very important to put your to the latest version (build.gradle --> compileSdkVersion 21). The same with the dependencies ( compile project(':libraries:BaseGameUtils'), compile 'com.android.support:appcompat-v7:21.0.+' compile 'com.android.support:support-v4:21.0.+' and the latest version of Google PLay Services compile 'com.google.android.gms:play-services:+'. Of course you should update your SDK files first (install API21+Tools)

I had the same problem. It's a bug when importing a project with BaseGameUtils dependency from eclipse to Android Studio. This can be solved by commenting out this import as it is no longer required:
//import com.google.android.gms.drive.internal.r;

Related

How do I incorporate a java SDK in android application development?

I am trying to learn more about DWOLLA, using their sandbox. I am mainly interested in using their access API with an android APPLICATION. The Dwolla API Docs says, "Download and build the JARs to use this library. Maven is required to manage this project's dependencies." The following are the links:
git clone https://github.com/Dwolla/dwolla-swagger-java
cd dwolla-swagger-java
mvn install package
How do I integrate the above in an android application/project. My assumption is that I would have to do it in gradle but I am not certain.
Android apps' dependencies are managed with Gradle.
The default repository is JCenter.
The Dwolla SDK is found here.
All you have to do is, on that page, click on 'gradle' and you get the line that you have to your app's build.gradle file.
Here it is compile 'com.dwolla:dwolla-java-sdk:2.0.9'.
Add that to your app module's build.gradle under dependencies, refresh the project and you should be fine.

How to add git module in Android Stdio

I already said Bye Bye to eclipse and configured Android Studio 2.1.1 in my machine and trying https://github.com/gorbin/ASNETutorial this social network integration project.
I have downloaded a file ANSE-master.jar from github and dont understand how to use it in my own project,that can have the ability to integrate with social sites.
Can anyone guide me how to use these .jar in my project.If it sounds stupid please let it go as i'm the beginner in Android studio.
Go to File>New>Import Module then look for the module source directory enter and you are done but don't forget compile project(':Volley') in build.gradle (module app) then sync the project.
Update: This won't work
First set your Project to Android in Project view window.It would look like this
Then you need to open build.gradle file (Module app)
There you should add these lines in dependencies
compile 'com.github.asne:asne-facebook:0.3.1'
compile 'com.github.asne:asne-linkedin:0.3.1'
compile 'com.github.asne:asne-twitter:0.3.1'
now click on sync now. wait for for some time gradle will build project for you. Once it done you will have all these sdk inside your project.
Hope this will help

How can I bring Google play services into my libGDX Gradle project?

After adding Google Play Services to integrate Google ads into my libGDX project in Eclipse, I can no longer use Gradle to build my Android project.
I know that's because I need to tell Gradle about the new Google Play project dependency so I added compile com.google.android.gms:play-services:5.0.89 to the dependencies section of the :android project however it complains that it could not find com.android.support:support-v4:19.1.0.
I guess that means I need to somehow tell Gradle this new dependency depends on another dependency?
Everything works fine in Eclipse so the dependency of my Google Play project in Eclipse is for sure golden, I just need to make Gradle the same way. Do I need to declare the Google play project as another Gradle project and make a build.gradle file for it? I don't think I should be touching the Google Play project contents at all.
If you have downloaded the tools and google reprositories using the Android SDK Manager (1st thing to check), check if your build.gradle files do not need to be updated (what libGDX version are you currently using?).
I had the same problem and solved it by replacing my Android's module build.gradle file by a brand new.
To do so, use the last ligdx setup ui (https://github.com/libgdx/libgdx/wiki/Project-Setup-Gradle) to create a fresh project then compare/replace gradle files.
Under your android module there's a build.gradle file. Add the following:
dependencies {
compile 'com.google.android.gms:play-services:6.1.11'
}
Check for the latest version of Google Play Services and update your version number accordingly.

Can't run imported gradle android project in Eclipse

First, im new in gradle so please bear with me.
I successfully build and imported this project with gradle & eclipse on ubuntu 13.10. This is what i did :
run gradle build in terminal (success)
add apply plugin: 'eclipse' in the build.gradle
run gradle eclipse in terminal (success)
import it as existing project on eclipse
The problem is, when i tried to run the project, eclipse read it as "normal" java program, not the android one. This is the SS :
The main project in my workspace is not in eclipse format.
And this is its properties :
Notice there's no android tab in it's properties. And i cant run it as android application.
Am i missing something? Please kindly help me.
Thanks for your help.
Usually to develop Android in Eclipse you need to install ADT into Eclipse or start with ADT-Bundle (Android IDE) from Google. (You have not as Preferences missing Android group)
However ADT does not have gradle support. And Android Studio is still not even yet beta (preview or alpha, bleeding edge, need to update with almost every build).
There is Nodeclipse/Enide Gradle for Eclipse
(marketplace), that lets launch gradle build even on general project.
For the latest build.gradle template for classic Android project check
gh.c/N/n-1/b/m/o.n.e.e.g/docs/android/build.gradle.
This lets create new Android project in Eclipse with ADT and use ADT tools for most of things,
but additionally have newer build with gradle
and execute defined gradle tasks
But for Android project with several modules (as in this case) you would need to DIY do it yourself:
try to configure Eclipse .classpath to correct values, as gradle eclipse task won't yet do it all for you.
Eclipse plugin in Gradle that you have used does not support Android projects - they are significantly different from regular Java projects. Some things can work but there will be a lot of things missing including Android nature for generated projects.
And the ADT plugin provided by Google does not support Gradle projects yet as the team focuses on Android Studio first. http://tools.android.com/tech-docs/new-build-system can give you some ideas about the current state.

Migrating to Android Studio

I want to migrate from Eclipse to Android Studio, but unfortunately Eclipse was crashed so I couldn't build gradle-build files, so I reinstalled Eclipse, and luckily I still had those, I copied my old files which where in my old workspace (the workspace from before the crash) to a new workspace.
But, when I build the gradle-build files now and I import them in Android Studio it says my gridlayout_v7 is missing.
Does anyone of you know how I can solve this?
Run SDK Manager and check that you have installed:
Android Support Repository
Android Support Library
Google Repository
Then check if your build.gradle has next lines:
dependencies {
compile 'com.android.support:gridlayout-v7:18.0.0'
}
You dont need separate gridlayout library subproject anymore with new build system.

Categories

Resources