I think I'm stupid or I'm missing something -hope the latter- but I can't properly import a dependency.
I have the repository in ~/.m2/repository and inside the directory I can see the deploy.
The maven setting.xml has the
<localRepository>${user.home}/.m2/repository</localRepository>
Here is the gradle file:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':lib_facebook')
compile project(':lib_dslrdashboard')
apt "org.androidannotations:androidannotations:3.2"
compile 'org.androidannotations:androidannotations-api:3.2'
compile 'de.livereach:rpc-objects-android:1.0.0'//THIS IS THE LOCAL DEPENDENCY
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'org.slf4j:slf4j-android:1.6.1-RC1'
compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE'
compile 'com.fasterxml.jackson.core:jackson-databind:2.3.2'
compile 'de.keyboardsurfer.android.widget:crouton:1.8.5#aar'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
compile 'com.github.castorflex.smoothprogressbar:library:1.1.0'
compile('com.crashlytics.sdk.android:crashlytics:2.2.3#aar') {
transitive = true;
}
compile('com.twitter.sdk.android:twitter:1.4.0#aar') {
transitive = true;
}
}
I'm on Mac OSx 10.10
Thanks in advance!
Gradle doesn't look at your Maven local repository by default. You need to explicitly ask it to:
allprojects {
repositories {
jcenter()
mavenLocal() // add this line
}
}
Gradle DSL Docs for mavenLocal(): docs.gradle.org/…
Related
In my app build.gradle I have this settings
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:4.0.1'
}
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
maven {
url 'https://jitpack.io'
}
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
}
}
ext {
supportlib_version = '26.0.2'
gps_version = '15.0.2'
}
And in my other gradle file I have integrated these libraries
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.devbrackets.android:exomedia:4.0.3'
//Radio
compile 'com.squareup.okhttp3:okhttp:3.3.1'
//WC
compile 'org.jsoup:jsoup:1.8.3'
compile 'com.onesignal:OneSignal:[3.6.0,4.0.0)'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.booking:rtlviewpager:1.0.1'
compile 'com.github.apg-mobile:android-round-textview:v0.0.3'
compile 'com.github.chrisbanes:PhotoView:1.3.0'
compile 'com.google.code.gson:gson:2.8.0'
//TV & Radio
compile "com.android.support:cardview-v7:$supportlib_version"
compile "com.android.support:appcompat-v7:$supportlib_version"
compile "com.android.support:recyclerview-v7:$supportlib_version"
compile "com.android.support:design:$supportlib_version"
compile "com.android.support:support-v4:$supportlib_version"
compile "com.android.support:support-core-utils:$supportlib_version"
compile "com.android.support:support-media-compat:$supportlib_version"
implementation 'com.google.firebase:firebase-messaging:15.0.2'
compile "com.google.android.gms:play-services-gcm:$gps_version"
compile "com.google.android.gms:play-services-ads:$gps_version"
}
Getting this error on build - Failed to resolve: com.google.android.gms:play-services-gcm:15.0.2
Install Repository and sync project
When I try to install its gives error that The repository could not be found
Please suggest what version should I use for proper build.
There is no 15.0.2 version of play-services-gcm now (see http://maven.google.com).
Also, your use of a $gps_version variable is now discouraged for this exact reason; Play services libraries will iterate at different release cycles with different versions. See the latest guidance: https://developers.google.com/android/guides/versioning#remove_old_anti_pattern
I try to add google analitics to my app but I get error in build.gradle:
Error: Execution failed for task ':app:mergeProductionDebugResources'.
\app\build\generated\res\google-services\production\debug\xml\global_tracker.xml: Error: Duplicate resources
but the wrong in my code:
This is my app level gradle
android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('src/main/java/libs/gson-2.2.4.jar')
compile files('src/main/java/libs/quickblox-android-sdk-chat-2.5.1.jar')
compile files('src/main/java/libs/quickblox-android-sdk-content-2.5.1.jar')
compile files('src/main/java/libs/quickblox-android-sdk-core-2.5.1.jar')
compile files('src/main/java/libs/quickblox-android-sdk-messages-2.5.1.jar')
compile files('src/main/java/libs/bugsense-3.5.jar')
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.google.android.gms:play-services:9.0.0'
compile 'com.google.android.gms:play-services-auth:9.0.0'
compile 'com.joooonho:selectableroundedimageview:1.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.7.0'
compile 'com.github.siyamed:android-shape-imageview:0.9.+#aar'
compile 'com.squareup.picasso:picasso:2.5.2'
compile('com.crashlytics.sdk.android:crashlytics:2.6.5#aar') {
transitive = true;
}
compile 'com.android.support:support-v4:23.+'
compile 'com.android.support:design:23.+'
compile "com.splunk.mint:mint:5.0.0"
compile 'com.google.android.gms:play-services-analytics:9.0.0'
}
apply plugin: 'com.google.gms.google-services'
}
and this is my project level gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0'
}
}
Edit:
when I remove global_tracker.xml
the runOnUiThread in:
import static com.google.android.gms.internal.zzir.runOnUiThread;
not know!!!
Remove the global_tracker.xml from your xml folder, as the google-services plugin will automatically add all the required data from the google-services.json configuration file when building your app.
Im new for android, I want to add payment option in my app. So, I used instamojo. Im include instamojo library in gradle file. But gradle file throw error.
Error:
Error:Failed to resolve: in.juspay:godel:0.6.11.0823
My gradle file:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:23.2.0'
compile 'de.hdodenhof:circleimageview:1.2.1'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:recyclerview-v7:23.2.0'
compile 'com.loopj.android:android-async-http:1.4.7'
compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
compile('com.googlecode.json-simple:json-simple:1.1.1') {
exclude group: 'org.hamcrest', module: 'hamcrest-core'
}
compile 'com.android.support:multidex:1.0.0'
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
compile 'com.android.support:design:23.1.1'
compile 'com.google.gms:google-services:3.0.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'com.instamojo:android-sdk:1.2.4'
}
If i run the instamojo sdk in separate application means working perfectly.If i integrate with my app means getting above gradle error.
Please, anyone help to resolve.
Thanks in advance.
Error:Failed to resolve: in.juspay:godel:0.6.11.0823
From here or here
You should have an allprojects block, that contains some lines like this
// Add to build.gradle
repositories {
jcenter() // <-- should already be there
mavenCentral()
maven {
url "https://s3-ap-southeast-1.amazonaws.com/godel-release/godel/"
}
}
And in app/build.gradle
dependencies {
// compile 'in.juspay:godel:0.6.12.0823' // maybe need this?
compile 'com.instamojo:android-sdk:1.2.4'
// your other dependencies
...
...
}
Also, this line needs not to be there. compile 'com.google.gms:google-services:3.0.0' It should be in the classpath of the buildscript dependencies block.
And 'com.android.support:design:23.1.1' should use 23.2.0 to match the other Android support versions.
Regarding "Manifest merger failed", you can search to find something similar, and start with removing this line, because it's redundant with the other dependencies.
compile 'com.android.support:support-v4:23.2.0'
// Add to build.gradle
repositories {
jcenter() // <-- should already be there
mavenCentral()
maven {
url "https://s3-ap-southeast-1.amazonaws.com/godel-release/godel/"
}
}
then add this in your manifest file
<meta-data android:name="instamojo.orderauth.url"
android:value="ur website name/access_token.php"
/>
I'm working in an Android App and a few days ago I updated my Kotlin version from 1.0.0-beta-1103 to the release candidate 1.0.0-rc-1036 and now I can't run my app for something related to Kotlin Android Extensions.
I use the apply plugin: 'kotlin-android-extensions' just like the official blog says http://blog.jetbrains.com/kotlin/2016/02/kotlin-1-0-release-candidate-is-out/ but my app doesn't recognize any view from any layout.
This is what appears on the console:
Error:(20, 8) Unresolved reference: kotlinx
Error:Execution failed for task ':app:compileDebugKotlin'.
Compilation error. See log for more details
Please help me, I'm losing my mind!
Update:
This is my buildScript in globalbuild.gradle
buildscript {
ext {
kotlin_version = "1.0.0-rc-1036"
}
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// The Fabric Gradle plugin uses an open ended version to react
// quickly to Android tooling updates
classpath 'io.fabric.tools:gradle:1.+'
}
}
The dependencies listed in the app build.gradle
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// Google
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:cardview-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
compile 'com.android.support:recyclerview-v7:23.1.0'
// Kotlin
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
// Square
compile 'com.squareup.okio:okio:1.5.0'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0'
compile 'com.squareup.okhttp:okhttp:2.0.0'
compile 'com.squareup.picasso:picasso:2.5.2'
// ReactiveX
compile 'io.reactivex:rxjava:1.0.14'
compile 'io.reactivex:rxandroid:1.0.1'
compile 'com.jakewharton.rxbinding:rxbinding:0.3.0'
compile 'com.jakewharton.rxbinding:rxbinding-support-v4:0.2.0'
// DBFlow
kapt 'com.raizlabs.android:DBFlow-Compiler:2.2.1'
compile "com.raizlabs.android:DBFlow-Core:2.2.1"
compile "com.raizlabs.android:DBFlow:2.2.1"
// Otros
compile 'de.hdodenhof:circleimageview:1.3.0'
// SQLite Assets Helper
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:2.0.1'
// Crashlytics Kit
compile('com.crashlytics.sdk.android:crashlytics:2.5.2#aar') {
transitive = true
}
}
This is an import that I'm using:
import kotlinx.android.synthetic.main.activity_all_quizzes.*
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
should be defined in the project-local build.gradle file for now.
Your kotlin stdlib compile dependency should (at least while not stable) be the same as the kotlin android studio plugin version
...
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
...
buildscript {
ext.kotlin_version = '1.0.0-rc-1036'
...
I did everything I had in the instructions.
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE'
compile 'com.fasterxml.jackson.core:jackson-databind:2.3.2'
}
Error:Could not download artifact 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE:spring-android-rest-template.jar'
edited, did not work for me try this one, it's from the official docs
check here for more info
dependencies {
compile 'org.springframework.android:spring-android-rest-template:2.0.0.M1'
}
repositories {
maven {
url 'http://repo.spring.io/milestone'
}
}