I have JFrog Open Source installed on a server and upload an android aar library by hand.
In the gradle file, I set up a configuration like this.
buildscript {
dependencies { classpath "org.jfrog.buildinfo:build-info-extractor-gradle:latest.release" }
repositories {
maven {
credentials {
username = artifactory_username
password = artifactory_password
}
url "https://.../artifactory/libs-release"
}
}
}
allprojects{
apply plugin: org.jfrog.gradle.plugin.artifactory.ArtifactoryPlugin
artifactory {
resolve {
contextUrl = "https://.../artifactory"
repoKey = 'libs-global'
username = artifactory_username
password = artifactory_password
}
}
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:latest.release"
}
}
apply plugin: "com.jfrog.artifactory"
QUESTION:
How can download or implement my aar libary in the android project?
Example:
implementation 'com.google.code.gson:gson:2.8.6'
You need to add your Jfrog in build.gradle(project) like this:
allprojects {
repositories {
...
maven {
url("https://your-url.jfrog.com/more/path")
}
google()
jcenter()
...
}
}
Then you just add your dependency in dependencies.
Related
We have a React Native App and we have to download all the dependecies fo my App from the Company Nexus repository.
We have a maven gruop repository with lot of repository inside. One of them is a maven proxy repository that point to: https://plugins.gradle.org/m2/b
We configured our settings.grandle like this:
pluginManagement {
repositories {
maven { url 'URL_OF_NEXUS_GROUP_MAVEN_REPO' }
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
repositories {
maven { url 'URL_OF_NEXUS_GROUP_MAVEN_REPO' }
}
}
We are able to download all dependecies from our repo but we encounter only a problem during build and compile: one of our dependencies in package.json is react-native-keychain and it has this build.gradle:
buildscript {
repositories {
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'com.adarshr:gradle-test-logger-plugin:2.0.0'
}
}
apply plugin: 'com.android.library'
apply plugin: "com.adarshr.test-logger"
Why this setting is not overwritten like the others by our settings.gradle?
Thank you
I've solved deleting the changes in settings.gradle ad creating a init.gradle in HOME/.gradle with this contents:
allprojects {
ext.RepoConfigurator = {
maven {
url = uri('URL_OF_NEXUS_GROUP_MAVEN_REPO')
}
}
buildscript.repositories RepoConfigurator
repositories RepoConfigurator
}
apply plugin: EnterpriseRepositoryPlugin
class EnterpriseRepositoryPlugin implements Plugin<Gradle> {
void apply(Gradle gradle) {
gradle.settingsEvaluated { settings ->
settings.pluginManagement {
repositories {
maven { url 'URL_OF_NEXUS_GROUP_MAVEN_REPO' }
}
}
}
}
}
I do not understand what to do with this plugin, I have been suffering for an hour .. My version is android studio 7.0.2
here is the code
photoViewVersion = "2.3.0"
}
dependencies {
implementation "com.github.chrisbanes:PhotoView:$photoViewVersion"
}```
Make sure you have the following in the build.gradle(Project level)
allprojects {
repositories {
maven { url "https://www.jitpack.io" }
}
}
buildscript {
repositories {
maven { url "https://www.jitpack.io" }
}
}
Also try putting the dependency in the following manner in your gradle file (App level)
dependencies {
def photoViewVersion = "2.3.0"
implementation "com.github.chrisbanes:PhotoView:$photoViewVersion"
}
Try adding maven { url "https://jitpack.io" } to your top level gradle build file.
See: https://github.com/Lichenwei-Dev/ImagePicker/issues/1
I want to publish some subproject to maven by using maven-publish plugin. The current Gradle script looks like this.
apply plugin: 'maven-publish'
group "com.huawei.quickapp"
version "1.0-SNAPSHOT"
publishing {
publications {
publishTask(MavenPublication) {
}
}
repositories {
maven {
url = uri("${rootDir}/local_repo/repos/")
}
}
}
}
static Boolean publishIfNeeded(taskName){
println("name = " + taskName)
def list = ["baselibrary", "corelibrary"]
if (taskName in list) {
return true
}
return false
}
I just want two libraries,core and base to be published. When I submitted the code to the pipeline, the CI suggested that the NDK version did not match, but there was no NDK-related configuration in my code. The upgrade is necessary because only versions greater than 3.6 support the use of From Components.Debug or some other build variable in gradle script.I tried configuring the build script for Subproject separately like this:
buildscript {
ext.kotlin_version = "1.4.21"
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:3.5.3"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
subprojects {
buildscript {
ext.kotlin_version = "1.4.21"
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.1"
}
}
}
but it still not work. I got this error
Could not get unknown property 'Debug' for SoftwareComponentInternal set of type org.gradle.api.internal.component.DefaultSoftwareComponentContainer.
Is there a way to publish a submodule using the buildScripte of a submodule? thx.
I am trying to use Crashlytics in my app but keep getting an error saying
Error:(30, 1) A problem occurred evaluating root project 'CodeX_TeaXt'.
Could not find method buildscripts() for arguments [build_dujqhmp6npuv4v2dkd04dm37r$_run_closure3#30d25365] on root project 'CodeX_TeaXt' of type org.gradle.api.Project.
And here's my code for the build.gradle file :
allprojects {
repositories {
google()
jcenter()}
}
task clean(type: Delete) {
delete rootProject.build``Dir}
buildscripts{
repositories {
// ...
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
// ...
classpath 'io.fabric.tools:gradle:1.24.4'
}
}
And:
allprojects {
// ...
repositories {
// ...
maven {
url 'https://maven.google.com/'
}
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
dependencies {
// ...
compile('com.crashlytics.sdk.android:crashlytics:2.7.1#aar') {
transitive = true
}
compile 'com.google.firebase:firebase-core:11.6.2'
}
I am also having a problem using performance, test lab, so help
You should move:
maven {
url 'https://maven.google.com/'
}
from you app-level build.gradle to you project-level build.gradle based on the instructions in: https://firebase.google.com/docs/crashlytics/get-started
Consider the build.gradle below:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.0.0-b9'
}
}
apply plugin: 'org.javafxports.jfxmobile'
repositories {
jcenter()
}
mainClassName = 'com.rameses.Main'
jfxmobile {
android {
manifest = 'src/android/AndroidManifest.xml'
}
ios {
infoPList = file('src/ios/Default-Info.plist')
}
}
And I want to add a new dependency
dependencies {
compile files('libs/custom.jar')
}
QUESTION : How to merge two dependencies together? I tried something like the code below but it didn't worked, it throws an error. Any Idea?
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.0.0-b9',
compile files('libs/custom.jar')
}
Add a separate dependencies block to the build gradle like this -
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.0.0-b9'
}
}
apply plugin: 'org.javafxports.jfxmobile'
repositories {
jcenter()
}
mainClassName = 'com.rameses.Main'
jfxmobile {
android {
manifest = 'src/android/AndroidManifest.xml'
}
ios {
infoPList = file('src/ios/Default-Info.plist')
}
}
dependencies {
compile files('libs/custom.jar')
//other dependencies - go here
}