Class android.support.v4.widget.Space is not found - android

I cloned a project from a github repository to my personal computer which is using class android.support.v4.widget.Space and i'm trying to run it but it always gives me the same error:
Error:(6, 33) error: cannot find symbol class Space
In my gradle.build i have the following dependencies:
compile files('libs/pinit-sdk-1.0.jar')
compile project(':bounceScroller')
compile 'com.ogaclejapan.smarttablayout:library:1.2.1#aar'
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.github.navasmdc:MaterialDesign:1.5#aar'
compile 'com.nineoldandroids:library:2.4.+'
compile 'com.esri.arcgis.android:arcgis-android:10.2.6-2'
compile 'com.github.clans:fab:1.5.3'
compile 'com.github.pedrovgs:draggablepanel:1.8'
compile 'com.android.support:support-v4:21.0.3'
compile 'com.ogaclejapan.smarttablayout:utils-v4:1.2.1#aar'
compile 'com.github.bumptech.glide:glide:3.6.0'
compile project(':rangeseekbar')
compile 'com.android.support:recyclerview-v7:21.0.3'
compile 'com.android.support:cardview-v7:21.0.3'
compile project(':blurry')
I tried searching google and found that class Space exits in the android support library, does anyone know how to fix this?

Upgrade your support-v4 dependency from 21.0.3 to 22.1.0, because it was added in that version.
http://developer.android.com/tools/support-library/index.html#revisions

Related

Is there a resolution for this conflict between the material design support library and the gms:wallet library over the field "rippleColor"?

In my project, when I try and add the latest design support library I get this error which appears to be in conflict with the wallet library:
D:\Android Stuff\ReleaseMEdia\app\build\intermediates\exploded-aar\com.google.android.gms\play-services-wallet\8.1.0\res\values\wallet_colors.xml
Error:(2) Attribute "rippleColor" has already been defined
Here is the list of all my gradle dependencies below:
compile 'com.google.android.gms:play-services-wallet:8.1.0'
compile 'com.google.android.gms:play-services-ads:7.8.0'
compile 'com.google.code.gson:gson:2.2.+'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:cardview-v7:22.2.1'
compile 'com.jakewharton:butterknife:5.1.2'
compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'
compile 'com.balysv:material-ripple:0.9.0-SNAPSHOT#aar'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.jpardogo.materialtabstrip:library:1.0.6'
compile 'com.google.api-client:google-api-client-android:1.19.0'
compile 'com.android.support:cardview-v7:22.2.1'
compile 'com.android.support:recyclerview-v7:22.2.1'
compile 'com.github.gabrielemariotti.cards:cardslib-core:2.0.1'
compile 'com.github.gabrielemariotti.cards:cardslib-cards:2.0.1'
compile 'com.github.gabrielemariotti.cards:cardslib-recyclerview:2.0.1'
compile 'se.emilsjolander:stickylistheaders:2.1.5'
compile 'com.squareup.picasso:picasso:2.4.0'
compile 'com.android.support:palette-v7:23.1.0'
compile 'com.nispok:snackbar:2.11.+'
compile 'com.uwetrottmann:trakt-java:4.3.1'
compile 'com.melnykov:floatingactionbutton:1.3.0'
compile 'com.android.support:customtabs:23.1.0'
compile 'com.android.support:multidex:1.0.0'
compile 'jp.wasabeef:picasso-transformations:1.2.1'
compile 'com.android.support:design:23.1.0'
Everything syncs fine until I add the design library at the bottom, then I am presented with this message when trying to sync gradle.
I've seen a few other people online with this issue but it doesn't look like anyone has a resolution yet. Can anyone provide any insight?
It looks like this has nothing to do with wallet, but instead is an issue with the version of com.balysv:material-ripple you are using as per this issue.
The library's Github page shows that the latest version (which includes the above fix) is:
compile 'com.balysv:material-ripple:1.0.2'

Can't add both Google Play Services and Appcompat-v7 dependencies

I am trying to clean up and update the libraries on a project. As part of this I moved from using the classic library folder dependency to one through gradle, for Google Play Services. I started getting an dexDebug error when compiling debug (see Android Studio - UNEXPECTED TOP-LEVEL EXCEPTION: ). From what I understand this error shows up if you have a double dependency somehow.
Below is the dependencies part of my gradle file. If I comment out appcompat-v7 completely, everything works fine. Does play-services already depend on appcompatv7 and automatically bringing it in or what's going on?
dependencies {
compile 'com.google.android.gms:play-services:7.0.0'
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.google.maps.android:android-maps-utils:0.3'
//compile files('libs/commons-codec-1.8-sources.jar')
compile files('libs/engine.io-client-0.2.3.jar')
compile files('libs/ffmpeg.jar')
compile files('libs/Java-WebSocket-1.3.0.jar')
compile files('libs/socket.io-client-0.1.3.jar')
//compile files('libs/javacpp.jar')
compile files('libs/javacv.jar')
compile files('libs/json-simple-1.1.1.jar')
compile files('libs/opencv.jar')
//compile files('libs/twitter4j-async-4.0.2.jar')
compile files('libs/twitter4j-core-4.0.2.jar')
//compile files('libs/twitter4j-media-support-4.0.2.jar')
//compile files('libs/twitter4j-stream-4.0.2.jar')
}
It turns out there was an exact duplicate to this question:
After update of AS to 1.0, getting "method ID not in [0, 0xffff]: 65536" error in project
I fixed it by adding (this alone will fix the original problem):
defaultConfig {
...
multiDexEnabled true
}
and by cutting down on the massive Google Play Services, and using only subsets of it (this alone will also fix the original problem):
dependencies {
//compile 'com.google.android.gms:play-services:7.0.0'
compile 'com.google.android.gms:play-services-maps:7.0.0'
compile 'com.google.android.gms:play-services-location:7.0.0'
compile 'com.google.android.gms:play-services-gcm:7.0.0'
compile 'com.google.android.gms:play-services-plus:7.0.0'
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.google.maps.android:android-maps-utils:0.3+'
compile files('libs/engine.io-client-0.2.3.jar')
compile files('libs/ffmpeg.jar')
compile files('libs/Java-WebSocket-1.3.0.jar')
compile files('libs/socket.io-client-0.1.3.jar')
compile files('libs/javacv.jar')
compile files('libs/json-simple-1.1.1.jar')
compile files('libs/opencv.jar')
compile files('libs/twitter4j-core-4.0.2.jar')
}

