Android Studio won't let me import SDK - android

I was trying to follow this post to import the mopub SDK into my app, however Android Studio is being difficult.
I unzipped the SDK, and went to Project Structure to select import a New Module. When I chose the unzipped folder, the Finish button is grayed out, and there is an error saying 'Select Modules to import'
I am using Android Studio version 0.8.6. Here is a screenshot of the error menu

I had the same issue so I had to install it manually.
First, unzip the downloaded file and then copy the unzipped mopub-sdk folder into your project directory.
Next, open your project's settings.gradle file and make sure the MoPub SDK is included as a module:
include ':app', ':mopub-sdk'
Open your app's build.gradle file (not your main project one) and add the MoPub SDK as a dependency:
dependencies {
compile project(':mopub-sdk')
}
These instructions are based of those found on the mopub github.

In eclipse, if we create a project which is having library projects inside our project, then
we cannot import this project as module in Android studio. This may be the issue

It's not fault of AndroidStudio, just try archived sdk, it works
https://github.com/mopub/mopub-android-sdk/archive/v3.9.0.zip
from https://github.com/mopub/mopub-android-sdk/releases
// sorry I don't enough reputation to post image

Related

Cant import OpenCV module in android studio

I've been trying to import Open CV module to android studio exactly as many tutorials online told me to but it wont work. I googled the issue a bit and found a solution to choose the sdk folder as the directory and not java but even that dosent work.Im using Android Studio v4.0.1 and the latest version of OpenCV. Help.
First of all make sure your sdk folder in your downloaded opencv sdk contains a build.gradle file. If your downloaded sdk doesn't have build.gradle try another version of opencv sdk, Unless you have to select java folder in the opencv sdk and after that copy jni files into your project tree.
The easiest way to import OpenCV sdk into your project is as follow:
Create an Android Project
File -> New -> Import Module -> path to OpenCV/sdk/ -not java folder! (opencv 4+)
File -> Project Structure -> add OpenCV as 'Module Dependency' of 'app'
Clean Project
Done! no need to copy jni libs and other things.
Importing opencv to androidstudio
->First download opencv from https://opencv.org/releases/
for your current using android studio version,and extract it.
->open android studio create new project if project is already
exist follow the below.
->in android studio choose option in MENU->File->Import
Module here please select the your opencv-android directory
till sdk selection
eg:("E:\stardev\OpenCV-android-sdk\sdk") and
then finish, if your downloaded same version it's good to go
else change the build.gradle setting from opencv build.gradle
and sync.
->after this to add as a dependency in android studio
Choose
Menu->File->Project Structure->dependencies,
select app from tab and add(+ icon) from menu select module
dependency and select sdk from here.
->to test goto your project activity and
(import org.opencv.core.Core)
If you are using Arctic fox and still facing this issue, This Solution worked for me.
If your next and/or finish buttons is still not clickable after adding the right path
https://stackoverflow.com/a/68738767/12052997

How add libarary which don`t have compile dependencies android studio?

I want to add DonwloadProvider library to my android studio project but it doesn`t have any compile dependencies.
so therefore I searched so much but did not find any related answer
please anyone help me with this it is very important for me
Download the Project from the github and add it under your project folder
Do the following steps
1. Goto File -> New -> Import Module.
2. Source Directory -> Browse the project path.
3. Specify the Module Name – it is used for internal project reference.
4. Let Android Studio build the project.
Open build.gradle (Module:app) file.
References:
How to add library projects

Run Facebook SDK sample apps in Android Studio

Novice question.
What is the recommended way to run the sample apps, included in the Facebook SDK, in Android Studio (0.8.6)?
The ideal answer would include step-by-step instructions.
I'm using Android Studio version 0.8.0, and Facebook SDK 3.18.
When I tried to open a sample as a separate project, it can't find Gradle and wasn't able to run it. However, when I imported /samples folder as a root, all sample projects were imported and was able to run each samples.
File > Import Project > Select FACEBOOK_SDK_PATH/samples > OK > Create project from existing sources
and then, click next/ok as Android Studio's default setting.
Hope it helps!
Suposing you already downloaded and unzipped the SDK.
Create your android project. Gradle based.
File -> Import Module. Navigate to the unzipped folder and select the unzipped folder.
Add the library dependency in your main module (the one created with your project) adding this line in your build.gradle:
Synchonize project.
If you want to continue creating your own app, you might add the dependency module build.gradle file:
android {
dependencies {
compile project (':facebook')
}
}

