我在项目1中使用2以下的lib.spring-core-3.1.0.RELEASE.jar 2. spring-web-3.1.0.RELEASE.jar
但android studio正在考虑上面的lib重复输入并在打包时给出错误.
Error:duplicate files during packaging of APK E:\Code\iDoc\app\build\outputs\apk\app-debug-unaligned.apk
Path in archive: META-INF/license.txt
Origin 1: E:\Code\iDoc\app\libs\spring-core-3.1.0.RELEASE.jar
Origin 2: E:\Code\iDoc\app\libs\spring-web-3.1.0.RELEASE.jar
You can ignore those files in your build.gradle:
android {
packagingOptions {
exclude 'META-INF/license.txt'
}
}
------------------------------------------------------------
Run Code Online (Sandbox Code Playgroud)
有人遇到过类似的问题吗?
请为此错误建议一些解决方法.
我有一个自定义的 SwipeRefreshLayout,其中有一个自定义的 GridView。我想根据捏合/缩放手势更改 GridView 的列号。我已经成功实施了。问题是,尺度太敏感了。
例如,我的列号为 3-5。缩放到 3 或 5 很容易,但要缩放到 4 就很难了,因为缩放本身太敏感了。
这是我的自定义 SwipeRefreshLayout 类
/**
* This class contains fix from http://stackoverflow.com/questions/23989910/horizontalscrollview-inside-swiperefreshlayout
*/
public class CustomSwipeRefreshLayout extends SwipeRefreshLayout {
private int mTouchSlop;
private float mPrevX;
private ScaleGestureDetector mScaleGestureDetector;
private ScaleListener mScaleListener;
public CustomSwipeRefreshLayout(Context context, AttributeSet attrs) {
super(context, attrs);
mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
}
public void setScaleListener(Context context, ScaleListener scaleListener) {
this.mScaleListener = scaleListener;
mScaleGestureDetector = new ScaleGestureDetector(context, new MyOnScaleGestureListener());
}
@Override
public boolean onInterceptTouchEvent(MotionEvent event) {
if (mScaleGestureDetector …Run Code Online (Sandbox Code Playgroud)