Braintree Excluding Library from Gradle

I have used following dependency in my Android Studio gradle.
dependencies {
compile project(':facebookSDK')
compile project(':wheel')
compile project(':viewPagerLibrary')
compile 'com.google.code.gson:gson:2.1'
compile 'com.google.android.gms:play-services:+'
compile 'com.android.support:appcompat-v7:20.0.0'
compile 'io.card:android-sdk:5.0.0'
compile files('libs/acra-4.5.0.jar')
compile files('libs/analytics-3.4.0.jar')
compile files('libs/androidasync-1.3.8.jar')
compile files('libs/crashlytics.jar')
compile files('libs/CWAC-Adapter.jar')
compile files('libs/eventbus-2.2.0.jar')
compile files('libs/fastjson-1.1.6.jar')
compile files('libs/gradle-wrapper.jar')
compile files('libs/ion-1.3.8.jar')
compile files('libs/localytics.jar')
compile files('libs/nineoldandroids.jar')
compile files('libs/parse-1.3.0.jar')
compile files('libs/socialauth-4.4.jar')
compile files('libs/universal-image-loader-1.9.0.jar')
}
Now I need to implement Braintree Gradle dependency
compile 'com.braintreepayments.api:braintree:1.+'
But sometimes it show me some other error sometime its shows me java.exe finished with non-zero exit value 3.
I want to use this braintree dependency for payment options please help me out how can i use it without error with the current dependency.
Thanks a lot for solving my problem in advance.
The Braintree Android library depends on GSON version 2.2.4 or higher.. It looks like you're currently depending on version 2.1.0. Upgrading your dependency to 2.2.+ should satisfy Braintree's and allow installation.
If you do run into further problems, Braintree's support can help, via email at support#braintreepayments.com or phone at 877.434.2894.

Facebook SDK v4.0.1 Failing to compile with gradle

I am having trouble using Gradle to build Facebook SDK 4.0.1 in Android Studio 1.2 beta. There is no compile error, but the compiled library is not in my External Libraries. Previously, I successfully had:
compile 'com.facebook.android:facebook-android-sdk:3.22.0'
However,
compile 'com.facebook.android:facebook-android-sdk:4.0.1'
doesn't appear to do anything. From searching, it looks like this version is available on maven. Here is my complete dependency list:
dependencies {
compile 'com.google.code.gson:gson:2.3.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.crashlytics.android:crashlytics:1.+'
compile 'com.parse.bolts:bolts-android:1.2.0'
compile 'com.mixpanel.android:mixpanel-android:4.5.3#aar'
compile 'net.hockeyapp.android:HockeySDK:3.5.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services:6.5.87'
//compile 'com.google.android.gms:play-services:7.0.0'
compile 'com.android.support:appcompat-v7:22.0.0'
compile project(':libraries:downloader_library')
compile project(':libraries:zip_file')
compile 'com.facebook.android:facebook-android-sdk:4.0.1'
testCompile 'junit:junit:4.12'
}
I also have had some difficulties with Google Play Services 7.0.0, hence the comment.
Is there something I am doing wrong, such as a missing dependency or an incorrect assumption?
Solved
It turns out you can't have comments in your dependencies, so removing
//compile 'com.google.android.gms:play-services:7.0.0'
Fixed the issue.

How Android Studio import the other project

I am a beginner in android development,when i develop my app with Android Studio,i can use "compile" in build.gradle file to import the other project from internet like below:
dependencies {
compile 'com.android.support:support-v4:21.0.2'
compile 'com.android.support:appcompat-v7:21.0.2'
compile 'com.android.support:recyclerview-v7:21.0.2'
compile 'com.android.support:cardview-v7:21.0.2'
compile 'com.google.code.gson:gson:2.3.1'
compile 'com.squareup.okhttp:okhttp:2.2.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.phrase:phrase:1.0.3'
compile 'com.jakewharton.timber:timber:2.5.0'
compile 'com.andreabaccega:android-form-edittext:1.1.0#aar'
compile 'com.jakewharton:butterknife:6.0.0'
compile 'com.crashlytics.android:crashlytics:1.1.13'
compile 'com.github.bumptech.glide:glide:3.4.0'
compile 'io.reactivex:rxjava:1.0.0'
compile 'io.reactivex:rxandroid:0.23.0'
compile 'com.google.android.gms:play-services:6.1.71'
compile 'com.mcxiaoke.viewpagerindicator:library:2.4.1'
}
That's very useful, but where does those project come from? Can i import my project use "compile com.xxxxxxxx.xxxx:0.00.0" like above from internet? Maybe my question is too easy for you. But i really want to know why?
Imported libraries come from the repositories that you mention in your gradle file, under the repositories part.
If you want to use your project in another one like that, you need to publish it on a repository first.

Categories

Resources