Reputation: 1436
I am currently playing around with Bluemix and Mobile First Platform researching whether it might fit my needs as backend for the Android app I am developing.
Starting from an empty Android project I have only successfully implemented IBM Push Notification
. I followed this official sample.
My next step was to implement the lib Couchbase Lite for Android (so far the data I will used is placed in my own CouchDB service). To do so I added the dependency to Gradle so the file looked like this
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "es.woozycoder.android.bluemixpayaround"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile group: 'com.ibm.mobilefirstplatform.clientsdk.android',
name:'core',
version: '1.+',
ext:'aar',
transitive: true
compile group: 'com.ibm.mobilefirstplatform.clientsdk.android',
name: 'push',
version: '1.+',
ext: 'aar',
transitive: true
compile 'com.couchbase.lite:couchbase-lite-android:1.1.0'
}
What is my surprise when I compile and see the following error which I believe is closely related to too many dependencies.
Error:Execution failed for task ':app:transformClassesWithDexForDebug'. com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_72\bin\java.exe'' finished with non-zero exit value 2
The answer linked above suggests that Google Play Services dependency would be the problem and I agree as the lib Push depends on the whole google-services lib instead of only the specific ones (I guess those would be gcm (com.google.android.gms:play-services-gcm) and base (com.google.android.gms:play-services-base)).
Has anyone an idea of what could be the solution to this issue?
UPDATE
couchbase-lite-android
dependency.googleauthentication
also depends on the whole lib com.google.android.gms:play-services
instead of the specific ones only.UPDATE 2
Here is the Github project. Pull it and compile. You'll see that it compiles and runs successfully. But, now uncomment the couchbase-lite dependecy in the module's gradle.build. Now, build the project. It will fail.
Upvotes: 1
Views: 249
Reputation: 44516
It is not clear from your question if you are actually developing a Hybrid Android app or a native one...
If you are developing a native app and adding the MFP SDK to it, then you should create a Gradle-based Android project in Android Studio.
If you are developing a Hybrid Android app in MobileFirst Studio then you have two options:
As you may have guessed, MFP does not support Gradle-based projects at this time.
Upvotes: 1