1

在 Android Studio 中,我导入了使用 Eclipse + ADT 开发的项目(如http://developer.android.com/intl/pt-br/sdk/installing/migrate.html中所述),一旦 Gradle 构建完成, “import-summary.txt” 说:

Replaced Jars with Dependencies:
--------------------------------
The importer recognized the following .jar files as third party
libraries and replaced them with Gradle dependencies instead. This has
the advantage that more explicit version information is known, and the
libraries can be updated automatically. However, it is possible that
the .jar file in your project was of an older version than the
dependency we picked, which could render the project not compileable.
You can disable the jar replacement in the import wizard and try again:

android-support-v4.jar => com.android.support:support-v4:18.0.0
gson-2.3.1.jar => com.google.code.gson:gson:2.3.1

Replaced Libraries with Dependencies:
-------------------------------------
The importer recognized the following library projects as third party
libraries and replaced them with Gradle dependencies instead. This has
the advantage that more explicit version information is known, and the
libraries can be updated automatically. However, it is possible that
the source files in your project were of an older version than the
dependency we picked, which could render the project not compileable.
You can disable the library replacement in the import wizard and try
again:

google-play-services_lib => [com.google.android.gms:play-services:+]
librarySherlok =>
    com.actionbarsherlock:actionbarsherlock:4.4.0@aar
    com.android.support:support-v4:18.0.0

但是在CirclePageIndicator.java类中libraryViewPagerIndicator,我在导入阶段有错误:

import android.support.v4.view.MotionEventCompat;
import android.support.v4.view.ViewConfigurationCompat;
import android.support.v4.view.ViewPager;

Gradle Build 的消息在哪里:

C:..\libraryViewPagerIndicator\src\main\java\com\viewpagerindicator\PageIndicator.java
error: package android.support.v4.view does not exist
.
.
error: cannot find symbol class ViewPager
error: package ViewPager does not exist
error: cannot find symbol variable ViewConfigurationCompat
error: cannot find symbol variable MotionEventCompat
.
.
error: method does not override or implement a method from a supertype
.
.
Error:Execution failed for task ':libraryViewPagerIndicator:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

请注意,SDK 中存在 Android 支持库: 在此处输入图像描述

所以我想知道:

  • 项目导入阶段出了什么问题?
  • 我必须更改 Android Studio 中的一些设置?
4

1 回答 1

0

在 libraryViewPagerIndicator 模块 build.gradle 中添加 v4 支持库依赖

于 2016-05-02T09:08:24.797 回答