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
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 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 want to add the following library to the Gradle build of my project. The library that I want to add is : signal-protocol-java-2.8.1.jar that I have downloaded. How can I add it in the Gradle build, so that I import the classes included in the .jar it in the java classes that I am developing ?
Here is my build.gradle file :
buildscript {
repositories {
google()
mavenCentral()
jcenter {
content {
includeVersion 'org.jetbrains.trove4j', 'trove4j', '20160824'
includeGroupByRegex "com\\.archinamon.*"
}
}
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.14'
classpath "android.arch.navigation:navigation-safe-args-gradle-plugin:1.0.0-alpha09"
}
}
ext {
BUILD_TOOL_VERSION = '30.0.2'
COMPILE_SDK = 30
TARGET_SDK = 30
MINIMUM_SDK = 19
JAVA_VERSION = JavaVersion.VERSION_1_8
}
wrapper {
distributionType = Wrapper.DistributionType.ALL
}
allprojects {
repositories {
google()
jcenter()
}
}
subprojects {
ext.lib_signal_service_version_number = "2.15.3"
ext.lib_signal_service_group_info = "org.whispersystems"
ext.lib_signal_metadata_version = "0.1.2"
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
}
task qa {
group 'Verification'
description 'Quality Assurance. Run before pushing.'
dependsOn ':Signal-Android:testPlayProdReleaseUnitTest',
':Signal-Android:lintPlayProdRelease',
':libsignal-service:test',
':Signal-Android:assemblePlayProdDebug'
}
You have to edit your module-level build.gradle (the one you've posted is project-level). It's typically in the "app" folder of your project. Find there dependencies block and add this line:
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
...
}
Then create a folder "libs" near this gradle file and put your .jar library there. Sync the project with Gradle.
I want to use the #Preview annotation in my brand new Jetpack Compose for Desktop project. However gradle is just not getting it done to fetch the dependecy for that.
my build.gradle.kts:
import org.jetbrains.compose.compose
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
kotlin("jvm") version "1.4.0"
// __LATEST_COMPOSE_RELEASE_VERSION__
id("org.jetbrains.compose") version (System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION") ?: "0.1.0-build113")
}
repositories {
jcenter()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
buildscript {
repositories {
google()
}
dependencies {
classpath("androidx.ui:ui-tooling:1.0.0-alpha07")
}
}
dependencies {
implementation(compose.desktop.currentOs)
}
compose.desktop {
application {
mainClass = "MainKt"
nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "KotlinJvmComposeDesktopApplication"
}
}
}
It just is not being resolved
Accordingly to the documentation, it should be working for alpha07, but for alpha08 it changed to androidx.compose.ui:ui-tooling:1.0.0-alpha08, so, if you can upgrade to alpha08, you can see if it works.
https://developer.android.com/jetpack/androidx/releases/ui#declaring_dependencies
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.