I am a old developer with Eclipse IDE now I switched to Android Studio. I want to use the below tutorial
Live Stream Library
I want to import the libstreaming library to Android Studio.
libstreaming
With the help of Fritte's comment on this page, I did the following to import libstreaming into my Android Studio (v1.5.1) project:
Create a new Android Project
Clone libstreaming into an other directory
In your new Android Project, File > New > Import Module > Path to libstreaming
You can then add libstreaming as a dependency in your app by adding compile project(':libstreaming') to the dependencies section of your build.gradle (Module:app) file. E.g., mine now looks like this:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile project(':libstreaming')
}
Related
i have created an android library AAR in android studio 2.1.3 in which i use the following dependencies:
compile 'com.google.android.gms:play-services-vision:9.4.0+'
compile 'com.google.android.gms:play-services-wearable:9.4.0+'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.3'
now i am using this aar in an application but those dependencies were failing unless i add them to the dependencies of the new app.
i search here and i found that i need to add the following line:
compile (project(':LIBNAME-release')) {transitive = true}
but this didn't work. is there something i missed? or is it related to the obfuscation i did to the aar file? or is it a must to add these dependencies to the app?
Try to compile you project first:
dependencies {
compile project(':Name-Of-Your-Project')
}
This is Ashton Engberg's suggestion from that post
I am new to AWS. I created AWS sample app which works fine. But when I try to add the code to my new application, I am getting error in Application class on import statement.
import com.amazonaws.mobile.AWSMobileClient;
import com.amazonaws.mobile.push.PushManager;
import com.amazonaws.mobile.user.signin.SignInManager;
public class Application extends MultiDexApplication {
private final static String LOG_TAG = Application.class.getSimpleName();
#Override
public void onCreate() {
// My code //
.
.
.
Android studio gives error on "mobile" part of these import statements.
I don't know if any Jars needs to be added in the project.
Gradle code builds without the error.
Following is my gradle code -
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(include: ['*.jar'], dir: 'app/libs')
compile 'com.android.support:design:23.2.1'
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:support-v4:23.1.0'
compile('com.amazonaws:aws-android-sdk-s3:2.2.11')
compile 'com.amazonaws:aws-android-sdk-core:2.+'
compile('com.amazonaws:aws-android-sdk-cognito:2.2.11')
compile('com.amazonaws:aws-android-sdk-mobileanalytics:2.2.11')
compile('com.amazonaws:aws-android-sdk-sns:2.2.11')
compile 'com.google.android.gms:play-services-gcm:7.8.0'
compile 'com.google.android.gms:play-services-plus:7.8.0'
compile 'com.android.support:multidex:1.0.0'
Let me know if I should add some more of my code here.
The classes you try to import do not exist in the AWS SDK. Check the sample to find out where they come from.
Please read the instructions in the READ_ME/index.html file of your sample download project. The same instructions exist on the Build page in AWS Mobile Hub. There you will find instructions to copy/paste the helper source code that was included in the download into your own project, including the com.amazonaws.mobilehub java package. This source is included in the project download and must be copied to your own product application.
https://forums.aws.amazon.com/forum.jspa?forumID=88
im getting error in my android project The import android.support.v7.app cannot be resolved and even i import library from properties .
which i downloaded from https://github.com/koush/android-support-v7-appcompat.
and added in project from properties but still getting error
You need to add the appropriate dependency to your module gradle.build file as follows:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.2'
}
Make sure to synchronize your build.gradle file (Right click on file --> Synchronize 'build.gradle') and Clean your project (Build --> Clean Project) after the change.
I have imported successfully from Maven Repository the com.actionbarsherlock:actionbarsherlock:4.4.0 and com.android.support:support-v4:20.0.0. But when i try to import
import com.actionbarsherlock.app.SherlockActivity;
it doesnt import and also if i try to run the application i get a similar error to:
Multiple dex files define Android studio error when trying to import Google Maps into Google Maps project
I dont get the point here why the action bar sherlock library is not imported correctly even that the maven repository is added to dependency correctly .
The problem is solved. I found out the solution by changing build.gradle of my app and adding the #aar part in the compile section of actionbarsherlock
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:20.0.0'
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0#aar'
}
This solved the problem and i found out the solution reading this:
https://code.google.com/p/maven-android-plugin/wiki/ApkLib
I am new to android studio.I am developing an app which uses Facebook SDK.I have downloaded Facebbok SDK and imported it as a module to my android project.I am using latest version of android studio.So I simply imported it and did not make any change in other files for this.First I am trying to use facebook login functionality.But when I build the app I am getting following error.
error: package com.facebook.android does not exist
I could see one solution as an answer to someone's question. But i could not understand it.Please somebody help me.
check you build.gradle
it should got this dependency
if you got library project:
dependencies {
compile project(':facebook');
}
if you got jar files in libs folder:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
}
or just add maven central dependency to:
dependencies {
compile 'com.github.asne.facebook:facebook:3.17.2'
}
You need to add dependencies on your gradle file :-
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
above is path you need to add dependencies {} like below :-
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
}
Is the facebook library is jar file or library project?
If is jar file, you just need to add jar file in libs folder and dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
} in build.gradle.
If is library project, you should modify your setting.gradle and build.gradle files.
Adding this line of code to the dependencies in the build.gradle file helped me get rid of the same error.
dependencies {
...
compile 'com.facebook.android:facebook-android-sdk:4.0.0'
}
From platform=android facebook developers
-the last line of the section "Add Facebook SDK to Your Project")