我正在使用android studio。我的应用程序在棒棒糖设备中正常工作但是当我在下面的棒棒糖设备中运行应用程序时,它给出了以下错误消息。我也试过this回答
如果有问题,请用jarjar重新包装以更改 课程包 警告:依赖xpp3:xpp3:1.1.4c因发布而被忽略,因为它可能与提供的内部版本冲突 Android系统。 如果有问题,请用jarjar重新打包以更改类包 警告:调试将忽略依赖关系xpp3:xpp3:1.1.4c,因为它可能与Android提供的内部版本冲突。
我的build.gradle是:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.mypackagename"
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:recyclerview-v7:21.0.+'
compile project(':library')
compile 'com.loopj.android:android-async-http:1.4.7'
compile 'com.googlecode.libphonenumber:libphonenumber:7.0.5'
compile 'com.afollestad:material-dialogs:0.7.4.2'
//For XMPP
compile 'org.igniterealtime.smack:smack-android:4.1.0'
// Optional for XMPPTCPConnection
compile 'org.igniterealtime.smack:smack-tcp:4.1.0'
// Optional for XMPP-IM (RFC 6121) support (Roster, Threaded Chats, …)
compile 'org.igniterealtime.smack:smack-im:4.1.0'
// Optional for XMPP extensions support
compile 'org.igniterealtime.smack:smack-extensions:4.1.0'
compile 'com.android.support:multidex:1.0.1'
/* compile "org.igniterealtime.smack:smack-android:4.1.0-rc1"
// Optional for XMPPTCPConnection
compile "org.igniterealtime.smack:smack-tcp:4.1.0-rc1"
// Optional for XMPP-IM (RFC 6121) support (Roster, Threaded Chats, …)
compile "org.igniterealtime.smack:smack-im:4.1.0-rc1"
// Optional for XMPP extensions support
compile "org.igniterealtime.smack:smack-extensions:4.1.0-rc1"
compile "org.igniterealtime.smack:smack-tcp:4.1.0-alpha6"*/
}
答案 0 :(得分:17)
您可以在build.gradle文件中添加以下代码。它对我有用:
type HBaseRow = java.util.NavigableMap[Array[Byte], java.util.NavigableMap[Array[Byte], java.util.NavigableMap[java.lang.Long, Array[Byte]]]]
type CFTimeseriesRow = Map[Array[Byte], Map[Array[Byte], Map[Long, Array[Byte]]]]
type CFTimeseriesRowStr = scala.collection.immutable.Map[String, scala.collection.immutable.Map[String, scala.collection.immutable.Map[Long, String]]]
import scala.collection.JavaConverters._
def rowToStrMap(navMap: CFTimeseriesRow): CFTimeseriesRowStr = navMap.map(cf =>
(Bytes.toString(cf._1), cf._2.map(col =>
(Bytes.toString(col._1), col._2.map(elem => (elem._1, Bytes.toString(elem._2)))))))
def navMapToMap(navMap: HBaseRow): CFTimeseriesRow =
navMap.asScala.toMap.map(cf =>
(cf._1, cf._2.asScala.toMap.map(col =>
(col._1, col._2.asScala.toMap.map(elem => (elem._1.toLong, elem._2))))))
@transient val conf = HBaseConfiguration.create()
conf.set(TableInputFormat.INPUT_TABLE, tableName)
val hBaseRDD = sc.newAPIHadoopRDD(conf, classOf[TableInputFormat],
classOf[org.apache.hadoop.hbase.io.ImmutableBytesWritable],
classOf[org.apache.hadoop.hbase.client.Result])
.map(kv => (kv._1.get(), navMapToMap(kv._2.getMap)))
.map(kv => (Bytes.toString(kv._1), rowToStrMap(kv._2))).take(10).foreach(println)