How to add *.jack in android studio? - android

In android M, android support jack, and I compile the library and it is 3d.jack instead of 3d.jar.
My question is how to add 3d.jack as the library to build my app which depends on the library of 3d.
I know how to add a lib if the lib is 3d.jar. But I try to use same way, copy 3d.jack into libs folder, and change to *.jack, it doesn't work.
So anyone knows how to do it?
dependencies {
compile fileTree(dir: 'libs', include: ['*.jack'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
}

I have a workground method.
In the module where it make the .jack file, you can add
LOCAL_JACK_ENABLED := disabled
in the make file.Then it will generate .jar instead of .jack.
Then you can use the .jar as usual.

Related

Android .aar dependencies aren’t resolving in app project that depends on .aar

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

Android support-v4 library being added with appcompat-v7

In my build gradle file I have two dependencies (appcompat-v7 and design) and then whatever externar jar files I add to the project
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:design:22.2.1'
}
Is it normal to find in the project libraries (Project structure -> Libraries) the external jar files, appcompat-v7, design-22.2.1, support-v4 and support-annotations-22.2.1, I don't understand why the two last ones are being added, I think they're the cause of another issue I'm having (dexDebug).
Would anyone know if that is normal ?
Thanks
Running ./gradlew -q app:dependencies shows that com.android.support:appcompat-v7 depends on com.android.support:support-v4, so that is why it is pulled in. You will have to find a separate solution for your dex debug issue.

How to avoid use dependencies again (Android)?

I've created an Android library with Studio and this library needs some 3rd libraries. The build.gradle looks like below:
dependencies {
compile fileTree(dir: 'libs', include: ['*.*'])
compile 'some library:1.3.2'
compile 'some other library:1.3.4'
}
The library can be compiled freely and finely, and then I push them in to local Maven. Everything fine!
Now I create a client application just for a sample of my library. What confusion is that I must do follow:
dependencies {
compile fileTree(dir: 'libs', include: ['*.*'])
compile 'mylibrary:1.0'
compile 'some library:1.3.2'
compile 'some other library:1.3.4'
}
Which means to include the two 3rd libraries. Otherwise I must get errors "NoClassFound" which relevant to the two libraries.
You know the
compile 'mylibrary:1.0'
is the meaning to include my library, but why should I include the other twos which were used by "mylibrary"? Could I avoid that and just -compile 'mylibrary:1.0' ?
OK, I've solved project with the help of #CommonsWare
Check out
http://www.gradle.org/docs/current/userguide/publishing_maven.html
http://maven.apache.org/pom.html
To make a pom.xml self and done.

Android Studio with Gradle incompatibility (Google Play Services issue)

I am developing an android app with Android Studio 0.8.9. I am using Gradle to build my project.
I want to include google-play-services.jar file into my project in order to use push notification api.
I have added those statements into my gradle (application layer) file as follows:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/google-play-services.jar')
compile files('libs/android-support-v4.jar')
compile files('libs/gson-2.2.3.jar')
compile files('libs/volley_23042014.jar')
compile 'com.google.android.gms:play-services:5.2.08'
}
but it never works. I get the following error:
Multiple dex files define Lcom/google/ads/AdRequest$ErrorCode;
I've checked bunch of websites (including Stackoverflow.com). None of them has worked for me.
I have latest versions of Google Support Library, Google Support Repository, Google Play Services.
Here is my libs directory
My SDK version like:
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="20" />
What I have done wrong? If anyone has any idea please let me know.
If you're including Play Services via:
compile 'com.google.android.gms:play-services:5.2.08'
you don't need this:
compile files('libs/google-play-services.jar')
so just remove it.
Since the first line of your dependencies will make it automatically pick up any jar files you put in your libs directory:
compile fileTree(dir: 'libs', include: ['*.jar'])
make sure you remove the jars from there as well.
For that matter, there are other libraries you shouldn't include via specific jars.
Instead of this:
compile files('libs/android-support-v4.jar')
compile files('libs/gson-2.2.3.jar')
use this:
compile 'com.android.support:support-v4:20.0.0'
compile 'com.google.code.gson:gson:2.2.3
(Note that later versions of GSON are available).

gradle android proguard error

I am having this issue and seem can't figure it out when building gradle android with proguard:
Can't read [C:\Users\xxx\dev\xyz\Xyz-nextgen\build\exploded-bundles\XyzCommonXyz_volleyUnspecified.aar\libs\android-support-v13.jar(;;;;!META-INF/MANIFEST.MF)] (Duplicate zip entry [android/support/a/a/b.class == android-support-v13.jar:android/support/v13/app/FragmentCompat$FragmentCompatImpl.class])
There are 3 library projects and one app project.
All projects use only one android-support-v13.jar.
Thanks.
Andy
Open the module's gradle.build file and
In
dependencies {
compile 'com.android.support:support-v4:13.0.+'
compile files('libs/android-async-http-1.3.1.jar')
compile fileTree(dir: 'libs', include: '*.jar')
}
Change
compile 'com.android.support:support-v4:13.0.+'
To
compile 'com.android.support:support-v4:21.+'
make sure u have updated build tools in the sdk manager and let us know if that works

Categories

Resources