在我的应用程序中,我想使用firebase Crashlytics,为此,我将以下代码添加到我的应用程序中。
我从谷歌文档一步一步地添加了这个代码!
我添加了以下代码,但是当同步应用程序显示错误而不是同步项目时。
Build.gradle(项目):
buildscript {
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.1.0'
classpath 'io.fabric.tools:gradle:1.26.1'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
maven { url 'https://dl.bintray.com/tapsellorg/maven' }
maven { url 'https://maven.google.com/' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Run Code Online (Sandbox Code Playgroud)
Build.gradle(应用程序):
dependencies {
implementation 'com.google.android.gms:play-services-base:16.0.1'
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.7'
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'io.fabric'
Run Code Online (Sandbox Code Playgroud)
但是当添加这一行时apply plugin: 'com.google.gms.google-services',当点击同步时显示以下错误: …
在我的应用程序要使用Room使用图书馆的数据库,并为最终的生成APK我能缩小选项(proguard相关的)Build.Gradle。
我使用以下版本的 Room 库:
implementation "android.arch.persistence.room:runtime:1.1.1"
annotationProcessor "android.arch.persistence.room:compiler:1.1.1"
Run Code Online (Sandbox Code Playgroud)
我在 proguard-rules 中写了以下代码:
-dontwarn class android.arch.persistence.room.paging.LimitOffsetDataSource
-dontwarn interface android.arch.persistence.room.paging.LimitOffsetDataSource
-dontwarn class android.arch.util.paging.CountedDataSource
-dontwarn interface android.arch.util.paging.CountedDataSource
Run Code Online (Sandbox Code Playgroud)
但是当生成 APK 在Build选项卡中显示以下错误时:
Unknown option 'android.arch.persistence.room.paging.LimitOffsetDataSource' in line 39 of file '/Volumes/M/Test Projects/MyApp/app/proguard-rules.pro'
Run Code Online (Sandbox Code Playgroud)
显示此行的错误:
-dontwarn class android.arch.persistence.room.paging.LimitOffsetDataSource
Run Code Online (Sandbox Code Playgroud)
如何解决这个问题?
在我的应用程序中,我想使用deeplink。当添加intent-filter了深层链接的启动activity,不见了应用程序图标到应用程序抽屉里!
但是当删除深层链接 时,将intent-filter应用程序图标显示到应用程序抽屉中。
清单代码:
<activity android:name=".Pages.Splash.SplashPage">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<!-- DeepLink -->
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="www.example.com"
android:pathPrefix="/gaming"
android:scheme="http" />
<data
android:host="example.com"
android:pathPrefix="/gaming"
android:scheme="http" />
</intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)
使用以上代码时,不在应用程序抽屉中显示应用程序图标,而是从manifest显示图标中删除以下代码时。
<!-- DeepLink -->
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="www.example.com"
android:pathPrefix="/gaming"
android:scheme="http" />
<data
android:host="example.com"
android:pathPrefix="/gaming" …Run Code Online (Sandbox Code Playgroud)