I'm trying to install the Android SDK from Kontakt into a project in Android studio. I'm following the (seemingly basic) instructions on the Kontakt site here:
http://docs.kontakt.io/android-sdk/quickstart/#installing-the-sdk---android-studio
In brief, these steps say add maven { url 'http://repo.kontakt.io/repository/internal/' } in the repositories in your top-level build file, and add to add compile 'com.kontakt.sdk.android:library:1.0.5' in the dependencies in the main module build file.
However, when I try to sync my project with the updated files, it fails with an error message:
Error:Failed to find: com.kontakt.sdk.android:library:1.0.5
I tried with a totally fresh project and the same issue.
I'm guess this all has something to do with the fact that the instructions are written for Android's 0.12 version of the Gradle tools, but I'm using v1.1.0. I'm not across the detail of Gradle, so so any help would be appreciated.
My guess is that path to Kontakt.io public repository should be added to allprojects section instead of buildscript.
allprojects {
repositories {
jcenter()
maven { url 'http://repo.kontakt.io/repository/internal/' }
}
}
I am not 100% sure so don't shoot me:P
I think adding this line:
-->compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.kontakt.sdk.android:library:1.0.6'
Directly above the gradle project I wanted to compile fixed it.
Go to the Kontakt.io Android Proximity SDK https://github.com/kontaktio/kontakt-android-sdk on GitHub.
Click the Download ZIP button
Un-zip the file to a temporary location.
Add the jar file in your Android Studio Project.
File -> New Module -> Import .JAR/ .AAR Package -> Click Next -> Browse the SDK path (2.1.1) -> Finish (Take time to add in the project)
Then, Add module in dependencies
Right Click on Project Name -> Open Module Settings -> Under the list (Modules) -> Click on Dependencies -> Click on '+' -> Module Dependency -> Add Kontakt.io-android-sdk
Now Build your project It worked for me to kontakt io SDK. If anybody find the way to do this as Gradle build, please let me know.
Related
After upgrading android studio form 2.3.3 to 3.0 it needs to add google maven repository and in my project an error appears in inflating info.hoang8f.widget.fbutton but before upgrading my project was working properly with FButton.
Also if I modified the build gradle to 2.3.3 the same problem still existed until I delete google maven repository form build script repositories and allprojects repositories then it works properly.
I am wondering what cause this problem?
For some odd reason compile 'info.hoang8f:fbutton:1.0.5' doesn't build. So I found this solution.
Download the library on the below link:
http://repo1.maven.org/maven2/info/hoang8f/fbutton/1.0.5/fbutton-1.0.5.aar
Step 1:
File >> New >> New Module >> Import JAR/AAR Package >> "Location of the downloaded library".
Step 2:
Ctr+Alt+Shift+S >> Click on the Dependencies tab >> Click the plus sign(+) >> 3 Module Dependencies >> Click Ok and Rebuild.
It should be fine afterwards, please let me know how it worked out for you.
I fixed it.
in build.gradle (Module:app) add this
dependencies {
implementation 'com.github.jd-alexander:android-flat-button:v1.1'
}
And add this in your root build.gradle (project:) at the end of repositories:
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
And in the XML configuration change buttonColor to fButtonColor.
It works for me, I hope it works with you.
library source https://github.com/jd-alexander/android-flat-button
we have
desktopRuntime 'org.xerial:sqlite-jdbc:3.15.1'
in gradle file.
i build project but my zip file dont have this file in lib folder.
how can i build project for desktop?
my ide is netbeans.
Thankful.
The problem with the distZip or jar gradle tasks is they miss to include desktop dependencies.
When deploying to desktop you can change temporary desktopRuntime to runtime, so they will be included, as Ladislav Török suggests, but then you should undo the change so that dependency isn't included in the mobile deployment.
If you want to have a working zip, we have to modify the distZip task, to include the desktop dependencies in the lib folder, and also to include them in the class path (so they are also added to the scripts in the bin folder). Include this in your build.gradle script:
startScripts {
classpath += configurations.desktopRuntime
}
distZip {
into("$project.name/lib") {
from configurations.desktopRuntime
}
}
You can also solve the issue by using the shadowJar, providing you include the desktop dependencies, to create an executable fat jar, like in this solution.
Try next steps:
1.
dependencies {
compile 'org.xerial:sqlite-jdbc:3.15.1'
runtime 'org.xerial:sqlite-jdbc:3.15.1'
}
Go to "Files" tab in NetBeans IDE -> your_project -> build -> libs and here add your lib some as sqlite-jdbc.jar
Using libgdx 1.7.0/Android Studio, TexturePacker is supposed to be included out of the box if checking the tools option when creating the project (and so I did).
In fact, if I check my build.gradle file, in the project(":desktop") section I have the compile "com.badlogicgames.gdx:gdx-tools:$gdxVersion" added.
But even with that, the build is not able to find the tools package (even though I can successfully use the Controllers extension, which should be the same I think)
I'll leave here the desktop part of the build.gradle, just in case:
project(":desktop") {
apply plugin: "java"
dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
compile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop"
compile "com.badlogicgames.gdx:gdx-controllers-desktop:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-controllers-platform:$gdxVersion:natives-desktop"
compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
compile "com.badlogicgames.gdx:gdx-tools:$gdxVersion"
}
}
And a image with the libraries in the project, where you can see the tools...
This is an issue caused by importing tools in Core Dependency. Remove the dependency in the project(":desktop") of the Core Dependency and add it to desktop dependency.
You can also solve it by downloading the gdx tools and importing the jar file. Just create a library folders and paste the jar file. Then go to File > Project Structure > Modules and add the File Dependency which is your jar file.
dependencies {
compile files('libs/runnable-texturepacker.jar')
}
This should work fine.
I was trying to use the TexturePacker class within a class in the core module. However I discovered it to only be available in the desktop module.
This seems logical as the dependency of the tools extension is placed within the desktop project in the root build.gradle file when using the setup utility or following the official instructions to add the extension manually (see Add tools dependency).
Technically, you could move the dependency in the module you want to use TexturePacker in (say core), but according to the provided link this is discouraged. So I recommend you just write your class using TexturePacker within the desktop module.
PS: Note that due to the deprecation of "compile" a replacement by "implementation" in build.gradle might become necessary, but Android Studio will inform you in that case (use ctrl + r for efficient replacements).
Now,google use android studio,i can add dependencies at build.gradle as follows:
dependencies {
compile 'mobi.parchment:parchment:1.6.9#aar'
}
but sometime i want to see the source code "mobi.parchment:parchment#aar",maybe i want to modify it or use to eclipse but not use the gradle plugin
If AndroidStudio didn't download the source code, you can force the download of source (and javadoc) of your AAR dependency by adding these lines in the build.gradle file :
dependencies {
compile 'mobi.parchment:parchment:1.6.9#aar'
compile 'mobi.parchment:parchment:1.6.9:sources#jar'
compile 'mobi.parchment:parchment:1.6.9:javadoc#jar'
}
Then on AndroidStudio in the Projet tab, expand the external Librarie and right clic on your lib (parchment1.6.9), click "Library Properties ..." and the "+" button. the source's jar file is in the gradle cache under ${user_Home}/.gradle/modules-2/files-2.1 directory; you can select it.
(Once is done you don't need anymore to declare the source dependencies; so your build.gradle can contain only :
dependencies {
compile 'mobi.parchment:parchment:1.6.9'
}
I know it's an ugly process, but it's the only workaround I found until now.
I've created an Android Project with Android Studio, and usually everything just works fine.
However, whenever I try to add a new custom Android Library Module or just a project with an Android Library Module I get the following error:
Failed to import Gradle project: Could not fetch model of type 'IdeaProject' using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.
A problem occurred configuring project ':MyLibrary'.
A problem occurred configuring project ':MyLibrary'.
Failed to notify project evaluation listener.
Main Manifest missing from C:\Users\cku\AndroidStudioProjects\MyApplicationProject\MyLibrary\src\main\AndroidManifest.xml
Consult IDE log for more details (Help | Show Log): Failed to import Gradle project: Could not fetch model of type 'IdeaProject' using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.
A problem occurred configuring project ':MyLibrary'.
A problem occurred configuring project ':MyLibrary'.
Failed to notify project evaluation listener.
Main Manifest missing from C:\Users\cku\AndroidStudioProjects\MyApplicationProject\MyLibrary\src\main\AndroidManifest.xml
Consult IDE log for more details (Help | Show Log)
I've followed this answer and this answer with no luck.
Any help is appreciated, thx!
I believe the build.gradle file of the project you are trying to import do not specify the right paths because it can't find AndroidManifest.xml:
Main Manifest missing from C:\Users\cku\AndroidStudioProjects\MyApplicationProject\MyLibrary\src\main\AndroidManifest.xml
It is trying to locate AndroidManifest.xml inside the default folder structure which should be:
-Project
- src
-instrumentText
-main
-java
-res
AndroidManifest.xml
As you are importing a project I believe it has other folder structure, which you should inform in build.gradle like this:
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
instrumentTest.setRoot('tests')
}
And make the necessary changes to reflect the folder structure of the project you want to import.
Just recently (Android Studio 0.2.6) I've tried this again in another project, with no success at all. A co-worker has experienced a similar issue. Now the wizard for creating new modules simply appears blank. It seems to be a genuine bug of Android Studio (which in all fairness is still in early development).
The way to go is to create a new project with only a library in it and then copy its single module over to the existing project. Tinker with the gradle scripts until it builds on the command line. Then go ahead, close Android Studio and delete the .idea directory of your project and all .iml files (there should be one at the root of the project and one at the root of each module). Finally, re-open Android Studio and re-import the project using the gradle.build file in the project root.
Edit: Seems to have gotten more reliable with Android Studio 0.2.8