如何使用 proguard 获取发布构建 apk 文件

2023-12-01

我正在尝试使用ProGuard为了为我的项目制作发布 apk 文件,显然我正在使用许多第三方库,我只需要使用其中的几个类,我真的很想得到一些关于此的解释。

我的调试版本超过20-MB,所以我想通过使用来减少它shrinking用于proguard,但是它给了我一些我无法弄清楚的警告,尽管如此故障排除,我不知道我应该做什么改变,

buildTypes {
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

上面的行显示了片段build.gradle在模块:应用程序中

-keepattributes InnerClasses

这就是我用来抑制一些警告的方法proguard-rules.pro,我确实浏览了 Proguard 上的其他问题,但无法得到它。 我已经提到了我在尝试获取发布版本时收到的消息

Note: duplicate definition of library class [android.net.http.SslError]
Note: duplicate definition of library class [android.net.http.SslCertificate]
Note: duplicate definition of library class [android.net.http.SslCertificate$DName]
Note: duplicate definition of library class [org.apache.http.conn.scheme.HostNameResolver]
Note: duplicate definition of library class [org.apache.http.conn.scheme.SocketFactory]
Note: duplicate definition of library class [org.apache.http.conn.ConnectTimeoutException]
Note: duplicate definition of library class [org.apache.http.params.HttpParams]
Note: there were 7 duplicate class definitions.
      (http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)
Initializing...
Note: the configuration refers to the unknown class 'com.google.vending.licensing.ILicensingService'
Note: the configuration refers to the unknown class 'com.android.vending.licensing.ILicensingService'
Note: android.support.v4.app.NotificationCompatJellybean calls 'Field.getType'
Note: com.google.android.gms.internal.zzsv calls 'Field.getType'
Note: com.google.gson.FieldAttributes calls 'Field.getGenericType'
Note: com.google.gson.FieldAttributes calls 'Field.getType'
Note: com.google.gson.internal.$Gson$Types calls 'Class.getGenericInterfaces'
Note: com.google.gson.internal.$Gson$Types calls 'Class.getGenericSuperclass'
Note: com.google.gson.internal.$Gson$Types calls 'Class.getTypeParameters'
Note: com.google.gson.internal.Excluder calls 'Field.getType'
Note: com.google.gson.internal.bind.ReflectiveTypeAdapterFactory calls 'Field.getType'
Note: com.google.gson.internal.bind.ReflectiveTypeAdapterFactory calls 'Field.getGenericType'
Note: com.google.gson.internal.bind.ReflectiveTypeAdapterFactory calls 'Class.getGenericSuperclass'
Note: com.google.gson.reflect.TypeToken calls 'Class.getGenericSuperclass'
Note: com.google.gson.reflect.TypeToken calls 'Class.getTypeParameters'
Note: com.google.gson.reflect.TypeToken calls 'Class.getGenericInterfaces'
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkHttpClient
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkUrlFactory
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Cache
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkHttpClient
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkUrlFactory
Warning:com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkHttpClient
Note: android.support.v4.text.ICUCompatApi23: can't find dynamically referenced class libcore.icu.ICU
Note: android.support.v4.text.ICUCompatIcs: can't find dynamically referenced class libcore.icu.ICU
Note: android.support.v7.widget.DrawableUtils: can't find dynamically referenced class android.graphics.Insets
Note: com.google.android.gms.internal.zzlh: can't find dynamically referenced class com.facebook.Session
Note: com.google.android.gms.internal.zzlh: can't find dynamically referenced class com.facebook.FacebookSdk
Note: com.google.android.gms.internal.zzlh: can't find dynamically referenced class com.facebook.login.LoginManager
Note: com.google.android.gms.internal.zzlh: can't find dynamically referenced class com.facebook.Session
Note: com.google.android.gms.internal.zzlh: can't find dynamically referenced class com.facebook.login.LoginManager
Note: com.google.android.gms.internal.zzlh: can't find dynamically referenced class com.facebook.Session$OpenRequest
Note: com.google.android.gms.internal.zzlh: can't find dynamically referenced class com.facebook.Session
Note: com.google.android.gms.internal.zzlh: can't find dynamically referenced class com.facebook.Session$StatusCallback
Note: com.google.android.gms.internal.zzlh: can't find dynamically referenced class com.facebook.Session
Note: com.google.android.gms.internal.zzlh: can't find dynamically referenced class com.facebook.Session$StatusCallback
Note: com.google.android.gms.internal.zzlh$1: can't find dynamically referenced class com.facebook.SessionState
Note: com.google.android.gms.maps.internal.zzad: can't find dynamically referenced class com.google.android.gms.maps.internal.CreatorImpl
Note: com.google.gson.internal.UnsafeAllocator: can't find dynamically referenced class sun.misc.Unsafe
Note: com.squareup.picasso.Utils: can't find dynamically referenced class com.squareup.okhttp.OkUrlFactory
Note: com.squareup.picasso.Utils: can't find dynamically referenced class com.squareup.okhttp.OkHttpClient
Note: android.support.v4.app.NotificationCompatJellybean accesses a declared field 'icon' dynamically
      Maybe this is program field 'android.support.design.R$attr { int icon; }'
      Maybe this is program field 'android.support.design.R$id { int icon; }'
      Maybe this is program field 'android.support.v4.app.NotificationCompat$Action { int icon; }'
      Maybe this is program field 'android.support.v7.appcompat.R$attr { int icon; }'
      Maybe this is program field 'android.support.v7.appcompat.R$id { int icon; }'
      Maybe this is program field 'android.support.v7.mediarouter.R$attr { int icon; }'
      Maybe this is program field 'android.support.v7.mediarouter.R$id { int icon; }'
      Maybe this is program field 'com.nimgade.pk.mytest101.R$attr { int icon; }'
      Maybe this is program field 'com.nimgade.pk.mytest101.R$id { int icon; }'
      Maybe this is library field 'android.R$attr { int icon; }'
      Maybe this is library field 'android.R$id { int icon; }'
      Maybe this is library field 'android.app.LauncherActivity$ListItem { android.graphics.drawable.Drawable icon; }'
      Maybe this is library field 'android.app.Notification { int icon; }'
      Maybe this is library field 'android.app.Notification$Action { int icon; }'
      Maybe this is library field 'android.appwidget.AppWidgetProviderInfo { int icon; }'
      Maybe this is library field 'android.content.pm.PackageItemInfo { int icon; }'
      Maybe this is library field 'android.content.pm.ResolveInfo { int icon; }'
      Maybe this is library field 'android.inputmethodservice.Keyboard$Key { android.graphics.drawable.Drawable icon; }'
      Maybe this is library field 'android.speech.tts.TextToSpeech$EngineInfo { int icon; }'
Note: android.support.v4.app.NotificationCompatJellybean accesses a declared field 'title' dynamically
      Maybe this is program field 'android.support.design.R$attr { int title; }'
      Maybe this is program field 'android.support.design.R$id { int title; }'
      Maybe this is program field 'android.support.v4.app.NotificationCompat$Action { java.lang.CharSequence title; }'
      Maybe this is program field 'android.support.v7.appcompat.R$attr { int title; }'
      Maybe this is program field 'android.support.v7.appcompat.R$id { int title; }'
      Maybe this is program field 'android.support.v7.mediarouter.R$attr { int title; }'
      Maybe this is program field 'android.support.v7.mediarouter.R$id { int title; }'
      Maybe this is program field 'com.google.android.gms.games.internal.player.PlayerColumnNames { java.lang.String title; }'
      Maybe this is program field 'com.google.android.gms.vision.barcode.Barcode$ContactInfo { java.lang.String title; }'
      Maybe this is program field 'com.google.android.gms.vision.barcode.Barcode$UrlBookmark { java.lang.String title; }'
      Maybe this is program field 'com.nimgade.pk.mytest101.R$attr { int title; }'
      Maybe this is program field 'com.nimgade.pk.mytest101.R$id { int title; }'
      Maybe this is library field 'android.R$attr { int title; }'
      Maybe this is library field 'android.R$id { int title; }'
      Maybe this is library field 'android.app.Notification$Action { java.lang.CharSequence title; }'
      Maybe this is library field 'android.preference.PreferenceActivity$Header { java.lang.CharSequence title; }'
Note: android.support.v4.app.NotificationCompatJellybean accesses a declared field 'actionIntent' dynamically
      Maybe this is program field 'android.support.v4.app.NotificationCompat$Action { android.app.PendingIntent actionIntent; }'
      Maybe this is library field 'android.app.Notification$Action { android.app.PendingIntent actionIntent; }'
Note: com.google.gson.internal.UnsafeAllocator accesses a declared field 'theUnsafe' dynamically
Note: the configuration keeps the entry point 'android.support.design.widget.AppBarLayout { void setWindowInsets(android.support.v4.view.WindowInsetsCompat); }', but not the descriptor class 'android.support.v4.view.WindowInsetsCompat'
Note: the configuration keeps the entry point 'android.support.design.widget.CoordinatorLayout { void setWindowInsets(android.support.v4.view.WindowInsetsCompat); }', but not the descriptor class 'android.support.v4.view.WindowInsetsCompat'
Note: the configuration keeps the entry point 'android.support.design.widget.NavigationView { void setNavigationItemSelectedListener(android.support.design.widget.NavigationView$OnNavigationItemSelectedListener); }', but not the descriptor class 'android.support.design.widget.NavigationView$OnNavigationItemSelectedListener'
Note: the configuration keeps the entry point 'android.support.design.widget.Snackbar$SnackbarLayout { void setOnLayoutChangeListener(android.support.design.widget.Snackbar$SnackbarLayout$OnLayoutChangeListener); }', but not the descriptor class 'android.support.design.widget.Snackbar$SnackbarLayout$OnLayoutChangeListener'
Note: the configuration keeps the entry point 'android.support.design.widget.Snackbar$SnackbarLayout { void setOnAttachStateChangeListener(android.support.design.widget.Snackbar$SnackbarLayout$OnAttachStateChangeListener); }', but not the descriptor class 'android.support.design.widget.Snackbar$SnackbarLayout$OnAttachStateChangeListener'
Note: the configuration keeps the entry point 'android.support.design.widget.TabLayout { void setOnTabSelectedListener(android.support.design.widget.TabLayout$OnTabSelectedListener); }', but not the descriptor class 'android.support.design.widget.TabLayout$OnTabSelectedListener'
Note: the configuration keeps the entry point 'android.support.design.widget.TabLayout { void setTabsFromPagerAdapter(android.support.v4.view.PagerAdapter); }', but not the descriptor class 'android.support.v4.view.PagerAdapter'
Note: the configuration keeps the entry point 'android.support.v4.view.ViewPager { void setAdapter(android.support.v4.view.PagerAdapter); }', but not the descriptor class 'android.support.v4.view.PagerAdapter'
Note: the configuration keeps the entry point 'android.support.v4.view.ViewPager { void setOnAdapterChangeListener(android.support.v4.view.ViewPager$OnAdapterChangeListener); }', but not the descriptor class 'android.support.v4.view.ViewPager$OnAdapterChangeListener'
Note: the configuration keeps the entry point 'android.support.v4.view.ViewPager { void setOnPageChangeListener(android.support.v4.view.ViewPager$OnPageChangeListener); }', but not the descriptor class 'android.support.v4.view.ViewPager$OnPageChangeListener'
Note: the configuration keeps the entry point 'android.support.v4.widget.DrawerLayout { void setDrawerListener(android.support.v4.widget.DrawerLayout$DrawerListener); }', but not the descriptor class 'android.support.v4.widget.DrawerLayout$DrawerListener'
Note: the configuration keeps the entry point 'android.support.v4.widget.NestedScrollView { void setOnScrollChangeListener(android.support.v4.widget.NestedScrollView$OnScrollChangeListener); }', but not the descriptor class 'android.support.v4.widget.NestedScrollView$OnScrollChangeListener'
Note: the configuration keeps the entry point 'android.support.v4.widget.SlidingPaneLayout { void setPanelSlideListener(android.support.v4.widget.SlidingPaneLayout$PanelSlideListener); }', but not the descriptor class 'android.support.v4.widget.SlidingPaneLayout$PanelSlideListener'
Note: the configuration keeps the entry point 'android.support.v4.widget.SwipeRefreshLayout { void setOnRefreshListener(android.support.v4.widget.SwipeRefreshLayout$OnRefreshListener); }', but not the descriptor class 'android.support.v4.widget.SwipeRefreshLayout$OnRefreshListener'
Note: the configuration keeps the entry point 'android.support.v7.app.MediaRouteButton { void setRouteSelector(android.support.v7.media.MediaRouteSelector); }', but not the descriptor class 'android.support.v7.media.MediaRouteSelector'
Note: the configuration keeps the entry point 'android.support.v7.app.MediaRouteButton { void setDialogFactory(android.support.v7.app.MediaRouteDialogFactory); }', but not the descriptor class 'android.support.v7.app.MediaRouteDialogFactory'
Note: the configuration keeps the entry point 'android.support.v7.view.menu.ActionMenuItemView { void setItemInvoker(android.support.v7.view.menu.MenuBuilder$ItemInvoker); }', but not the descriptor class 'android.support.v7.view.menu.MenuBuilder$ItemInvoker'
Note: the configuration keeps the entry point 'android.support.v7.view.menu.ActionMenuItemView { void setPopupCallback(android.support.v7.view.menu.ActionMenuItemView$PopupCallback); }', but not the descriptor class 'android.support.v7.view.menu.ActionMenuItemView$PopupCallback'
Note: the configuration keeps the entry point 'android.support.v7.widget.ActionBarContainer { void setTabContainer(android.support.v7.widget.ScrollingTabContainerView); }', but not the descriptor class 'android.support.v7.widget.ScrollingTabContainerView'
Note: the configuration keeps the entry point 'android.support.v7.widget.ActionBarOverlayLayout { void setActionBarVisibilityCallback(android.support.v7.widget.ActionBarOverlayLayout$ActionBarVisibilityCallback); }', but not the descriptor class 'android.support.v7.widget.ActionBarOverlayLayout$ActionBarVisibilityCallback'
Note: the configuration keeps the entry point 'android.support.v7.widget.ActionMenuView { void setPresenter(android.support.v7.widget.ActionMenuPresenter); }', but not the descriptor class 'android.support.v7.widget.ActionMenuPresenter'
Note: the configuration keeps the entry point 'android.support.v7.widget.ActionMenuView { void setOnMenuItemClickListener(android.support.v7.widget.ActionMenuView$OnMenuItemClickListener); }', but not the descriptor class 'android.support.v7.widget.ActionMenuView$OnMenuItemClickListener'
Note: the configuration keeps the entry point 'android.support.v7.widget.ActivityChooserView { void setActivityChooserModel(android.support.v7.widget.ActivityChooserModel); }', but not the descriptor class 'android.support.v7.widget.ActivityChooserModel'
Note: the configuration keeps the entry point 'android.support.v7.widget.ActivityChooserView { void setProvider(android.support.v4.view.ActionProvider); }', but not the descriptor class 'android.support.v4.view.ActionProvider'
Note: the configuration keeps the entry point 'android.support.v7.widget.ContentFrameLayout { void setAttachListener(android.support.v7.widget.ContentFrameLayout$OnAttachListener); }', but not the descriptor class 'android.support.v7.widget.ContentFrameLayout$OnAttachListener'
Note: the configuration keeps the entry point 'android.support.v7.widget.FitWindowsFrameLayout { void setOnFitSystemWindowsListener(android.support.v7.widget.FitWindowsViewGroup$OnFitSystemWindowsListener); }', but not the descriptor class 'android.support.v7.widget.FitWindowsViewGroup$OnFitSystemWindowsListener'
Note: the configuration keeps the entry point 'android.support.v7.widget.FitWindowsLinearLayout { void setOnFitSystemWindowsListener(android.support.v7.widget.FitWindowsViewGroup$OnFitSystemWindowsListener); }', but not the descriptor class 'android.support.v7.widget.FitWindowsViewGroup$OnFitSystemWindowsListener'
Note: the configuration keeps the entry point 'android.support.v7.widget.RecyclerView { void setAccessibilityDelegateCompat(android.support.v7.widget.RecyclerViewAccessibilityDelegate); }', but not the descriptor class 'android.support.v7.widget.RecyclerViewAccessibilityDelegate'
Note: the configuration keeps the entry point 'android.support.v7.widget.RecyclerView { void setAdapter(android.support.v7.widget.RecyclerView$Adapter); }', but not the descriptor class 'android.support.v7.widget.RecyclerView$Adapter'
Note: the configuration keeps the entry point 'android.support.v7.widget.RecyclerView { void setRecyclerListener(android.support.v7.widget.RecyclerView$RecyclerListener); }', but not the descriptor class 'android.support.v7.widget.RecyclerView$RecyclerListener'
Note: the configuration keeps the entry point 'android.support.v7.widget.RecyclerView { void setLayoutManager(android.support.v7.widget.RecyclerView$LayoutManager); }', but not the descriptor class 'android.support.v7.widget.RecyclerView$LayoutManager'
Note: the configuration keeps the entry point 'android.support.v7.widget.RecyclerView { void setRecycledViewPool(android.support.v7.widget.RecyclerView$RecycledViewPool); }', but not the descriptor class 'android.support.v7.widget.RecyclerView$RecycledViewPool'
Note: the configuration keeps the entry point 'android.support.v7.widget.RecyclerView { void setViewCacheExtension(android.support.v7.widget.RecyclerView$ViewCacheExtension); }', but not the descriptor class 'android.support.v7.widget.RecyclerView$ViewCacheExtension'
Note: the configuration keeps the entry point 'android.support.v7.widget.RecyclerView { void setChildDrawingOrderCallback(android.support.v7.widget.RecyclerView$ChildDrawingOrderCallback); }', but not the descriptor class 'android.support.v7.widget.RecyclerView$ChildDrawingOrderCallback'
Note: the configuration keeps the entry point 'android.support.v7.widget.RecyclerView { void setOnScrollListener(android.support.v7.widget.RecyclerView$OnScrollListener); }', but not the descriptor class 'android.support.v7.widget.RecyclerView$OnScrollListener'
Note: the configuration keeps the entry point 'android.support.v7.widget.RecyclerView { void setItemAnimator(android.support.v7.widget.RecyclerView$ItemAnimator); }', but not the descriptor class 'android.support.v7.widget.RecyclerView$ItemAnimator'
Note: the configuration keeps the entry point 'android.support.v7.widget.SearchView { void setOnQueryTextListener(android.support.v7.widget.SearchView$OnQueryTextListener); }', but not the descriptor class 'android.support.v7.widget.SearchView$OnQueryTextListener'
Note: the configuration keeps the entry point 'android.support.v7.widget.SearchView { void setOnCloseListener(android.support.v7.widget.SearchView$OnCloseListener); }', but not the descriptor class 'android.support.v7.widget.SearchView$OnCloseListener'
Note: the configuration keeps the entry point 'android.support.v7.widget.SearchView { void setOnSuggestionListener(android.support.v7.widget.SearchView$OnSuggestionListener); }', but not the descriptor class 'android.support.v7.widget.SearchView$OnSuggestionListener'
Note: the configuration keeps the entry point 'android.support.v7.widget.SearchView { void setSuggestionsAdapter(android.support.v4.widget.CursorAdapter); }', but not the descriptor class 'android.support.v4.widget.CursorAdapter'
Note: the configuration keeps the entry point 'android.support.v7.widget.SearchView$SearchAutoComplete { void setSearchView(android.support.v7.widget.SearchView); }', but not the descriptor class 'android.support.v7.widget.SearchView'
Note: the configuration keeps the entry point 'android.support.v7.widget.Toolbar { void setOnMenuItemClickListener(android.support.v7.widget.Toolbar$OnMenuItemClickListener); }', but not the descriptor class 'android.support.v7.widget.Toolbar$OnMenuItemClickListener'
Note: the configuration keeps the entry point 'android.support.v7.widget.ViewStubCompat { void setOnInflateListener(android.support.v7.widget.ViewStubCompat$OnInflateListener); }', but not the descriptor class 'android.support.v7.widget.ViewStubCompat$OnInflateListener'
Note: the configuration keeps the entry point 'com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView { void setImage(com.davemorrissey.labs.subscaleview.ImageSource); }', but not the descriptor class 'com.davemorrissey.labs.subscaleview.ImageSource'
Note: the configuration keeps the entry point 'com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView { void setRegionDecoderFactory(com.davemorrissey.labs.subscaleview.decoder.DecoderFactory); }', but not the descriptor class 'com.davemorrissey.labs.subscaleview.decoder.DecoderFactory'
Note: the configuration keeps the entry point 'com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView { void setBitmapDecoderFactory(com.davemorrissey.labs.subscaleview.decoder.DecoderFactory); }', but not the descriptor class 'com.davemorrissey.labs.subscaleview.decoder.DecoderFactory'
Note: the configuration keeps the entry point 'com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView { void setOnImageEventListener(com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView$OnImageEventListener); }', but not the descriptor class 'com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView$OnImageEventListener'
Note: the configuration keeps the entry point 'com.google.android.gms.ads.AdView { void setInAppPurchaseListener(com.google.android.gms.ads.purchase.InAppPurchaseListener); }', but not the descriptor class 'com.google.android.gms.ads.purchase.InAppPurchaseListener'
Note: the configuration keeps the entry point 'com.google.android.gms.ads.AdView { void setAdSize(com.google.android.gms.ads.AdSize); }', but not the descriptor class 'com.google.android.gms.ads.AdSize'
Note: the configuration keeps the entry point 'com.google.android.gms.ads.AdView { void setAdListener(com.google.android.gms.ads.AdListener); }', but not the descriptor class 'com.google.android.gms.ads.AdListener'
Note: the configuration keeps the entry point 'com.google.android.gms.ads.BaseAdView { void setAdListener(com.google.android.gms.ads.AdListener); }', but not the descriptor class 'com.google.android.gms.ads.AdListener'
Note: the configuration keeps the entry point 'com.google.android.gms.ads.BaseAdView { void setAdSize(com.google.android.gms.ads.AdSize); }', but not the descriptor class 'com.google.android.gms.ads.AdSize'
Note: the configuration keeps the entry point 'com.google.android.gms.ads.BaseAdView { void setInAppPurchaseListener(com.google.android.gms.ads.purchase.InAppPurchaseListener); }', but not the descriptor class 'com.google.android.gms.ads.purchase.InAppPurchaseListener'
Note: the configuration keeps the entry point 'com.google.android.gms.ads.NativeExpressAdView { void setInAppPurchaseListener(com.google.android.gms.ads.purchase.InAppPurchaseListener); }', but not the descriptor class 'com.google.android.gms.ads.purchase.InAppPurchaseListener'
Note: the configuration keeps the entry point 'com.google.android.gms.ads.NativeExpressAdView { void setAdSize(com.google.android.gms.ads.AdSize); }', but not the descriptor class 'com.google.android.gms.ads.AdSize'
Note: the configuration keeps the entry point 'com.google.android.gms.ads.NativeExpressAdView { void setAdListener(com.google.android.gms.ads.AdListener); }', but not the descriptor class 'com.google.android.gms.ads.AdListener'
Note: the configuration keeps the entry point 'com.google.android.gms.ads.doubleclick.PublisherAdView { void setAdListener(com.google.android.gms.ads.AdListener); }', but not the descriptor class 'com.google.android.gms.ads.AdListener'
Note: the configuration keeps the entry point 'com.google.android.gms.ads.doubleclick.PublisherAdView { void setAdSizes(com.google.android.gms.ads.AdSize[]); }', but not the descriptor class 'com.google.android.gms.ads.AdSize'
Note: the configuration keeps the entry point 'com.google.android.gms.ads.doubleclick.PublisherAdView { void setAppEventListener(com.google.android.gms.ads.doubleclick.AppEventListener); }', but not the descriptor class 'com.google.android.gms.ads.doubleclick.AppEventListener'
Note: the configuration keeps the entry point 'com.google.android.gms.ads.doubleclick.PublisherAdView { void setCorrelator(com.google.android.gms.ads.Correlator); }', but not the descriptor class 'com.google.android.gms.ads.Correlator'
Note: the configuration keeps the entry point 'com.google.android.gms.ads.doubleclick.PublisherAdView { void setOnCustomRenderedAdLoadedListener(com.google.android.gms.ads.doubleclick.OnCustomRenderedAdLoadedListener); }', but not the descriptor class 'com.google.android.gms.ads.doubleclick.OnCustomRenderedAdLoadedListener'
Note: the configuration keeps the entry point 'com.google.android.gms.ads.formats.NativeAdView { void setNativeAd(com.google.android.gms.ads.formats.NativeAd); }', but not the descriptor class 'com.google.android.gms.ads.formats.NativeAd'
Note: the configuration keeps the entry point 'com.google.android.gms.ads.search.SearchAdView { void setAdListener(com.google.android.gms.ads.AdListener); }', but not the descriptor class 'com.google.android.gms.ads.AdListener'
Note: the configuration keeps the entry point 'com.google.android.gms.ads.search.SearchAdView { void setAdSize(com.google.android.gms.ads.AdSize); }', but not the descriptor class 'com.google.android.gms.ads.AdSize'
Note: the configuration keeps the entry point 'com.google.android.gms.flags.impl.FlagProviderImpl { void init(com.google.android.gms.dynamic.zzd); }', but not the descriptor class 'com.google.android.gms.dynamic.zzd'
Note: the configuration keeps the entry point 'com.google.android.gms.plus.PlusOneButton { void setOnPlusOneClickListener(com.google.android.gms.plus.PlusOneButton$OnPlusOneClickListener); }', but not the descriptor class 'com.google.android.gms.plus.PlusOneButton$OnPlusOneClickListener'
Note: there were 2 references to unknown classes.
      You should check your configuration for typos.
      (http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass)
Note: there were 14 classes trying to access generic signatures using reflection.
      You should consider keeping the signature attributes
      (using '-keepattributes Signature').
      (http://proguard.sourceforge.net/manual/troubleshooting.html#attributes)
Note: there were 66 unkept descriptor classes in kept class members.
      You should consider explicitly keeping the mentioned classes
      (using '-keep').
      (http://proguard.sourceforge.net/manual/troubleshooting.html#descriptorclass)
Note: there were 18 unresolved dynamic references to classes or interfaces.
      You should check if you need to specify additional program jars.
      (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
Note: there were 4 accesses to class members by means of introspection.
      You should consider explicitly keeping the mentioned class members
      (using '-keep' or '-keepclassmembers').
      (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclassmember)
Warning:there were 13 unresolved references to classes or interfaces.
         You may need to add missing library jars or update their versions.
         If your code works fine without the missing classes, you can suppress
         the warnings with '-dontwarn' options.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.
:app:transformClassesAndResourcesWithProguardForRelease FAILED
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> java.io.IOException: Please correct the above warnings first.

添加这个:

-dontwarn com.squareup.okhttp.**

到你的 proguard-rules.pro

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何使用 proguard 获取发布构建 apk 文件 的相关文章

  • 如何从自定义视图访问主机片段的生命周期范围?

    我需要在自定义视图中使用协程 看完这个之后 我相信我最好的选择是使用生命周期范围作为协程作用域 这样当lifecycleowner被销毁时 它会自动取消 但是我似乎无法访问自定义视图中的生命周期范围 根据文档 https developer
  • 如何使用 JavaScript 提高音频加载速度?

    我已经创建了播放代码 mp3使用 JavaScript 文件 但该文件在 Android 上播放需要很长时间 我想在点击文本图像后快速播放声音 如何提高 Android 的加载速度 我的 JavaScript 代码 if window au
  • 使用意图过滤器从 URL 打开 Android 应用程序不起作用

    我有一个 Android 应用程序 人们用它来替代网站 因此 当用户遇到网站的 URL 时 我想为他们提供在我的应用程序中而不是在浏览器中 打开 URL 的选项 换句话说 我希望出现弹出窗口 让他们在我的应用程序和浏览器 可能还有其他应用程
  • Jetpack Compose 中的图像裁剪器?

    我到处搜索 但没有找到有关在 Jetpack Compose 中裁剪图像的文档 如何在 Jetpack Compose 中裁剪图像 实际上 您可以使用那些较旧的 Android 库 没有问题 我用的是这个 https github com
  • Gradle 同步失败:配置项目“:lib”时出现问题

    我正在尝试在 android studio 中构建一个项目 但它总是失败 并出现名为 org gradle api ProjectConfigurationException A problem occurred configuring p
  • Android 模拟器无法与 Xamarin/Visual Studio Mac 配合使用

    你好 我真的很难让 Android 模拟器在我的 Mac 上运行 我需要采取哪些步骤才能使其正常工作 我在 MacOS Catalina 上安装了 Visual Studio 2019 这是一个新的空白 Xamarin Forms 项目 我
  • MLKit Firebase android - 如何将 FirebaseVisionFace 转换为图像对象(如位图)?

    我已将 MLkit FaceDetection 集成到我的 Android 应用程序中 我已参考以下网址 https firebase google com docs ml kit android detect faces https fi
  • 使用actionBar推送视图的正确方法[关闭]

    Closed 这个问题不符合堆栈溢出指南 help closed questions 目前不接受答案 我是一名新的 Android 开发人员 所以我更喜欢询问正确的方法来解决我的问题 我有一个 FragmentActivity 和多个片段
  • 向 Android 操作栏添加按钮

    我如何制作带有文本的按钮 在操作栏中带有图像 如下所示 是否可以使用内置的 android 按钮或图像按钮在操作栏中执行如下操作 我正在使用 appcompat 来使用操作栏 是的 如果需要 您可以膨胀自定义操作栏 Override pro
  • Compose-Navigation:在导航之前从堆栈中删除以前的可组合项

    我在用着compose navigation alpha09 处理可组合项之间的导航 我想删除启动画面当移动到下一个目的地时 我不希望背部受压返回 Splash 以下尝试未按预期工作 navHostController navigate R
  • Android EditText 和 SearchView:主要区别是什么(设计除外)?

    我需要在我的 Android 应用程序中实现一个搜索界面 该界面可以过滤多个RecyclerView里面一个ViewPager 我已经实现了EditText and SearchView小部件并尝试查看差异 我感兴趣的听众是 myEditT
  • Android 5.0 - 在模块中声明自定义权限

    我在 Android Studio 中有一个模块 我在多个应用程序 均使用不同的密钥签名 中使用该模块来处理 GCM 通知 在 GCM 客户端文档中 他们说要定义包命名空间自定义权限
  • Android 视图可见性消失

    如果我设置了一个视图可见性 它被夸大了 消失了 它会加快我的 UI 速度吗 它将加快 UI 的实际绘制速度 因为 好吧 您不必再绘制它 但它仍然会膨胀 并且膨胀过程不会更快
  • Android studio 导入模块按钮缺失

    我已经使用 Eclipse 很长时间了 但我想尝试一下 Android Studio 所以我创建了新项目 现在我想向其中添加 SlidingMenu 库 我发现一些教程说要转到项目结构 单击加号按钮并选择导入模块 但是没有导入模块选项 当我
  • TextView 中缩进项目符号列表

    我有一个 TextView 我用 strings xml 中的字符串资源中的文本填充它 字符串资源包含 元素 用于在 TextView 内创建项目符号列表 我的问题是我想控制项目符号列表中跨越多行的行的缩进 默认情况下 文本不会缩进超过项目
  • 解析JSON数据并将其放入gridview中

    我正在开发一个应用程序 我必须在其中解析JSON数据并且必须将它们放入自定义中gridview 它应该是这样的 到目前为止 我已经在 asynctask 中解析了 JSON 数据并获取了这些值 这是我的代码 private class ge
  • Android 中 Admob 的 XML 或 Java 关键字

    我似乎找不到任何有关通过 XML 或 Java 设置 adMob 广告关键字的可靠文档 我已经尝试过中看到的方法this https stackoverflow com questions 5066129 android admob api
  • 清单合并失败:需要为 显式指定 android:exported

    我的清单文件有问题 错误消息 清单合并失败 android 需要为 明确指定导出 面向 Android 12 及更高版本的应用需要指定显式值android exported当相应的组件定义了意图过滤器时 有关详细信息 请参阅 https d
  • Android BottomNavigationView 与自定义视图作为图标[关闭]

    Closed 这个问题需要多问focused help closed questions 目前不接受答案 我正在尝试 Android 支持库中的新 BottomNavigationView 对于其中一个菜单项 我希望有一个自定义视图 以便我
  • 找不到 `activityViewModels()` Hilt Android

    我在我的项目中使用 Hilt 和 MVVM 我想要一个viewModel from activityViewModel在 2 个活动中使用相同的内容 但我的 Android Studio 说未解析的参考 我的应用程序 build gradl

随机推荐