Unable to add Spotify App Remote SDK library to Android Studio Chipmunk - android

EDIT: Added link to instructions
https://developer.spotify.com/documentation/android/quick-start/. I am at the section "Add the App Remote SDK".
I am following the step-by-step instructions provided by Spotify to add the App Remote SDK to my Android Studio project.
Their instructions state:
Unzip the App Remote SDK zip file that you downloaded. Add the library to your project by importing it as a module. In the “Project” side bar in Android Studio (View –> Tool Windows –> Project), right click your project’s root folder and navigate to “New” –> “Module”. In the “New Module” window, choose the option “Import .JAR/AAR Package”. Click “Next”.
With Android Studio Chipmunk, this option is no longer available.
I have tried numerous ways of importing the folder "android-sdk-0.7.2.-appremote-v1.2.3-auth" as a library into my Android Project. No matter how I do it, the Gradle Sync succeeds, but my code is not able to resolve any of the com.spotify.android imports. For example:
import com.spotify.android.appremote.api.ConnectionAparams;
Why am I having so much trouble importing a library into AS Chipmunk? I never had problems when using previous versions.
Is anyone else having this issue or just me?

TO fix this problem, I compiled the library into an AAR file. I copied the AAR file to the "libs" folder. Then added it as a module in the Gradle Build. Not sure why this works, but it does...

Related

Android Studio : Open Android Module in Android Studio option is missing in flutter project

I am developing a flutter app for both iOS and Android. When generating the APK, I prefer to use Android studio (my default IDE is VSCODE). However, when I go to Tools > Flutter I do not see Open Android Module in Android Studio option. I do see Open iOS Module in Xcode.
I followed couple of SO answers, even tried replacing android.iml file from a working project. Nothing happened. I re-cloned my project from BitBucket because sometimes the Android Studio was fine when the project is freshly from repo, but this time, that didn't work either.
I Also tried opening the gradle file and looking for the option (as explained in one SO answer), that didn't work too.
However I noticed, few issues.
In the folder structure, the root folder is replaced by the flutter icon. in projects where I have no issues with, the folder icon is folder.
In here I see .dart_tool folder. In working apps with no issue, I do not see this folder.
I do not have an android.iml file. In other projects I did.
Below is my folder structure in a nutshell. Whats going on here and how to fix this issue?
When you don't see any options to
open module in android studio
because of missing .iml files caused by .gitignore file, follow simple steps.
Click on File and choose Open..
Now in the opened dialog choose android folder of example flutter project under your plugin module. For e.g if test is your plugin with example as it's app then you need to select and click Ok
test\example\android
3. Then wait for Android Studio to sync and download necessary jar files.
Simplest solution
Open flutter project
Go to android folder
open manfiest file
On the top right you will see option open module in android studio
click on this option
Solution 2:-
Import your android project as a project in android studio
The easiest way is to use this command in the root directory of your project, it will create some missing files and it will definitely work.
flutter create --platforms=android .
Now just right click to Android folder

Migrate Eclipse app and libs to Android Studio

I have an Android app project in eclipse that references to 3 libs+ some jar files and I would like to migrate all to Android studio.
First, I export "generate Gradle build files" (app) and succeed import in Android Studio.
I tried to create root folder manualy but the Imports in the App "cannot resolve symbol .."
How do I migrate the rest libs and jars and implement them?
If you want to move the rest of your libs and jars to Android studio, you can do it in three different ways. Please read this link https://stackoverflow.com/a/35369267/5475941. In this post I explained how to import your JAR files in Android studio and I explained all possible ways step by step with screenshots. I hope it helps.
No need to export your project in android studio manage itself ,
open android studio and select import project (eclipse adt etc)
browse to your project root directory and pick your main project not
library or dependent project .
start wizard to import and wait to complete gradle build.

Facebook SDK v.4 for Android: errors on Eclipse

