android uber源码,Uber SDK in android

问题

I am trying to add an Uber 'request a ride' button in my android application. In my gradle build file I have added the following line:

compile 'com.uber.sdk:rides-android:0.5.0'

Automatically Android studio asks to sync the gradle files as they have changed. After this I get 500+ errors with my project but when I remove the dependency it all goes back to normal.

Could anyone please help me solve this issue?

The module gradle script:

apply plugin: 'com.android.application'

android {

compileSdkVersion 23

buildToolsVersion "23.0.1"

android {

useLibrary 'org.apache.http.legacy'

}

defaultConfig {

applicationId "com.example.android.myuberapp"

minSdkVersion 16

targetSdkVersion 23

versionCode 1

versionName "1.0"

}

buildTypes {

release {

minifyEnabled false

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

}

}

sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/fonts'] } }

}

dependencies {

compile fileTree(dir: 'libs', include: ['*.jar'])

testCompile 'junit:junit:4.12'

compile files('libs/android-async-http-1.4.4.jar')

compile files('libs/volley.jar')

compile 'com.android.support:appcompat-v7:23.2.0'

compile 'com.android.support:design:23.2.0'

compile 'com.google.android.gms:play-services:8.4.0'

compile 'com.github.sembozdemir:ViewPagerArrowIndicator:1.0.0'

compile 'com.google.maps.android:android-maps-utils:0.4+'

compile 'com.github.jakob-grabner:Circle-Progress-View:v1.2.9'

compile 'me.grantland:autofittextview:0.2.+'

compile 'com.squareup.picasso:picasso:2.5.2'

compile 'com.uber.sdk:rides-android:0.5.0'

}

The full set of errors:

Error file is here

回答1:

It looks like you've past the 64k limit and should enable multidex.

The majority of those "errors" are actually warnings that gradle seems to be grouping together. Check the last couple lines of the error for the exact message.

In your build.gradle

android {

compileSdkVersion 21

buildToolsVersion "21.1.0"

defaultConfig {

...

minSdkVersion 14

targetSdkVersion 21

...

// Enabling multidex support.

multiDexEnabled true

}

...

}

dependencies {

compile 'com.android.support:multidex:1.0.0'

}

And in your manifest:

package="com.example.android.multidex.myapplication">

...

android:name="android.support.multidex.MultiDexApplication">

...

Separately:

Since the Uber SDK isn't that large, another suggestion to delay multidex is to only the use the Play services libraries you actually need.

For example, instead of

'com.google.android.gms:play-services:8.4.0'

You could use just cloud messaging (if that is the component used).

com.google.android.gms:play-services-gcm:8.4.0

See more here

来源:https://stackoverflow.com/questions/37688976/uber-sdk-in-android

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值