coinbase / coinbase-android-sdk Goto Github PK
View Code? Open in Web Editor NEWDEPRECATED — Android SDK for Coinbase
License: Apache License 2.0
DEPRECATED — Android SDK for Coinbase
License: Apache License 2.0
Hi.. I am a starter in android development. I tried to run my android emulator in Linux for a project I just created and got this error.
Error: Program type already present: org.apache.http.HeaderElementIterator
I find it really confused to solve this problem. Can anyone help me out??Please?
When using compile 'com.coinbase.android:coinbase-android-sdk:1.0.1' on Android Studio 3.0.1, I am getting error Unable to merge dex
https://www.coinbase.com/oauth/applications
This link shows
"PAGE NOT FOUND"
"Sorry we couldn't find what you were looking for."
So how can we create application in coinbase to test the SDK ?
The current manual build instructions throws a multiple dex files exception.
Build instructions:
Manual
You can copy this library jar and all its dependency jars to a folder as follows:
git clone [email protected]:coinbase/coinbase-android-sdk.git
cd coinbase-android-sdk
mvn dependency:copy-dependencies -DincludeScope=runtime -DoutputDirectory=$YOUR_JAR_DIRECTORY
mvn package
cp target/coinbase-android-sdk-1.0.1.jar $YOUR_JAR_DIRECTORY
Error seen:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lorg/apache/http/annotation/GuardedBy;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
The library that causes this error is httpclient-4.0.1.jar
. The fix is to remove it:
rm $YOUR_JAR_DIRECTORY/httpclient-4.0.1.jar
The docs all point to using version 1.0.1, but building the sdk manually let's you use the updated library instead. Updating the lib at jcenter would let you use the up-to-date version via gradle.
Because if so, it's not working for me. Nexus 7 with Android 5.1 as test device. Our app always redirects to coinbase.com in Chrome, even if the native Android Coinbase app is installed on the device.
I saw that the only open pull request (#2) is supposed to fix this, however, I've integrated those changes to no avail (still not opening in the native app). Any idea on the status of this situation? Is the PR bad? Is it something on my side? Thanks.
Exception is thrown while calling OAuth.beginAuthorization(...).
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/message/BasicNameValuePair; at org.apache.http.client.utils.URIBuilder.addParameter(URIBuilder.java:350) at com.coinbase.api.CoinbaseImpl.getAuthorizationUri(CoinbaseImpl.java:1135) at com.coinbase.android.sdk.OAuth.beginAuthorization(OAuth.java:36) at <...>.data.api.coinbase.CoinBaseAuth.startAuth(CoinBaseAuth.kt:17) at <...>.domain.login.LoginUserCase.startAuth(LoginUserCase.kt:18) at <...>.presentation.login.LoginViewModel.startAuth(LoginViewModel.kt:21) at <...>.presentation.login.LoginActivity$initView$1.onClick(LoginActivity.kt:28) at android.view.View.performClick(View.java:6597) at android.view.View.performClickInternal(View.java:6574) at android.view.View.access$3100(View.java:778) at android.view.View$PerformClick.run(View.java:25885) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6669) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.message.BasicNameValuePair" on path: DexPathList[[zip file "/data/app/<...>-2MN8xvV_HTBANhsukPUwFg==/base.apk"],nativeLibraryDirectories=[/data/app/<...>-2MN8xvV_HTBANhsukPUwFg==/lib/x86, /system/lib]]
The send ETH confirmation screen in the Android app states the transaction is being broadcast to the Bitcoin blockchain
Error:Program type already present: org.apache.http.ContentTooLongException
I get this error when I try to compile my app after importing the library (with nothing written in the code for coinbase).
`
AGPBI: {"kind":"error","text":"Program type already present: org.apache.http.ContentTooLongException","sources":[{}],"tool":"D8"}
FAILED
FAILURE: Build failed with an exception.
Please update Android Coinbase API from v1 to v2.
i m redirecting to my app using intent filters after user has verified his email but query parameter state and code are missing in the redirect uri. Can anyone help me on this?
From what I can tell we have two httpclients being packaged:
This causes conflicts when building a project with android-gradle (used in Android Studio):
Warning:Dependency org.apache.httpcomponents:httpclient:4.3.6 is ignored for release as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
1.3.2
)app/build.gradle
add the coinbase android sdk as mentioned in the docs.When I add the dependency into my project, i get the error
Error:Program type already present: org.apache.http.auth.AuthSchemeProvider
upon compiling.
Adding SDK using
compile ('com.coinbase.android:coinbase-android-sdk:1.0.1')
This occurs in the Android SDK Example As well
Does anyone have a fix for this?
Hi, I am using the Coinbase SDK for android.
My project dependency is:
compile('com.coinbase.android:coinbase-android-sdk:1.0.1') {
exclude module: 'httpclient' //by artifact name
exclude group: 'org.apache.httpcomponents' //by group
exclude group: 'org.apache.httpcomponents', module: 'httpclient' //by both name and group
}
I was unable to get Access token by using this statement:
OAuth.beginAuthorization(this, CLIENT_ID, "user", REDIRECT_URI, null);
Application crashes when the SDK tries to get Authorization URI using:
URI authorizationUri = coinbase.getAuthorizationUri(request);// code from sdk's Auth.java
I believe it was happening because we are passing the OAuthCodeRequest.Meta as null. Anyways I don't know the solid reason here.
So somehow I managed to create an access token by using this code manually:
String auth_url = "https://www.coinbase.com/oauth/authorize?" +
"client_id=" +CLIENT_ID +
"&redirect_uri=" + REDIRECT_URI +
"&response_type=code" +
"&scope=wallet:user:read";
Log.e("TAG", "onCreate: "+ auth_url );
URI authorizationUri = URI.create(auth_url);
Intent i = new Intent(Intent.ACTION_VIEW);
Uri androidUri = Uri.parse(authorizationUri.toString());
androidUri = androidUri.buildUpon().appendQueryParameter("state", getLoginCSRFToken(MainActivity.this)).build();
i.setData(androidUri);
startActivity(i);
It successfully returns me the access token. But finally when I try to get the user instance using this code snippet:
String token = tokens.getAccessToken();
Coinbase cb = new CoinbaseBuilder()
.withAccessToken(token)
.build();
Log.e("Email", "doInBackground: "+cb.getUser().getEmail());
It gives me this exception:
com.coinbase.api.exception.CoinbaseException: Bereiken komen niet overeen met de huidige API-versie.
OR
com.coinbase.api.exception.CoinbaseException: Scope does not match the current API version.
Can anybody help me in this?
Many Thanks!!
Hello
I'm using this dependency compile ('com.coinbase.android:coinbase-android-sdk:1.0.1')
and current android sdk is 25
I'm trying to send bitcoin (after OAuth2 token)
using:
Transaction t = new Transaction();
t.setTo("emailAddress");
t.setAmount(Money.parse("BTC 0.001"));
t.setNote("notes to send");
cb = new CoinbaseBuilder().withAccessToken(tokens.getAccessToken()).build();
cb.sendMoney(t);
but it returns this java.io.FileNotFoundException: https://coinbase.com/api/v1/transactions/send_money
i also have set Internet Permission in Manifest, is there anything missing? i need to resolve this ASAP
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.