繁体   English   中英

失败:构建失败,出现异常。 Android Java

[英]FAILURE: Build failed with an exception. Android Java

当我尝试运行该应用程序时,我遇到了一个很长的错误,如下所示。 我该如何解决这个问题?

你能帮助我吗?

失败:构建失败,出现异常。

执行任务:[:app:assembleDebug] 在项目 /Users/Developer/projectname

失败:构建失败,出现异常。

  • 出了什么问题:任务 ':app:checkDebugDuplicateClasses' 执行失败。

执行 com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable 时发生故障 复制 class androidx.collection.LruCache 在模块 collection-1.1.0 (androidx.collection:collection:1.1.0v) 和 jetified-support-7 .google.android:support-v4:r7) 在模块 core-1.3.2-runtime (androidx.core:core:1.3.2) 和 jetified-support-v4-r7 ( com.google.android:support-v4:r7) 在模块 core-1.3.2-runtime (androidx.core:core:1.3.2) 和 jetified-support-v4-r7 中找到重复的 class androidx.core.app.ActivityCompat (com.google.android:support-v4:r7) 在模块 core-1.3.2-runtime (androidx.core:core:1.3.2) 和 jetified-support-v4- 中找到重复的 class androidx.core.app.NavUtils r7 (com.google.android:support-v4:r7) 在模块 core-1.3 中找到重复的 class androidx.core.app.NotificationCompat。 2-runtime (androidx.core:core:1.3.2) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 在核心模块中找到重复的 class androidx.core.app.NotificationCompat$Builder -1.3.2-runtime (androidx.core:core:1.3.2) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 在模块中找到重复的 class androidx.core.app.ServiceCompat core-1.3.2-runtime (androidx.core:core:1.3.2) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 重复 class androidx.core.app.ShareCompat 找到模块 core-1.3.2-runtime (androidx.core:core:1.3.2) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 重复 class androidx.core.app.ShareCompat$ IntentBuilder 在模块 core-1.3.2-runtime (androidx.core:core:1.3.2) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 中找到重复 class androidx.core.app .ShareCompat$IntentReader 在模块 core-1.3.2-runtime (androidx.c ore:core:1.3.2) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 在模块 core-1.3.2-runtime (androidx .core:core:1.3.2) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 在模块 core-1.3.2-runtime ( androidx.core:core:1.3.2) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 重复 class androidx.core.content.pm.ActivityInfoCompat 在模块 core-1.3.2 中找到-runtime (androidx.core:core:1.3.2) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 在模块 core-1.3 中找到重复的 class androidx.core.database.DatabaseUtilsCompat。 2-runtime (androidx.core:core:1.3.2) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 在模块 core-1.3 中找到重复的 class androidx.core.os.ParcelableCompat .2-runtime (androidx.core:core:1.3.2) 和 jeti fied-support-v4-r7 (com.google.android:support-v4:r7) 在模块 core-1.3.2-runtime (androidx.core:core:1.3.2) 中找到重复的 class androidx.core.os.ParcelableCompatCreatorCallbacks和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 在模块 core-1.3.2-runtime (androidx.core:core:1.3.2) 中找到重复的 class androidx.core.util.DebugUtils ) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 在模块 core-1.3.2-runtime (androidx.core:core:1.3. 2) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 在模块 core-1.3.2-runtime (androidx.core:core:1.3) 中找到重复的 class androidx.core.util.TimeUtils .2) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 在模块 core-1.3.2-runtime (androidx.core:core: 1.3.2) 和 jetified-support-v4-r7 (com.google .android:support-v4:r7) 在模块 core-1.3.2-runtime (androidx.core:core:1.3.2) 和 jetified-support-v4-r7 (com. google.android:support-v4:r7) 在模块 core-1.3.2-runtime (androidx.core:core:1.3.2) 和 jetified-support-v4-r7 (com .google.android:support-v4:r7) 在模块 core-1.3.2-runtime (androidx.core:core:1.3.2) 和 jetified-support-v4-r7 ( com.google.android:support-v4:r7) 在模块 core-1.3.2-runtime (androidx.core:core:1.3.2) 和 jetified-support-v4-r7 中找到重复的 class androidx.core.view.VelocityTrackerCompat (com.google.android:support-v4:r7) 在模块 core-1.3.2-runtime (androidx.core:core:1.3.2) 和 jetified-support-v4- 中找到重复的 class androidx.core.view.ViewCompat r7 (com.google.android:support-v4:r7) 重复 88 398112195188 androidx.core.view.ViewConfigurationCompat 在模块 core-1.3.2-runtime (androidx.core:core:1.3.2) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 中找到在模块 core-1.3.2-runtime (androidx.core:core:1.3.2) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 中找到重复的 class androidx.core.view.ViewGroupCompat ) 在模块 core-1.3.2-runtime (androidx.core:core:1.3.2) 和 jetified-support-v4-r7 (com.google.android:support- v4:r7) 在模块 core-1.3.2-runtime (androidx.core:core:1.3.2) 和 jetified-support-v4-r7 (com.google.android) 中找到重复的 class androidx.core.view.accessibility.AccessibilityManagerCompat :support-v4:r7) 在模块 core-1.3.2-runtime (androidx.core:core:1.3.2) 中找到重复的 class androidx.core.view.accessibility.AccessibilityManagerCompat$AccessibilityStateChangeListenerCompat nd jetified-support-v4-r7 (com.google.android:support-v4:r7) 重复 class androidx.core.view.accessibility.AccessibilityNodeInfoCompat 在模块 core-1.3.2-runtime (androidx.core:core:1.3 .2) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 在模块 core-1.3.2-runtime (androidx.core: core:1.3.2) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 在模块 core-1.3.2-runtime (androidx.core :core:1.3.2) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 在模块 cursoradapter-1.0.0-runtime (androidx. cursoradapter:cursoradapter:1.0.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 复制 class androidx.cursoradapter.widget.CursorAdapter$Change 在模块 cursoradapter-1.0.0-runtime (androidx.cursoradapter:cursoradapter:1.0.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 中发现的观察者重复 class androidx.cursoradapter.widget .CursorAdapter$MyDataSetObserver 在模块 cursoradapter-1.0.0-runtime (androidx.cursoradapter:cursoradapter:1.0.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 中找到重复 class androidx. cursoradapter.widget.CursorFilter 在模块 cursoradapter-1.0.0-runtime (androidx.cursoradapter:cursoradapter:1.0.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 中找到重复 class androidx .cursoradapter.widget.CursorFilter$CursorFilterClient 在模块 cursoradapter-1.0.0-runtime (androidx.cursoradapter:cursoradapter:1.0.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 中找到在模块 cursoradapter-1.0.0 中找到重复的 class androidx.cursoradapter.widget.ResourceCursorAdapter -runtime (androidx.cursoradapter:cursoradapter:1.0.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 重复 class androidx.cursoradapter.widget.SimpleCursorAdapter 在模块 cursoradapter-1.0 中找到。 0 运行时 (androidx.cursoradapter:cursoradapter:1.0.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 重复 class androidx.cursoradapter.widget.SimpleCursorAdapter$CursorToStringConverter 在模块 cursoradapter 中找到-1.0.0-runtime (androidx.cursoradapter:cursoradapter:1.0.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 找到重复的 class androidx.cursoradapter.widget.SimpleCursorAdapter$ViewBinder在模块 cursoradapter-1.0.0-runtime (androidx.cursoradapter:cursoradapter:1.0.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 重复 class androidx.fragment.app.BackStackRecord在模块 fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) 中找到 d jetified-support-v4-r7 (com.google.android:support-v4:r7) 在模块 fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) 中找到重复的 class androidx.fragment.app.BackStackState ) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 在模块 fragment-1.1.0-runtime (androidx.fragment:fragment:1.1) 中找到重复的 class androidx.fragment.app.BackStackState$1 .0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 在模块 fragment-1.1.0-runtime (androidx.fragment:fragment: 1.1.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 重复 class androidx.fragment.app.Fragment 在模块 fragment-1.1.0-runtime (androidx.fragment:fragment :1.1.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 重复 class androidx.fragment.app.Fragment$InstantiationException 在模块 fragment-1.1.0-ru 中找到 ntime (androidx.fragment:fragment:1.1.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 重复 class androidx.fragment.app.Fragment$SavedState 在模块 fragment-1.1 中找到.0-runtime (androidx.fragment:fragment:1.1.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 重复 class androidx.fragment.app.Fragment$SavedState$1 在模块 fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 找到重复的 class androidx.fragment.app.FragmentActivity在模块 fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 重复 class androidx.fragment.app.FragmentManager在模块 fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 中找到重复的 class androidx.fragment.app。碎片在模块 fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 中找到 mentManager$BackStackEntry 重复 class androidx.fragment .app.FragmentManager$OnBackStackChangedListener 在模块 fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 中找到重复 class在模块 fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 中找到的 androidx.fragment.app.FragmentManagerImpl 重复class androidx.fragment.app.FragmentManagerImpl$1 在模块 fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 中找到) 在模块 fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) 和 jetified-support-v4-r7 中找到重复的 class androidx.fragment.app.FragmentManagerImpl$2 (com.google.android:support-v4:r7) 在模块 fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) 和 jetified-support-v4 中找到重复的 class androidx.fragment.app.FragmentManagerImpl$3 -r7 (com.google.android:support-v4:r7) 在模块 fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) 和 jetified-support 中找到重复的 class androidx.fragment.app.FragmentManagerImpl$4 -v4-r7 (com.google.android:support-v4:r7) 在模块 fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) 和 jetified 中找到重复的 class androidx.fragment.app.FragmentManagerImpl$5 -support-v4-r7 (com.google.android:support-v4:r7) 重复 class androidx.fragment.app.FragmentManagerState 在模块 fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) 和jetified-support-v4-r7 (com.google.android:support-v4:r7) 在模块 fragment-1.1.0-runti 中找到重复的 class androidx.fragment.app.FragmentManagerState$1 我 (androidx.fragment:fragment:1.1.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 在模块 fragment-1.1.0 中找到重复的 class androidx.fragment.app.FragmentPagerAdapter -runtime (androidx.fragment:fragment:1.1.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 在模块 fragment-1.1 中找到重复的 class androidx.fragment.app.FragmentState。 0-runtime (androidx.fragment:fragment:1.1.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 在模块 fragment- 中找到重复的 class androidx.fragment.app.FragmentState$1 1.1.0-runtime (androidx.fragment:fragment:1.1.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 在模块片段中找到重复的 class androidx.fragment.app.FragmentStatePagerAdapter -1.1.0-runtime (androidx.fragment:fragment:1.1.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 重复 class androidx.fragment.app.Fragm entTransaction 在模块 fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 中找到重复 class androidx.fragment.app .ListFragment 在模块 fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 中找到重复的 class androidx.fragment。 app.ListFragment$1 在模块 fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 中找到重复的 class androidx。 fragment.app.ListFragment$2 在模块 fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 中找到重复 class在模块 fragment-1.1.0-runtime (androidx.fragment:fragment:1.1.0) 和 jetified-support-v4-r7 (com.google.android:support-v4:r7) 中发现 androidx.fragment.app.SuperNotCalledException 重复 class androidx.loader.app.LoaderManager 在模块 jetified-support-v4-r7 (com.google.android:support-v4:r7) 和 loader-1.0.0-runtime (androidx.loader:loader:1.0.0) 中找到在模块 jetified-support-v4-r7 (com.google.android:support-v4:r7) 和 loader-1.0.0-runtime (androidx.loader:loader:1.0) 中找到重复的 class androidx.loader.app.LoaderManager$LoaderCallbacks .0) 在模块 jetified-support-v4-r7 (com.google.android:support-v4:r7) 和 loader-1.0.0-runtime (androidx.loader:loader: 1.0.0)重复 class androidx.loader.app.LoaderManagerImpl$LoaderInfo 在模块 jetified-support-v4-r7 (com.google.android:support-v4:r7) 和 loader-1.0.0-runtime (androidx.loader :loader:1.0.0) 在模块 jetified-support-v4-r7 (com.google.android:support-v4:r7) 和 loader-1.0.0-runtime (androidx.加载 r:loader:1.0.0) 在模块 jetified-support-v4-r7 (com.google.android:support-v4:r7) 和 loader-1.0.0-runtime 中找到重复的 class androidx.loader.content.AsyncTaskLoader$LoadTask (androidx.loader:loader:1.0.0) 在模块 jetified-support-v4-r7 (com.google.android:support-v4:r7) 和 loader-1.0.0- 中找到重复的 class androidx.loader.content.CursorLoader runtime (androidx.loader:loader:1.0.0) 在模块 jetified-support-v4-r7 (com.google.android:support-v4:r7) 和 loader-1.0.0 中找到重复的 class androidx.loader.content.Loader -runtime (androidx.loader:loader:1.0.0) 在模块 jetified-support-v4-r7 (com.google.android:support-v4:r7) 和 loader- 中找到重复的 class androidx.loader.content.Loader$ForceLoadContentObserver 1.0.0-runtime (androidx.loader:loader:1.0.0) 在模块 jetified-support-v4-r7 (com.google.android:support-v4:r7 ) 和 loader-1.0.0-runtime (androidx.loader:loader:1.0.0) 在模块 jetified-support-v4-r7 (com.google.android:support-v4: r7) 和 loader-1.0.0-runtime (androidx.loader:loader:1.0.0) 在模块 jetified-support-v4-r7 (com.google.android:support- v4:r7) 和 loader-1.0.0-runtime (androidx.loader:loader:1.0.0) 在模块 jetified-support-v4-r7 (com.google.android: support-v4:r7) 和 loader-1.0.0-runtime (androidx.loader:loader:1.0.0) 在模块 jetified-support-v4-r7 (com.google. android:support-v4:r7) 和 loader-1.0.0-runtime (androidx.loader:loader:1.0.0) 在模块 jetified-support-v4-r7 (com.谷歌.88246 184094188:support-v4:r7) 和 loader-1.0.0-runtime (androidx.loader:loader:1.0.0) 在模块 jetified-support-v4-r7 (com .google.android:support-v4:r7) 和 loader-1.0.0-runtime (androidx.loader:loader:1.0.0) 重复 class androidx.loader.content.ModernAsyncTask$InternalHandler 在模块 jetified-support-v4- 中找到r7 (com.google.android:support-v4:r7) 和 loader-1.0.0-runtime (androidx.loader:loader:1.0.0) 重复 class androidx.loader.content.ModernAsyncTask$Status 在模块 jetified-support 中找到-v4-r7 (com.google.android:support-v4:r7) 和 loader-1.0.0-runtime (androidx.loader:loader:1.0.0) 在模块中找到重复的 class androidx.loader.content.ModernAsyncTask$WorkerRunnable jetified-support-v4-r7 (com.google.android:support-v4:r7) 和 loader-1.0.0-runtime (androidx.loader:loader:1.0.0) 重复 class androidx.localbroadcastmanag er.content.LocalBroadcastManager 在模块 jetified-support-v4-r7 (com.google.android:support-v4:r7) 和 localbroadcastmanager-1.0.0-runtime (androidx.localbroadcastmanager:localbroadcastmanager:1.0.0) 中找到重复 class androidx .localbroadcastmanager.content.LocalBroadcastManager$1 在模块 jetified-support-v4-r7 (com.google.android:support-v4:r7) 和 localbroadcastmanager-1.0.0-runtime (androidx.localbroadcastmanager:localbroadcastmanager:1.0.0) 中找到重复class 在模块 jetified-support-v4-r7 (com.google.android:support-v4:r7) 和 localbroadcastmanager-1.0.0-runtime (androidx.localbroadcastmanager:localbroadcastmanager:1.0. 0) 在模块 jetified-support-v4-r7 (com.google.android:support-v4:r7) 和 localbroadcastmanager-1.0.0-runtime (andr) oidx.localbroadcastmanager:localbroadcastmanager:1.0.0) 在模块 jetified-support-v4-r7 (com.google.android:support-v4:r7) 和 viewpager-1.0.0-runtime 中找到重复的 class androidx.viewpager.widget.PagerAdapter (androidx.viewpager:viewpager:1.0.0) 在模块 jetified-support-v4-r7 (com.google.android:support-v4:r7) 和 viewpager-1.0.0- 中找到重复的 class androidx.viewpager.widget.PagerTitleStrip运行时 (androidx.viewpager:viewpager:1.0.0) 在模块 jetified-support-v4-r7 (com.google.android:support-v4:r7) 和 viewpager-1.0 中找到重复的 class androidx.viewpager.widget.PagerTitleStrip$PageListener .0-runtime (androidx.viewpager:viewpager:1.0.0) 在模块 jetified-support-v4-r7 (com.google.android:support-v4:r7) 和 viewpager- 中找到重复的 class androidx.viewpager.widget.ViewPager 1.0.0-runtime (androidx.viewpager:viewpager:1.0.0) 在模块 jeti 中找到重复的 class androidx.viewpager.widget.ViewPager$1 fied-support-v4-r7 (com.google.android:support-v4:r7) 和 viewpager-1.0.0-runtime (androidx.viewpager:viewpager:1.0.0) 找到重复的 class androidx.viewpager.widget.ViewPager$2在模块 jetified-support-v4-r7 (com.google.android:support-v4:r7) 和 viewpager-1.0.0-runtime (androidx.viewpager:viewpager:1.0.0) 重复 class androidx.viewpager.widget.ViewPager $ItemInfo 在模块 jetified-support-v4-r7 (com.google.android:support-v4:r7) 和 viewpager-1.0.0-runtime (androidx.viewpager:viewpager:1.0.0) 中找到重复的 class androidx.viewpager。 widget.ViewPager$LayoutParams 在模块 jetified-support-v4-r7 (com.google.android:support-v4:r7) 和 viewpager-1.0.0-runtime (androidx.viewpager:viewpager:1.0.0) 中找到重复 class androidx .viewpager.widget.ViewPager$OnAdapterChangeListener 在模块 jetified-support-v4-r7 (com.google.android:support-v4:r7) 和 viewpager-1.0.0-runtime (androidx.viewpager:viewpager:1) 中找到 .0.0) 在模块 jetified-support-v4-r7 (com.google.android:support-v4:r7) 和 viewpager-1.0.0-runtime (androidx.viewpager: viewpager:1.0.0) 在模块 jetified-support-v4-r7 (com.google.android:support-v4:r7) 和 viewpager-1.0.0-runtime (androidx .viewpager:viewpager:1.0.0) 在模块 jetified-support-v4-r7 (com.google.android:support-v4:r7) 和 viewpager-1.0.0- 中找到重复的 class androidx.viewpager.widget.ViewPager$SavedState运行时 (androidx.viewpager:viewpager:1.0.0) 在模块 jetified-support-v4-r7 (com.google.android:support-v4:r7) 和 viewpager- 中找到重复的 class androidx.viewpager.widget.ViewPager$SavedState$1 1.0.0-runtime (androidx.viewpager:viewpager:1.0.0) 在模块中找到重复的 class androidx.viewpager.widget.ViewPager$SimpleOnPageChangeListener s jetified-support-v4-r7 (com.google.android:support-v4:r7) 和 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>.
  • 尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。 使用 --info 或 --debug 选项运行以获取更多日志 output。使用 --scan 运行以获取完整的见解。

  • https://help.gradle.org获得更多帮助

此版本中使用了已弃用的 Gradle 功能,使其与 Gradle 7.0 不兼容。 使用“--warning-mode all”来显示各个弃用警告。 请参阅https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings

在 9 秒内构建失败 27 个可操作任务:1 个已执行,26 个是最新的

在此处输入图像描述

跑步:

在此处输入图像描述

build.gradle(应用):

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(项目)

// 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
}

我创建了一个新项目并移动了我现有的活动和设计页面,检查了页面并将所需库的最新版本添加到项目中并能够解决问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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