Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with appcompat-v7:26.0.0' #42

Open
johnernest02 opened this issue Aug 11, 2017 · 6 comments
Open

Does not work with appcompat-v7:26.0.0' #42

johnernest02 opened this issue Aug 11, 2017 · 6 comments

Comments

@johnernest02
Copy link

johnernest02 commented Aug 11, 2017

I am getting errors building with the latest AppCompat library.

Error:(40, 8) error: cannot access ActionBarActivity
class file for android.support.v7.app.ActionBarActivity not found

I am importing the library properly
compile 'com.github.liuguangqiang.swipeback:library:1.0.2@aar'

@johnernest02
Copy link
Author

I noticed that the downloaded SwipeBackActivity still extends from ActionBarActivity. But browsing the code from github, it already extends from AppCompatActivity.

@johnernest02
Copy link
Author

I tried removing from dependencies to delete the library and then re-adding to download from gradle again, the SwipeBackActivity still extends from ActionBarActivity

@johnernest02
Copy link
Author

Even after invalidating the caches, the library being downloaded still extends ActionBarActivity. Doesn't anybody else encounter the same problem here?

@offdroid
Copy link

The problem is that the latest gradle dependency (as of now version 1.0.2) is outdated.
If you look into the file in this repository, you'll see that SwipeBackActivity actually extends from AppCompatActivity and not ActionBarActivity.

In order to use the new version, you have to compile the library yourself.

  1. Clone the repository (or download as .zip)
  2. Extract the archive (only if you downloaded it as a .zip)
  3. (In your Android Studio project) File > New > Import Module
  4. "Source directory" -> path [...]/SwipeBack-master/library (wherever you saved it; Important: select the "library" subfolder)
  5. "Module name" -> change from :library to :swipeback
  6. -> "Finish"
  7. (In your application level build.gradle) Add the newly added module as a dependency of your app compile project(':swipeback') (this will replace compile 'com.github.liuguangqiang.swipeback:library:1.0.2@aar')
  8. Finally, sync it and you should be good to go

Note: Keep in mind that this local branch will not be updated when the developer (@liuguangqiang) does so.
You might/should change things like com.android.support:appcompat-v7:*version* (in the swipeback: build.gradle) to the same version as in your application level build.gradle to avoid compatibility issues (this could break the functionality of the module (in the future); it works with version 26.0.1).

@minas90
Copy link

minas90 commented Aug 18, 2017

Also for some reason SwipeBack doesn't work properly with CollapsingToolbarLayout ( 26.0.0+ ), it worked fine with 25.4.0.
Now when I scroll down a little bit and scroll all the way up, swipe back works only after some delay :(
Any idea how to fix that?
You can find sample project attached.

MyApplication7.zip

@avp90
Copy link

avp90 commented Dec 29, 2017

@offdroid, @dev-JE02:
You can use jitpack.io as additional package repository like this:

root build.gradle

allprojects {
    repositories {
        jcenter()
        maven { url "https://maven.google.com" }
        maven { url 'https://jitpack.io' }
    }
}

app build.gradle
(get the latest commit in master Branch)

dependencies {
        compile 'com.github.liuguangqiang:SwipeBack:master-SNAPSHOT'
}

OR
(to get a specific commit)

dependencies {
        compile 'com.github.liuguangqiang:SwipeBack:0dd68189c5'
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants