简体   繁体   中英

FAILURE: Build failed with an exception. Android Java

when I try to run the application, I encounter a long error as follows. How can I solve this?

Can you help me?

FAILURE: Build failed with an exception.

Executing tasks: [:app:assembleDebug] in project /Users/Developer/projectname

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:checkDebugDuplicateClasses'.

A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable Duplicate class androidx.collection.LruCache found in modules collection-1.1.0 (androidx.collection:collection:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.accessibilityservice.AccessibilityServiceInfoCompat found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.app.ActivityCompat found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.app.NavUtils found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.app.NotificationCompat found in modules core-1.3. 2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.app.NotificationCompat$Builder found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.app.ServiceCompat found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.app.ShareCompat found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.app.ShareCompat$IntentBuilder found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.app.ShareCompat$IntentReader found in modules core-1.3.2-runtime (androidx.c ore:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.app.TaskStackBuilder found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.content.IntentCompat found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.content.pm.ActivityInfoCompat found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.database.DatabaseUtilsCompat found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.os.ParcelableCompat found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jeti fied-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.os.ParcelableCompatCreatorCallbacks found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.util.DebugUtils found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.util.LogWriter found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.util.TimeUtils found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.view.AccessibilityDelegateCompat found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google .android:support-v4:r7) Duplicate class androidx.core.view.MenuCompat found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.view.MenuItemCompat found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.view.MotionEventCompat found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.view.VelocityTrackerCompat found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.view.ViewCompat found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate 88 398112195188 androidx.core.view.ViewConfigurationCompat found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.view.ViewGroupCompat found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.view.accessibility.AccessibilityEventCompat found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.view.accessibility.AccessibilityManagerCompat found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.view.accessibility.AccessibilityManagerCompat$AccessibilityStateChangeListenerCompat found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) a nd jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.view.accessibility.AccessibilityNodeInfoCompat found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.view.accessibility.AccessibilityRecordCompat found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.core.widget.EdgeEffectCompat found in modules core-1.3.2-runtime (androidx.core:core:1.3.2) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.cursoradapter.widget.CursorAdapter found in modules cursoradapter-1.0.0-runtime (androidx.cursoradapter:cursoradapter:1.0.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.cursoradapter.widget.CursorAdapter$Change Observer found in modules cursoradapter-1.0.0-runtime (androidx.cursoradapter:cursoradapter:1.0.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.cursoradapter.widget.CursorAdapter$MyDataSetObserver found in modules cursoradapter-1.0.0-runtime (androidx.cursoradapter:cursoradapter:1.0.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.cursoradapter.widget.CursorFilter found in modules cursoradapter-1.0.0-runtime (androidx.cursoradapter:cursoradapter:1.0.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.cursoradapter.widget.CursorFilter$CursorFilterClient found in modules cursoradapter-1.0.0-runtime (androidx.cursoradapter:cursoradapter:1.0.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.cursoradapter.widget.ResourceCursorAdapter found in modules cursoradapter-1.0.0 -runtime (androidx.cursoradapter:cursoradapter:1.0.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.cursoradapter.widget.SimpleCursorAdapter found in modules cursoradapter-1.0.0-runtime (androidx.cursoradapter:cursoradapter:1.0.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.cursoradapter.widget.SimpleCursorAdapter$CursorToStringConverter found in modules cursoradapter-1.0.0-runtime (androidx.cursoradapter:cursoradapter:1.0.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.cursoradapter.widget.SimpleCursorAdapter$ViewBinder found in modules cursoradapter-1.0.0-runtime (androidx.cursoradapter:cursoradapter:1.0.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.BackStackRecord found in modules fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) an d jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.BackStackState found in modules fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.BackStackState$1 found in modules fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.DialogFragment found in modules fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.Fragment found in modules fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.Fragment$InstantiationException found in modules fragment-1.1.0-ru ntime (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.Fragment$SavedState found in modules fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.Fragment$SavedState$1 found in modules fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.FragmentActivity found in modules fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.FragmentManager found in modules fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.Frag mentManager$BackStackEntry found in modules fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.FragmentManager$OnBackStackChangedListener found in modules fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.FragmentManagerImpl found in modules fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.FragmentManagerImpl$1 found in modules fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.FragmentManagerImpl$2 found in modules fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.FragmentManagerImpl$3 found in modules fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.FragmentManagerImpl$4 found in modules fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.FragmentManagerImpl$5 found in modules fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.FragmentManagerState found in modules fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.FragmentManagerState$1 found in modules fragment-1.1.0-runti me (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.FragmentPagerAdapter found in modules fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.FragmentState found in modules fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.FragmentState$1 found in modules fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.FragmentStatePagerAdapter found in modules fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.Fragm entTransaction found in modules fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.ListFragment found in modules fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.ListFragment$1 found in modules fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.ListFragment$2 found in modules fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.fragment.app.SuperNotCalledException found in modules fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) and jetified-support-v4-r7 (com.google.android:support-v4:r7) Duplicate class androidx.loader.app.LoaderManager found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and loader-1.0.0-runtime (androidx.loader:loader:1.0.0) Duplicate class androidx.loader.app.LoaderManager$LoaderCallbacks found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and loader-1.0.0-runtime (androidx.loader:loader:1.0.0) Duplicate class androidx.loader.app.LoaderManagerImpl found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and loader-1.0.0-runtime (androidx.loader:loader:1.0.0) Duplicate class androidx.loader.app.LoaderManagerImpl$LoaderInfo found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and loader-1.0.0-runtime (androidx.loader:loader:1.0.0) Duplicate class androidx.loader.content.AsyncTaskLoader found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and loader-1.0.0-runtime (androidx.loade r:loader:1.0.0) Duplicate class androidx.loader.content.AsyncTaskLoader$LoadTask found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and loader-1.0.0-runtime (androidx.loader:loader:1.0.0) Duplicate class androidx.loader.content.CursorLoader found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and loader-1.0.0-runtime (androidx.loader:loader:1.0.0) Duplicate class androidx.loader.content.Loader found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and loader-1.0.0-runtime (androidx.loader:loader:1.0.0) Duplicate class androidx.loader.content.Loader$ForceLoadContentObserver found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and loader-1.0.0-runtime (androidx.loader:loader:1.0.0) Duplicate class androidx.loader.content.Loader$OnLoadCompleteListener found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7 ) and loader-1.0.0-runtime (androidx.loader:loader:1.0.0) Duplicate class androidx.loader.content.ModernAsyncTask found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and loader-1.0.0-runtime (androidx.loader:loader:1.0.0) Duplicate class androidx.loader.content.ModernAsyncTask$1 found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and loader-1.0.0-runtime (androidx.loader:loader:1.0.0) Duplicate class androidx.loader.content.ModernAsyncTask$2 found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and loader-1.0.0-runtime (androidx.loader:loader:1.0.0) Duplicate class androidx.loader.content.ModernAsyncTask$3 found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and loader-1.0.0-runtime (androidx.loader:loader:1.0.0) Duplicate class androidx.loader.content.ModernAsyncTask$4 found in modules jetified-support-v4-r7 (com.google.88246 184094188:support-v4:r7) and loader-1.0.0-runtime (androidx.loader:loader:1.0.0) Duplicate class androidx.loader.content.ModernAsyncTask$AsyncTaskResult found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and loader-1.0.0-runtime (androidx.loader:loader:1.0.0) Duplicate class androidx.loader.content.ModernAsyncTask$InternalHandler found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and loader-1.0.0-runtime (androidx.loader:loader:1.0.0) Duplicate class androidx.loader.content.ModernAsyncTask$Status found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and loader-1.0.0-runtime (androidx.loader:loader:1.0.0) Duplicate class androidx.loader.content.ModernAsyncTask$WorkerRunnable found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and loader-1.0.0-runtime (androidx.loader:loader:1.0.0) Duplicate class androidx.localbroadcastmanag er.content.LocalBroadcastManager found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and localbroadcastmanager-1.0.0-runtime (androidx.localbroadcastmanager:localbroadcastmanager:1.0.0) Duplicate class androidx.localbroadcastmanager.content.LocalBroadcastManager$1 found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and localbroadcastmanager-1.0.0-runtime (androidx.localbroadcastmanager:localbroadcastmanager:1.0.0) Duplicate class androidx.localbroadcastmanager.content.LocalBroadcastManager$BroadcastRecord found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and localbroadcastmanager-1.0.0-runtime (androidx.localbroadcastmanager:localbroadcastmanager:1.0.0) Duplicate class androidx.localbroadcastmanager.content.LocalBroadcastManager$ReceiverRecord found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and localbroadcastmanager-1.0.0-runtime (andr oidx.localbroadcastmanager:localbroadcastmanager:1.0.0) Duplicate class androidx.viewpager.widget.PagerAdapter found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and viewpager-1.0.0-runtime (androidx.viewpager:viewpager:1.0.0) Duplicate class androidx.viewpager.widget.PagerTitleStrip found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and viewpager-1.0.0-runtime (androidx.viewpager:viewpager:1.0.0) Duplicate class androidx.viewpager.widget.PagerTitleStrip$PageListener found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and viewpager-1.0.0-runtime (androidx.viewpager:viewpager:1.0.0) Duplicate class androidx.viewpager.widget.ViewPager found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and viewpager-1.0.0-runtime (androidx.viewpager:viewpager:1.0.0) Duplicate class androidx.viewpager.widget.ViewPager$1 found in modules jeti fied-support-v4-r7 (com.google.android:support-v4:r7) and viewpager-1.0.0-runtime (androidx.viewpager:viewpager:1.0.0) Duplicate class androidx.viewpager.widget.ViewPager$2 found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and viewpager-1.0.0-runtime (androidx.viewpager:viewpager:1.0.0) Duplicate class androidx.viewpager.widget.ViewPager$ItemInfo found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and viewpager-1.0.0-runtime (androidx.viewpager:viewpager:1.0.0) Duplicate class androidx.viewpager.widget.ViewPager$LayoutParams found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and viewpager-1.0.0-runtime (androidx.viewpager:viewpager:1.0.0) Duplicate class androidx.viewpager.widget.ViewPager$OnAdapterChangeListener found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and viewpager-1.0.0-runtime (androidx.viewpager:viewpager:1 .0.0) Duplicate class androidx.viewpager.widget.ViewPager$OnPageChangeListener found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and viewpager-1.0.0-runtime (androidx.viewpager:viewpager:1.0.0) Duplicate class androidx.viewpager.widget.ViewPager$PagerObserver found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and viewpager-1.0.0-runtime (androidx.viewpager:viewpager:1.0.0) Duplicate class androidx.viewpager.widget.ViewPager$SavedState found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and viewpager-1.0.0-runtime (androidx.viewpager:viewpager:1.0.0) Duplicate class androidx.viewpager.widget.ViewPager$SavedState$1 found in modules jetified-support-v4-r7 (com.google.android:support-v4:r7) and viewpager-1.0.0-runtime (androidx.viewpager:viewpager:1.0.0) Duplicate class androidx.viewpager.widget.ViewPager$SimpleOnPageChangeListener found in module s jetified-support-v4-r7 (com.google.android:support-v4:r7) and viewpager-1.0.0-runtime (androidx.viewpager:viewpager:1.0.0)

 Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.
  • 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.5/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 9s 27 actionable tasks: 1 executed, 26 up-to-date

在此处输入图像描述

run:

在此处输入图像描述

build.gradle (app):

apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'

def keystorePropertiesFile = rootProject.file("keystore.properties")
// Initialize a new Properties() object called keystoreProperties.
def keystoreProperties = new Properties()
// Load your keystore.properties file into the keystoreProperties object.
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

android {
    signingConfigs {
        release {
            storeFile file(keystoreProperties['storeFile'])
            storePassword keystoreProperties['storePassword']
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
        }
    }
    compileSdkVersion 30
    buildToolsVersion '30.0.3'
    defaultConfig {
        applicationId "com.ligradyo.android"
        minSdkVersion 17
        targetSdkVersion 30
        versionCode 10
        versionName "1.1.0"
        multiDexEnabled true
        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
        manifestPlaceholders = [onesignal_app_id               : "4193dbe8-83d0-4d1c-8625-1cb42c2a37ae",
                                onesignal_google_project_number: "658644867384"]

        archivesBaseName = "ligradyo-$versionName"
    }
    sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/'] } }
    buildTypes {
        release {
            minifyEnabled false
            signingConfig signingConfigs.release
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')

    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation "androidx.core:core-ktx:1.3.2"
    implementation 'com.google.android.material:material:1.3.0'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.mcxiaoke.volley:library:1.0.19'
    implementation 'com.google.code.gson:gson:2.8.6'

    // Retrofit
    implementation 'com.squareup.retrofit2:retrofit:2.6.4'
    implementation 'com.squareup.retrofit2:converter-gson:2.6.4'

    //Glide
    implementation 'com.github.bumptech.glide:glide:4.12.0'
    kapt 'com.github.bumptech.glide:compiler:4.12.0'


    implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
    implementation 'com.viewpagerindicator:library:2.4.1'

    // Add the Firebase Crashlytics SDK.
    implementation platform("com.google.firebase:firebase-bom:26.8.0")
    implementation "com.google.firebase:firebase-crashlytics"
    implementation "com.google.firebase:firebase-analytics"
    implementation "com.google.firebase:firebase-auth"
    implementation 'com.google.firebase:firebase-messaging'
    implementation 'com.google.firebase:firebase-core'

    implementation 'com.google.android.gms:play-services-gcm:17.0.0'
    implementation 'com.google.android.gms:play-services-location:18.0.0'
    implementation 'com.google.android.gms:play-services-analytics:17.0.0'

    implementation 'com.onesignal:OneSignal:3.15.6'

    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

}

build.gradle (project)

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.4.32'
    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        maven { url 'https://plugins.gradle.org/m2/' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.3'
        classpath 'com.google.gms:google-services:4.3.5'
        classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.12.10'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        maven { url "http://dl.bintray.com/populov/maven" }
        maven { url "https://jitpack.io" }
        mavenCentral()
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

I created a new project and moved my existing activity and design pages, checked the pages and added the latest version of the required libraries to the project and was able to solve the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM