Gradle build stuck while using symja library - android

Gradle build is stuck while running project.
I have included symja-2015-08-09.jar file in libs folder.
I have no other dependencies and no other external jar files.
Can anyone please suggest any solution.
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
testCompile 'junit:junit:4.12'
}
The app runs fine after removing the jar file.
Has anyone used symja libraries in their android projects before?

You can try, clean the project then rebuild it. It may work. But first of all make sure you have installed proper android SDK

Related

Android libraries: versions conflict issue

I've the below dependence in my Android app build.gradle
compileSdkVersion 25
buildToolsVersion "25.0.2"
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:design:25.0.0'
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.firebase:firebase-jobdispatcher-with-gcm-dep:0.6.0'
compile 'com.google.firebase:firebase-appindexing:10.0.1'
compile 'com.google.firebase:firebase-ads:10.0.1'
testCompile 'junit:junit:4.12'
compile 'com.android.support:multidex:1.0.1'
}
but getting an error about versions compatibility, as shown below, what is the one to be changed here, i could not figure it out :(
I had same problem what i did was compile the higher version of libraries ,which were creating this error,in app:gradle only.
for example in your case
compile 'com.android.support:mediarouter-v7:25.0.0'
Add this in app:gradle.
There may be more like this mediarouter libraries if it still give error add them jst like this(making them higher version).
First you need to find out where's what consists of a conflicting version of the library. The easiest way to do so is to:
Open Terminal pane in your Android Studio.
Type in: ./gradlew androidDependencies
Find the row that represents the ENCLOSING library consisting of a conflict.
Then just use exclude statement for the conflicting library, like so:
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
(the example assuming com.android.support.test.espresso:espresso-core:2.2.2 was the ENCLOSING library, and com.android.support:support-annotations being the conflict)

Installing/Using J2V8 in Android Studio

I am new to Android Studio development, as well as gradle and j2v8.
I have a sample Hello World app and want to use j2v8 in it (just for curiosity). I have the following in my application gradle
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
testCompile 'junit:junit:4.12'
// https://mvnrepository.com/artifact/com.eclipsesource.j2v8/j2v8_android
compile group: 'com.eclipsesource.j2v8', name: 'j2v8_android', version: '3.0.5'
}
The last one in there is my attempt at adding j2v8.
Next I tried a sample line from this post, so I added the following to my Activity:
V8 v8 = V8.createV8Runtime();
What I don't understand is what imports I need for that to work. I must be missing one or more steps but had a hard time finding instructions online.
Thanks.
using compile group: 'com.eclipsesource.j2v8', name: 'j2v8_android', version: '3.0.5' , add import com.eclipsesource.v8.V8 also not work.
change to using compile 'com.eclipsesource.j2v8:j2v8_android:3.0.5#aar' works fine.
My own solution:
download 3.0.5 aar file from here
Add as a module via Android studio following these directions

Google Maps conflict dependency in Gradle

I have tried to add a Google Map fragment to my android app. I add the dependency
compile 'com.google.android.gms:play-services-maps:8.1.0'
However when I try to sync the gradle build file I get the error
Warning:Conflict with dependency 'com.android.support:support-annotations'.
Resolved versions for app (22.2.0) and test app (23.0.1) differ.
On the advice of another stack overflow answer we ran the Gradle dependencies report, and found that the only package that includes the module 22.2.0 is the google play one itself.
I have tried to exclude the module but this is to no avail.
Has anyone solved this problem? Any help would be much appreciated.
I attach the relevant part of the build.gradle file
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
//./compile 'com.android.support:appcompat-v7:19.1.0'
androidTestCompile ('com.android.support.test:runner:0.4') {
exclude module: 'support annotations'
}
// Set this dependency to use JUnit 4 rules
androidTestCompile ('com.android.support.test:rules:0.4') {
exclude module: 'support annotations'
}
// Set this dependency to build and run Espresso tests
androidTestCompile ('com.android.support.test.espresso:espresso-core:2.2.1') {
exclude module: 'support annotations'
}
// Set this dependency to build and run UI Automator tests
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
androidTestCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-maps:8.1.0'
}
You are not excluding the support annotations module from your testing libraries because of a small typo. Change "support annotations" to "support-annotations" in your exclude statements.
exclude module: 'support-annotations'
Huh! Faced this issue in the morning and now seeing this question.
I resolved by adding the following additional dependency:
androidTestCompile 'com.android.support:support-annotations:22.+'
I was not sure of the correct resolving version thereby kept with wildcard '+', if you are sure replace the wildcard with the right one.

AppCompat Error onCreate()

I just imported my project which worked fine from Eclipse to Android Studio v1.2.11 and now the project is no longer working with the following error which make the app crashes at onCreate() method:
java.lang.NoClassDefFoundError: android.support.v7.app.AppCompatDelegateImplV11.
I have updated updated my app to the latest v7 library, i.e. 22.1.1. below is my gradle.build dependencies:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile('com.android.support:support-v4:19.1.0') {
force = true
}
compile('com.google.android.gms:play-services-base:7.3.0') {
force = true
}
compile 'com.google.android.gms:play-services-plus:7.3.0'
compile 'joda-time:joda-time:2.7'
compile 'com.google.http-client:google-http-client-gson:1.20.0'
compile 'com.parse.bolts:bolts-android:1.1.2'
compile('com.facebook.android:facebook-android-sdk:3.22.0#aar') {
exclude group: 'com.android.support', module: 'support-v4'
exclude module: 'bolts'
}
compile 'com.google.guava:guava:18.0'
compile project(':PullToRefreshListView')
compile project(':CircularImageView')
compile project(':CountryPicker')
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:support-v13:22.1.1'
}
configurations {
// to avoid double inclusion of support libraries
all*.exclude group: 'com.android.support', module: 'support-v4'
}
NB: I am using Theme.AppCompat.Light in my styles which I believe supports ActionBar. What I want to achieve is the Nav. drawer but the app doesn't go past the onCreate(). Any help with this exception will be highly appreciated
For anyone having similar issue, I was able to solve this and thought I should share with others. The error was due to my configuration as I was excluding the android.support in my project. Once I commented it, it just vanished.
Make sure your class dependency is in your application specific build.gradle file, not your global build.gradle file.

Crouton depends on libraries but is not a library itself

I'm using Android Studio 0.6.1, with Crouton library and today after gradle sync I got next error:
Error:A problem occurred configuring root project 'project_name'.
Module version de.keyboardsurfer.android.widget:crouton:1.8.4 depends on libraries but is not a library itself
That's going on?
This issue due to com.android.support-v4 recent update.
So I changed
compile 'com.android.support:support-v4:20.+'
to
compile 'com.android.support:support-v4:19.1.+'
and crouton works fine
Different workaround is to use #aar:
compile('de.keyboardsurfer.android.widget:crouton:1.8.4#aar') {
exclude group: 'com.google.android', module: 'support-v4'
}
My solution according to #Revedko answer, using #aar and change all supports to version lower than 21 -> 20.+
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.loopj.android:android-async-http:1.+'
compile "com.bugsense.trace:bugsense:3.5"
compile('de.keyboardsurfer.android.widget:crouton:1.8.4#aar') {
exclude group: 'com.google.android', module: 'support-v4'
}
compile 'com.android.support:appcompat-v7:20.+'
compile 'com.google.android.gms:play-services:5.0.77'
}

Categories

Resources