尝试在build.gradle
(根)文件中使用以下配置运行旧项目。
build.gradle (根)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
// jcenter() //deprecated
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.1'
classpath 'me.tatarka:gradle-retrolambda:3.6.1'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
// classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' //getting error because of this error so commented
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
// maven { url "http://dl.bintray.com/populov/maven" } //getting error because of this error so commented
maven {url "https://maven.google.com"}
maven { url 'https://jitpack.io' }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
mavenCentral()
// jcenter() //deprecated
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle (app)
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 30
defaultConfig {
applicationId "com.package.name"
minSdkVersion 17
buildToolsVersion '30.0.3'
targetSdkVersion 30
versionCode 68
//versionName "9.1.2"
versionName "9.1.4"
multiDexEnabled true
// renderscriptTargetApi 17
// renderscriptSupportModeEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
//signingConfig signingConfigs.config
}
buildTypes {
debug {
minifyEnabled false
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
dexOptions {
javaMaxHeapSize "4g"
jumboMode = true
}
dataBinding {
enabled true
}
packagingOptions {
exclude 'META-INF/rxjava.properties'
exclude '.readme'
exclude 'LICENSE.txt'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/README.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/proguard/androidx-annotations.pro'
exclude 'META-INF/services/javax.annotation.processing.Processor'
exclude 'META-INF/MANIFEST.MF'
}
buildToolsVersion = '28.0.3'
productFlavors {
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.palette:palette:1.0.0'
// http://mvnrepository.com/artifact/com.android.support/customtabs
implementation 'androidx.browser:browser:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation files('libs/eSewaSdk.aar')
//debugging
implementation 'com.jakewharton.timber:timber:4.6.0'
//universal dimension for all devices
implementation 'com.intuit.sdp:sdp-android:1.0.3'
// compile 'com.google.firebase:firebase-crash:11.6.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
//AutoValue
compileOnly 'com.google.auto.value:auto-value:1.5'
annotationProcessor "com.google.auto.value:auto-value:1.5"
compileOnly 'com.ryanharter.auto.value:auto-value-gson:0.4.5'
implementation 'com.ryanharter.auto.value:auto-value-parcel-adapter:0.2.5'
annotationProcessor 'com.ryanharter.auto.value:auto-value-gson:0.4.5'
annotationProcessor 'com.ryanharter.auto.value:auto-value-parcel:0.2.5'
//GSON
implementation 'com.google.code.gson:gson:2.8.1'
implementation('com.fatboyindustrial.gson-jodatime-serialisers:gson-jodatime-serialisers:1.5.0') {
exclude group: "joda-time", module: "joda-time"
}
implementation 'net.danlew:android.joda:2.9.5.1'
//Network
implementation 'com.squareup.retrofit2:retrofit:2.2.0'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
// http://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp
// https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp
implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.6.0'
// http://mvnrepository.com/artifact/com.squareup.okhttp3/logging-interceptor
implementation 'com.squareup.okhttp3:logging-interceptor:3.6.0'
// https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp-urlconnection
// implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.12.0'
implementation 'com.facebook.stetho:stetho:1.5.0'
implementation 'com.facebook.stetho:stetho-okhttp3:1.5.0'
//rx java
implementation 'io.reactivex.rxjava2:rxjava:2.0.7'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'com.jakewharton.rxbinding2:rxbinding:2.0.0'
implementation 'com.jakewharton.rxrelay2:rxrelay:2.0.0'
// http://mvnrepository.com/artifact/com.github.pwittchen/reactivenetwork-rx2
implementation 'com.github.pwittchen:reactivenetwork-rx2:2.1.0'
//dagger setup
implementation 'com.google.dagger:dagger:2.9'
annotationProcessor 'com.google.dagger:dagger-compiler:2.9'
//Butterknife
implementation 'com.jakewharton:butterknife:10.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'
/*firebase*/
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-config:16.1.2'
implementation 'com.google.firebase:firebase-dynamic-links:17.0.0'
//implementation 'com.nineoldandroids:library:2.4.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.nineoldandroids:library:2.4.0'
// implementation 'com.github.aakira:expandable-layout:1.4.2@aar'
implementation 'com.github.travijuu:numberpicker:1.0.7'
/*sqlite debugging*/
// debugImplementation 'im.dino:dbinspector:3.4.1@aar'
/*for mulriddex enabled*/
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'com.ramotion.paperonboarding:paper-onboarding:1.1.1'
implementation 'com.squareup.sqlbrite2:sqlbrite:2.0.0'
/*scanner*/
implementation 'me.dm7.barcodescanner:zxing:1.9.8'
/*google play services*/
implementation 'com.google.maps.android:android-maps-utils:0.4+'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.android.gms:play-services-places:16.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-vision:16.2.0'
// http://mvnrepository.com/artifact/com.google.android.gms/play-services-auth
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.google.android.gms:play-services-auth-api-phone:17.1.0'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
implementation 'com.google.android.gms:play-services-base:17.0.0'
//Dependencies for the REST API example
implementation 'com.google.api-client:google-api-client:1.22.0'
implementation 'com.google.api-client:google-api-client-android:1.22.0'
implementation 'com.google.apis:google-api-services-people:v1-rev139-1.22.0'
/*search view*/
implementation 'com.thoughtbot:expandablerecyclerview:1.0'
// implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:8.0.1'
/*glide*/
implementation 'com.github.bumptech.glide:glide:4.7.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
implementation 'com.github.firdausmaulan:GlideSlider:1.3.2'
implementation 'org.apache.commons:commons-lang3:3.8'
implementation 'org.michaelbel:bottomsheet:1.2.3'
implementation 'com.mindorks.android:prdownloader:0.4.0'
implementation 'com.github.thijsk:TouchImageView:v1.3.1'
implementation 'com.facebook.android:facebook-login:[4,5)'
//timer
implementation 'com.github.iwgang:countdownview:2.1.6'
/*notification badger*/
/*color ful toast*/
implementation 'com.github.GrenderG:Toasty:1.3.0'
implementation 'com.github.miguelbcr:RxPaparazzo:0.6.0-2.x'
implementation 'com.github.javiersantos:AppUpdater:2.7'
implementation 'com.github.scottyab:showhidepasswordedittext:0.8'
//pinview
implementation 'com.chaos.view:pinview:1.4.2'
/*Progressbar*/
implementation 'com.budiyev.android:circular-progress-bar:1.2.1'
implementation 'androidx.palette:palette:1.0.0'
// required for deeplink (branch.io)
implementation 'io.branch.sdk.android:library:3.+'
// https://mvnrepository.com/artifact/commons-io/commons-io
implementation group: 'commons-io', name: 'commons-io', version: '2.6'
implementation 'com.github.Jay-Goo:RangeSeekBar:v2.0.4'
//map
implementation 'com.patloew.rxlocation:rxlocation:1.0.5'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.github.traex.expandablelayout:library:1.2.2'
implementation 'com.github.aakira:expandable-layout:1.6.0@aar'
implementation 'com.hanks:htextview-typer:0.1.6'
// implementation 'com.willowtreeapps.spruce:spruce-android:1.0.1'
/*must be removed on relese*/
implementation 'com.instabug.library:instabug:8.0.13'
/*firebase*/
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-config:16.1.2'
implementation 'com.google.firebase:firebase-dynamic-links:17.0.0'
implementation 'com.google.firebase:firebase-invites:10.0.1'
//gif image
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.17'
implementation 'com.github.aakira:expandable-layout:1.6.0@aar'
//badge
implementation "me.leolin:ShortcutBadger:1.1.22@aar"
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.19'
implementation 'com.github.ApendIr:slider:1.0'
implementation 'com.github.ksoichiro:android-observablescrollview:1.5.0'
implementation 'com.squareup.picasso:picasso:2.71828'
}
Got错误:
1:Could not GET 'http://dl.bintray.com/populov/maven/com/google/maps/android/android-maps-utils/maven-metadata.xml'
Received status code 502 from server: Bad Gateway
2:Could not resolve com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3
我明白了,因为jcenter()
关闭了,我需要使用mavenCentral()
并找到过时包的替代品。我试着用mavenCentral()
代替。并试图寻找其他选择,但却无法..。尝试与注释,这些错误提供回复,但仍然不能获取我所需的依赖关系。
参考Android : Gradle同步失败:无法引导“.”。从服务器接收状态代码502 :坏网关
mavenCentral()、jCenter()和mavenLocal()之间的差异?
任何关于迁移、包替换或快速修复的建议都会有很大的帮助。谢谢。
全堆栈跟踪
Executing tasks: [:app:assembleDebug] in project /Users/nabrajkhadka/OfficeProjects/Native-Android/android-master
> Configure project :app
AGPBI: {"kind":"warning","text":"DSL element 'android.dataBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.dataBinding'.\nIt will be removed in version 7.0 of the Android Gradle plugin.","sources":[{}]}
AGPBI: {"kind":"warning","text":"The specified Android SDK Build Tools version (28.0.3) is ignored, as it is below the minimum supported version (30.0.2) for Android Gradle Plugin 4.2.2.\nAndroid SDK Build Tools 30.0.2 will be used.\nTo suppress this warning, remove \"buildToolsVersion '28.0.3'\" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.","sources":[{}]}
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :app:compileDebugAidl NO-SOURCE
> Task :app:compileDebugRenderscript NO-SOURCE
> Task :app:dataBindingMergeDependencyArtifactsDebug FAILED
> Task :app:dataBindingMergeGenClassesDebug UP-TO-DATE
> Task :app:generateDebugResValues UP-TO-DATE
> Task :app:generateDebugResources UP-TO-DATE
> Task :app:processDebugGoogleServices UP-TO-DATE
> Task :app:mergeDebugResources FAILED
> Task :app:dataBindingTriggerDebug UP-TO-DATE
> Task :app:generateDebugBuildConfig UP-TO-DATE
> Task :app:javaPreCompileDebug UP-TO-DATE
> Task :app:checkDebugAarMetadata FAILED
> Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
> Task :app:extractDeepLinksDebug UP-TO-DATE
> Task :app:processDebugMainManifest FAILED
> Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
> Task :app:mergeDebugShaders UP-TO-DATE
> Task :app:compileDebugShaders NO-SOURCE
> Task :app:generateDebugAssets UP-TO-DATE
> Task :app:mergeDebugAssets FAILED
> Task :app:processDebugJavaRes NO-SOURCE
> Task :app:checkDebugDuplicateClasses FAILED
> Task :app:desugarDebugFileDependencies FAILED
> Task :app:mergeDebugJniLibFolders UP-TO-DATE
> Task :app:mergeDebugNativeLibs FAILED
> Task :app:validateSigningDebug UP-TO-DATE
> Task :app:writeDebugAppMetadata UP-TO-DATE
> Task :app:writeDebugSigningConfigVersions UP-TO-DATE
FAILURE: Build completed with 8 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:dataBindingMergeDependencyArtifactsDebug'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not resolve com.google.maps.android:android-maps-utils:0.4+.
Required by:
project :app
> Failed to list versions for com.google.maps.android:android-maps-utils.
> Unable to load Maven meta-data from http://dl.bintray.com/populov/maven/com/google/maps/android/android-maps-utils/maven-metadata.xml.
> Could not get resource 'http://dl.bintray.com/populov/maven/com/google/maps/android/android-maps-utils/maven-metadata.xml'.
> Could not GET 'http://dl.bintray.com/populov/maven/com/google/maps/android/android-maps-utils/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not resolve com.google.maps.android:android-maps-utils:0.4+.
Required by:
project :app
> Failed to list versions for com.google.maps.android:android-maps-utils.
> Unable to load Maven meta-data from http://dl.bintray.com/populov/maven/com/google/maps/android/android-maps-utils/maven-metadata.xml.
> Could not get resource 'http://dl.bintray.com/populov/maven/com/google/maps/android/android-maps-utils/maven-metadata.xml'.
> Could not GET 'http://dl.bintray.com/populov/maven/com/google/maps/android/android-maps-utils/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
3: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not resolve com.google.maps.android:android-maps-utils:0.4+.
Required by:
project :app
> Failed to list versions for com.google.maps.android:android-maps-utils.
> Unable to load Maven meta-data from http://dl.bintray.com/populov/maven/com/google/maps/android/android-maps-utils/maven-metadata.xml.
> Could not get resource 'http://dl.bintray.com/populov/maven/com/google/maps/android/android-maps-utils/maven-metadata.xml'.
> Could not GET 'http://dl.bintray.com/populov/maven/com/google/maps/android/android-maps-utils/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
4: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not resolve com.google.maps.android:android-maps-utils:0.4+.
Required by:
project :app
> Failed to list versions for com.google.maps.android:android-maps-utils.
> Unable to load Maven meta-data from http://dl.bintray.com/populov/maven/com/google/maps/android/android-maps-utils/maven-metadata.xml.
> Could not get resource 'http://dl.bintray.com/populov/maven/com/google/maps/android/android-maps-utils/maven-metadata.xml'.
> Could not GET 'http://dl.bintray.com/populov/maven/com/google/maps/android/android-maps-utils/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
5: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeDebugAssets'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not resolve com.google.maps.android:android-maps-utils:0.4+.
Required by:
project :app
> Failed to list versions for com.google.maps.android:android-maps-utils.
> Unable to load Maven meta-data from http://dl.bintray.com/populov/maven/com/google/maps/android/android-maps-utils/maven-metadata.xml.
> Could not get resource 'http://dl.bintray.com/populov/maven/com/google/maps/android/android-maps-utils/maven-metadata.xml'.
> Could not GET 'http://dl.bintray.com/populov/maven/com/google/maps/android/android-maps-utils/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
6: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not resolve com.google.maps.android:android-maps-utils:0.4+.
Required by:
project :app
> Failed to list versions for com.google.maps.android:android-maps-utils.
> Unable to load Maven meta-data from http://dl.bintray.com/populov/maven/com/google/maps/android/android-maps-utils/maven-metadata.xml.
> Could not get resource 'http://dl.bintray.com/populov/maven/com/google/maps/android/android-maps-utils/maven-metadata.xml'.
> Could not GET 'http://dl.bintray.com/populov/maven/com/google/maps/android/android-maps-utils/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
7: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:desugarDebugFileDependencies'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not resolve com.google.maps.android:android-maps-utils:0.4+.
Required by:
project :app
> Failed to list versions for com.google.maps.android:android-maps-utils.
> Unable to load Maven meta-data from http://dl.bintray.com/populov/maven/com/google/maps/android/android-maps-utils/maven-metadata.xml.
> Could not get resource 'http://dl.bintray.com/populov/maven/com/google/maps/android/android-maps-utils/maven-metadata.xml'.
> Could not GET 'http://dl.bintray.com/populov/maven/com/google/maps/android/android-maps-utils/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
8: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not resolve com.google.maps.android:android-maps-utils:0.4+.
Required by:
project :app
> Failed to list versions for com.google.maps.android:android-maps-utils.
> Unable to load Maven meta-data from http://dl.bintray.com/populov/maven/com/google/maps/android/android-maps-utils/maven-metadata.xml.
> Could not get resource 'http://dl.bintray.com/populov/maven/com/google/maps/android/android-maps-utils/maven-metadata.xml'.
> Could not GET 'http://dl.bintray.com/populov/maven/com/google/maps/android/android-maps-utils/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 26s
21 actionable tasks: 8 executed, 13 up-to-date
发布于 2022-04-01 19:21:04
如果您转到缺少的库的Github页面,您会发现它只能通过jcenter
获得,而且由于jcenter
是down,所以您需要克隆这个库并自己构建它,并将它放到类路径中。
https://stackoverflow.com/questions/71583997
复制相似问题