我正在尝试使用单独的应用程序作为依赖项编译应用程序但是当我从这个库编译引用模块时,我看到几个"错误:包不存在"和"错误:无法找到来自graddle的符号类"消息.以下是我的两个构建文件.
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.1.0"
defaultConfig {
minSdkVersion 11
targetSdkVersion 19
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
packagingOptions {
exclude 'AndroidManifest.xml'
exclude 'resources.arsc'
exclude 'classes.dex'
}
}
dependencies {
repositories {
mavenCentral()
}
compile 'com.android.support:support-v4:+'
compile 'com.google.code.gson:gson:2.2.2'
compile 'com.google.android.gms:play-services:+'
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
compile 'com.android.support:support-v4:+'
compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'
compile 'se.emilsjolander:stickylistheaders:2.+'
compile 'com.googlecode.libphonenumber:libphonenumber:+'
compile files('libs/crashlytics.jar')
compile files('libs/httpclient-4.2.3.jar')
compile files('libs/libphonenumber-5.9.jar')
compile files('libs/mobileservices-0.2.0-javadoc.jar')
compile files('libs/mobileservices-0.2.0.jar')
compile files('libs/stringtotime-1.0.4.jar')
compile files('libs/urbanairship-lib-2.0.2.jar')
compile 'com.github.chrisbanes.actionbarpulltorefresh:extra-abs:+'
compile files('libs/FlurryAnalytics-4.0.0.jar')
compile 'com.squareup.picasso:picasso:2.3.3' …Run Code Online (Sandbox Code Playgroud) 我目前有以下代码从地址簿中检索联系人:
Uri uri = ContactsContract.Contacts.CONTENT_URI;
String[] projection = {
ContactsContract.Contacts._ID,
ContactsContract.Contacts.DISPLAY_NAME
};
String selection = ContactsContract.Contacts.IN_VISIBLE_GROUP + " = '1'";
String sortOrder = ContactsContract.Contacts.DISPLAY_NAME + " COLLATE LOCALIZED ASC";
Cursor cursor = getContentResolver().query(uri, projection, selection, null, sortOrder);
SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
android.R.layout.simple_list_item_multiple_choice,
cursor,
new String[] {ContactsContract.Contacts.DISPLAY_NAME, ContactsContract.Contacts._ID},
new int[] { android.R.id.text1},0);
getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
setListAdapter(adapter);
Run Code Online (Sandbox Code Playgroud)
然而,这也会在我的Nexus 4上返回我的facbook联系人.我的选择有问题吗?
谢谢