The container 'Android Dependencies' references non existing library while adding ActionBarSherlock to my project - actionbarsherlock

I'm trying to add ActionBarSherlock to an existing Android project. I followed the steps in the video below:
http://actionbarsherlock.com/faq.html
I added the library folder from the ZIP in Eclipse and updated the compiler version and the Android Support Library. But when I add ActionBarSherlock to my project afterwards, I get the following error:
The container 'Android Dependencies' references non existing library 'C:\Users\Me\Dropbox\Workspaces\Android\Sherlock\library\bin\sherlockactionbar.jar'
I don't understand why he goes looking for this jar, which obviously doesn't exist...
PS: My project name for ActionBarSherlock is SherlockActionBar here.
Thanks in advance.

Related

Unable to use Itext7 and other 3rd party library after updating to Android Studio Chipmunk

I just update my Android Studio to Chipmunk 2021.2.1 and my itext code dont work anymore. Im using itext7-core:7.2.2.
How do i fix this?
I had the same problem with another library.
In my case, I was managing the library locally and importing it into my project as a jar file.
Specifying the path to the jar file directly solved the problem.
In my case, the problem was solved by adding the following notation to the app-level build.gradle.
// MyLibrary
implementation project(':MyLibrary')
implementation files("... /MyLibrary/library.jar") // added

Android Studio referencing classes in an AAR published to local maven repo

I have a problem in Android Studio (3.1.2) referencing classes in an AAR published to my local maven repo.
I have successfully published an AAR file to my local maven repo and included it in a project that needs to use the AAR following this article:
https://medium.com/#kuassivi/tip-work-with-third-party-projects-locally-with-gradle-961d6c9efb02
Basically I have added a reference to mavenLocal() in the top level project in the repositories sections of buildscript and all projects. I have also added a reference to the AAR in the app gradle build (i.e. implementation groupid:artifactid:version). I have not done anything more than this.
If I do a gradle rebuild within Android Studio, everything compiles fine but if I edit a file that references classes in the AAR, the IDE cannot resolve the references.
When I do find class (i.e. cmd o), the IDE correctly finds the class within the classes.jar of the AAR and decompiles it.
I am guessing that this is happening partly because it cannot pick up the source jar that I published alongside the aar file to the local maven repo.
How do I get the IDE to pick up the source files and reference the classes in the AAR correctly? I would prefer to do this via a change in the gradle scripts rather than via an IDE wizard, if that is possible.
After more digging, I have discovered that the use of the maven repo is irrelevant because it is picking up the AAR file from the gradle cache in ~/.gradle/caches/transforms-1/files-1.1 not from the maven local repo. I can also include the sources files using "implementation com.company:artifact-name:0.8:sources". There is a good information here:
https://www.alonsoruibal.com/my-gradle-tips-and-tricks/
However Android Studio still cannot recognise the imports and though compilation works, the imports are marked in red in the editor. I guess there must be some magic with gradle that I am missing.
I put together a simple example on github here:
https://github.com/jmc420/kotlin_examples
In the multiproject folder there are 2 separate projects, one called "nested" which contains an android library project called "multiprojectlibrary" which "nested" references via a grade include.
The "multipleprojectlibrary" uses the maven publish plugin to publish the aar to mavenLocal via the command gradle publishToMavenLocal.
In the "independent" project "multipleprojectlibrary" is a dependency which is read from mavenLocal.
The "nested" project works reliably.
Using mavenLocal in the "independent" project seems very unreliable. Sometimes the "independent" project correctly uses the mavenLocal "multipleprojectlibrary" but when you make an update and publish again, the "independent" project starts using a copy of "multipleprojectlibrary" in .gradle/caches/transforms-1/files-1.1.
There seem to be 2 issues. One is that the "New Project" menu option of Android Studio only allows you to make an app; you can only make an Android Library via the "New Module", which puts the library as a sub project of an app. An option to create a "New Library" would solve this.
The other issue is that it is not clear how the maven local repo and the gradle cache interact. They seem to get out of sync and sync gradle does not seem to sync the gradle cache with the mavenLocal repo.

How to import unity project into existing Android studios projecT?