Android facebook sdk import error

i had download facebook skd import it in my eclipse add v4 jar file and change complier to 1.6 but yet it give me error in class FacebookAppLinkResolver
import bolts.AppLink;
import bolts.AppLinkResolver;
import bolts.Continuation;
import bolts.Task;
above are not import
1.Open your project properties
2.Select "Java Build Path" from left side menu
3.Select "Libraries" tab
4.Press "Add External Jar"
5.MOST IMPORTANT STEPS :-
Select "bolts" jar file of "libs" folder of YOUR CURRENT PROJECT LOCATION(Path Should be
of your project only and not the android sdk).
6.Select "Order and Export" tab and "TICK" the checkbox of "android-support-v4.jar"
Download sdk for Bolts library from
https://github.com/BoltsFramework/Bolts-Android
and add this project with facebook sdk project.
Or if you're using Gradle you can add this to your Gradle file:
dependencies {
compile 'com.parse.bolts:bolts-android:1.1.3'
}
Facebook is also available so you don't have to add that manually either. To include both use the following:
dependencies {
compile 'com.facebook.android:facebook-android-sdk:4.5.0'
compile 'com.parse.bolts:bolts-android:1.1.3'
}
You can check for the latest version of Bolts here.
amalBit's answer works great for Eclipse. Here is the Android Studio equivalent.
I encountered this error after updating to the latest Facebook SDK for Android.
File ->
Project Structure ->
Select the Facebook module on the left
Select the Dependencies tab
Press the + button at the bottom of the
window
Select File Dependency
In the libs folder, you should see the
bolts.jar file you copied over when updating the SDK.
Select the
bolts.jar file and press OK
Then press Apply and OK
Doing a Gradle Sync (happened automatically for me) should resolve the error.
I had the same problem. Check your facebook-sdk/facebook folder to see if there is a libs file (Not directory)
So I think Android studio failed to import the libs as a directory instead included a libs file with "../libs" in it.
Not sure if this was facebook-sdk issue, git cloning issue or android studio issue.
Solution:
1. remove the dummy libs file
2. copy the libs directory manually
3. remove the dependency in project structure
4. add it manually by clicking + sign

Import Android project using Eclipse

I'm having trouble trying to import a project. After doing so I get 6 error items. Of which 4 are the same (Unable to resolve target 'Android-8').
Another one is: Project 'MyProject' is missing required Java project: 'org.json'.
Even though the file org.json.jar is in the libs folder.
And the last one is: The project cannot be built until build path errors are resolved.
What can I do to make Eclipse properly import my projects?
I even tries to create a new project and manually copie the files, but didn't turn out as expected.
To import the existing project
Project Explorer-->new Android Project from Existing Resource-->select project and check copy to the work space option(if you need)--> finish.
Problem
Unable to resolve target 'Android-8'
Right click on the project-->android-->select the target as 8 and save.
org.json.jar
Download this jar from the internet and paste the jar file in the lib folder.
3.Clean the projec once
Unable to resolve target 'Android-8'
You dont have Android-8 SDK installed on your pc.Concider downloading this SDK or if you have any SDK above this version just select it. under project properties.
Project 'MyProject' is missing required Java project: 'org.json'
This message suggest you that this project is expecting org.json library project in your workspace and you should include it as library project.
If you have got jar file then its fine,under project properties just remove library project dependancies and include jar file in build path.
How have you installed the ADT?
It's possible that if Android options aren't available, you haven't installed the ADT plugin correctly.
I would do the following:
Ensure that the ADT is installed
Delete the project and re-import it under the option "Import existing Android code into workspace"
Check that the build path options are correct. Android projects add jars in the lib folder to projects automatically, but this is worth checking.
Keep us posted!

Categories

Resources