I am trying to import the latest version (4.0.1) of the Facebook Android SDK into eclipse but I am facing issues in having the project being properly built and imported as a Library.
I followed the steps (for android studio, ported to Eclipse) provided in the official guide and looked through Google for other developers having the same problems as I am having but I am still not able to have it properly working.
Here are the steps I do:
Download the Facebook SDK for android from here: https://developers.facebook.com/resources/facebook-android-sdk-current.zip
Extract the projects
In Eclipse, import existing Android code into workspace
Select the folder "facebook" and choose the only project that is shown (the project is properly imported)
Right click on "facebook" project, properties, android and check "isLibrary"
clean project
At this point I still have issues for annotations and classes not found from "android.support" package.
Project's setting for Java compiler is "1.6", minSDK is 9 and target is 17.
I tried also to add the facebook library to my main project but it is still not working.
I tried to put java 1.7 in the compiler but it is not resolving the missing classes plus it is saying that to compile with java 1.7 I need to have min API set to kitkat (which I don't want because I will not be able to compile for 4.2 and 4.3).
I added manually the androd support jar from the SDK Manager folder of android and this resolved partially the missing classes but some did remain.
I am using Eclipse Version: Luna Service Release 1 (4.4.1) with JDK 1.7.0_51 and the latest ADT Plugin (all android components updated with SDK Manager).
Any help is appreciated.
I did some more tests and find out that by downloading the two libraries:
android-support-v4.jar
bolts-android-1.1.2.jar
from the github project (https://github.com/facebook/facebook-android-sdk) did the trick.
So the steps are the following:
Download, unpack and import as android existing code into workspace the latest v.4 version of the Facebook SDK for Android.
Download the two jars from GitHub
Set the Facebook Project as "isLibrary"
Add the two jars as "external jars" in the classpath
Set the java compiler to 1.7
clean and rebuild the project
Now errors are gone.
Download the facebook sdk from here.
Extract the zip file.
Import only facebook sdk project into eclipse as "Existing Android code into
workspace".
Now, this project will show many errors, do not open any java file or
resource file and do not try to do any imports or clean project until I
mention it to do so.
First add the v7 library to this project by doing right click on facebook
sdk project >> properties>>android>>Add Library.(If you don't have latest
v7 support library download it from sdk manager), also set the project build
target to the maximum android version available and select "is library".
Now, right click on facebook project and select >Build path>Configure build
path>Libraries tab>Add external jars> browse to place where you extracted
facebook sdk in step 2 and find two jar files in libs folder(android-
support-v4.jar and bolts-android-1.1.2.jar) and add both files. Switch to
"order and export" tab and select both the jar files and click on ok.
Now right click on facebook sdk >>properties>>Java Complier>>set the
"compiler compliance level to 1.7 or more and use default compliance settings.
Now select the project and click on Project > Clean.
This should remove all errors now. This is how it worked for me.
Android Facebook SDK import occurs with errors - Eclipse
Check this out. May be this will help you.
I faced same problem while working in Android Studio.
But you are facing in Eclipse.

Google play resources where not found

First of all. Please do not lock or report this thread. I've tried all similar stackoverflow questions and none have fixed my problem!
Since I've added the google play services lib to my project (and the external JAR file)
I keep getting the same error over and over again.
I've downloaded the google play libs with my SDK manager, I've imported the project and then I referred to the play library in my app and added the external JAR file.
Pictures:
Can anybody tell me what I did wrong or how I can fix this problem?
I'm just trying to make my app login with Google+ really..
Thank you
~Yenthe
Since I've added the google play services lib to my project (and the external JAR file) I keep getting the same error over and over again.
Its a library project and you to reference the same in your android project.
I've imported the project and then I referred to the play library in my app and added the external JAR file.
Remvoe the external jar. Reference the library project as below.
http://developer.android.com/google/play-services/setup.html
If you are using android-studio follow the steps in the above link under the title Using Android Studio:
If you are using eclipse as a in IDE.
Copy the google-play services_lib library project to your workspace (folder where your android map project is). The library project can be found under the following path.
<android-sdk-folder>/extras/google/google_play_services/libproject/google-play-services_lib library project .
Import the library project to your eclipse
Click File > Import, select Android > Existing Android Code into Workspace, and browse the workspace import the library project. You can check if it is library project. Right click on the library project. Goto properties. Click Android on the left panel. You will see Is Library checked.
Right click on your android project. Goto properties. Choose Android on the left panel. Click on Add and browse the library project. Select the same. Click ok and apply

Google play services library in Intellij 12

Does anyone have any experience in making use of the Google play services library project in IntelliJ?
I recently purchased IntelliJ and want to make use of the Google play services library (specifically the mapping aspects of the library). In eclipse this works no problem but in IntelliJ all of the references to MapFragment etc are not being resolved.
I have done the following:
1) Imported the Google play module as a library project (marked it as a library project in the android facet)
2) Marked the google play library project as a dependency of my main application
Despite this it's not resolving the required imports.
Does anyone have any tips for how to enable the Google play services library in an IntelliJ android project?
http://youtrack.jetbrains.com/issue/IDEA-96525
Found the solution for folks out there.
You will need to add a dummy class to the src folder.
You'll also need to add the google-play-services.jar to your module as a jar dependency.
I tried a lot of suggestions on stackoverflow.com. However, I was able to get the project to build and run in IntelliJ IDEA 12.0.2 by
Copying the google-play-services.jar file located within my android sdk directory to the ./libs directory in my Android project
Re-importing the project (e.g., on Mac OS X, open IDEA and go to File -> Import Project...) into IntelliJ IDEA.
Follow the steps in the wizard carefully. You should be able to see that IntelliJ IDEA recognizes the google-play-services.jar archive (it's checked). This worked for me. The problem appears to be a bug.
The confusion here is that you need to add the google play libs as an android library project, not the JAR. You also need to make sure import a copy of the the library project, not directly out of the android sdk folder.
In your IntelliJ Project, open the Android SDK Manager in the tools/Android menu.
Scroll to the bottom of the SDK Manager and choose to install the google play sdk.
Go to the extras folder in your android sdk directory and copy google-play-services_lib folder to somewhere handy for you
Open your module settings F4, right click your module and select to add a module. Follow the guide for adding a module from existing sources.
This way, you've added the google play android library project to your project, not just the jar.
So the way to do this is to build goole-play-services.jar from IDEA and then include the jar file as a dependency.

Categories

Resources