I am having problems importing unity project into Android Studios. I already have a Android studio project (for menu and other things), and i want to add a scene from Unity 5 3D, as a second activity (not the main activity).
I want to call unity scene when user clicks the button.
I know how to export it from unity but it automatically sets it as MainActivity, and i cant find a way to manually overwrite it.
Edit:
I want to do it in Android Studios and not Eclipse. I just want to know if there is an easy way to do it, or at least a hint for how to do it.
Had the same requirement and successfully imported the Unity project into an existing Android Studio project. As mentioned the first thing will be to export the Unity project. I used Unity version 2017.1. Rough steps below:
Export Android project via Unity build settings
You can simply select the folder where your existing project is located. Unity should add a sub folder with an Android Studio format project and all dependencies and everything it needs to run.
Now we need to convert this "Application" project to a "Library" project. This is simply done by changing the build.gradle file. Replace apply plugin: 'com.android.application' with apply plugin: 'com.android.library'.
You also need to remove the applicationId and change the compile versions to match your project's versions.
Also make sure to modify the Unity module AndroidManifest.xml file. You will need to remove the LAUNCHER intent-filter as the UnityPlayerActivity will not be the main activity anymore.
android.intent.action.MAIN
android.intent.category.LAUNCHER
Also need to remove the Application node attributes so it won't conflict with your project's manifest.
Finally in your settings.gradle add the module and then add the Unity project dependency on your "app" module: compile project(':UnityFolder')
Build and now you should be able to start the Unity Scene by calling:
Intent intent = new Intent(this, UnityPlayerActivity.class);
startActivity(intent);
yes we can start another activity before unity Activity
1 step-create java class and add it in manifest and like in image
2nd step- create onClick in java class
link to unity game class s you can see in amage
see pic, you can choose button also
3rd step- in manifest replace Intent in own java class it will work [3]
From this link: https://nevzatarman.com/2015/01/04/unity-android-tutorial-opening-unity-scene-from-an-activity/
Add android:process=":UnityKillsMe" to the unity activity GameActivity.

Trying to convert projects that werent built using Gradle

I have tried to clone the following repository on GitHub using Android Studio, https://github.com/AlexKang/favr.git, but I have the error:
Before this I selected build project using Gradle and then accepted anything it wanted to install. I am having similar problems with, https://github.com/mb16/RemindEm.git, where I get that
Each time I selected "create project from existing sources" and then accepted everything it suggested.
What am I doing wrong?
The projects have eclipse .classpath files in the folder. I'm guessing you should be able to import the project into eclipse.
As an alternative to using Eclipse you might want to try using a feature of IntelliJ IDEA (Android Studio's parent project). File > New > Project from Existing Sources... Then select the .project file for the import

Facebook SDK not imprted in Android studio

I have downloaded the facebook sdk version 3.21.1 and I have android studio version 1.0.2.
Whenever I try to import the 'facebook' folder in the sdk folder(through the import module method), it dosent show up in the project tree on the left hand pane. Also I am getting this error : Error:(1, 0) Gradle DSL method not found: 'pply()'
Possible causes:The project 'The Social App' may be using a version of Gradle that does not contain the method.
Gradle settingsThe build file may be missing a Gradle plugin.
Apply Gradle plugin
Please help.
For me I was having similar problems.
I am using Android Studio 1.1 and Facebook SDK 4.0.0
First, be sure to follow that steps 3 to 6 in the facebook developers page in your existing project.
Click here for the getting started instructions.
Be very sure you follow it all.
After importing it I didn't see it in my project structure be sure to click down on the left corner and make sure it is on Project, if not use the drop down and select Project.
Also do ctrl+alt+shiftt+s to bring up the project structure wizard. Then go to app dependencies and click plus in the right corner to add the :facebook module dependency.
Then make sure that in your root project build.gradle that it's using gradle 1.1.1 since some problems with importing has been fixed here.
dependencies {
classpath 'com.android.tools.build:gradle:1.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Then referencing this answer was the finishing touch:
Can not import facebook-sdk 4.0.1
Then a pop should appear to upgrade buildToolsVersions to 21.1.1.
This is what it took for me to get this all working. Hope it works for you too!

Resources