下载了Mozilla的fenix的工程,然后自己新建了一个项目,但是没有办法生成APK,build的时候出现NullPointerException during IR Conversion
生成APK的时候出现这个错误
Error: C:\Users\1247\.gradle\caches\transforms-2\files-2.1\a23c8c3902a9b5254e713513da60c387\jetified-feature-tab-collections-43.0.20200520130058-runtime.jar:mozilla/components/feature/tab/collections/TabCollectionStorage.class, androidx.lifecycle.LiveData mozilla.components.feature.tab.collections.TabCollectionStorage.getCollections(int), NullPointerException during IR Conversion
尝试过
1.指定r8版本,classpath 'com.android.tools:r8:1.6.88'
2.在gradle.properties中添加android.useNewApkCreator=false
3.提高依赖版本
还是没有用
下面是我的gradle文件
buildscript {
ext.kotlin_version = '1.3.72'
repositories {
maven {
url "https://nightly.maven.mozilla.org/maven2"
content {
// Always fetch components from the snapshots repository
includeGroup "org.mozilla.components"
}
}
maven {
url "https://maven.mozilla.org/maven2"
content {
// Never fetch components from here. We always want to use snapshots.
excludeGroup "org.mozilla.components"
}
}
google()
jcenter() { url 'https://jcenter.bintray.com/' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
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
def nav_version = "2.2.2"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
classpath 'com.google.android.gms:oss-licenses-plugin:0.10.2'
def components_version = "43.0.20200520130058"
classpath "org.mozilla.components:tooling-glean-gradle:$components_version"
classpath "org.jetbrains.kotlin:kotlin-allopen:1.3.72"
classpath "com.android.tools:r8:1.6.84"
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url "https://nightly.maven.mozilla.org/maven2"
content {
// Always fetch components from the snapshots repository
includeGroup "org.mozilla.components"
}
}
maven {
url "https://maven.mozilla.org/maven2"
content {
// Never fetch components from here. We always want to use snapshots.
excludeGroup "org.mozilla.components"
}
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
buildscript {
ext.kotlin_version = '1.3.72'
repositories {
maven {
url "https://nightly.maven.mozilla.org/maven2"
content {
// Always fetch components from the snapshots repository
includeGroup "org.mozilla.components"
}
}
maven {
url "https://maven.mozilla.org/maven2"
content {
// Never fetch components from here. We always want to use snapshots.
excludeGroup "org.mozilla.components"
}
}
google()
jcenter() { url 'https://jcenter.bintray.com/' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
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
def nav_version = "2.2.2"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
classpath 'com.google.android.gms:oss-licenses-plugin:0.10.2'
def components_version = "43.0.20200520130058"
classpath "org.mozilla.components:tooling-glean-gradle:$components_version"
classpath "org.jetbrains.kotlin:kotlin-allopen:1.3.72"
classpath "com.android.tools:r8:1.6.84"
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url "https://nightly.maven.mozilla.org/maven2"
content {
// Always fetch components from the snapshots repository
includeGroup "org.mozilla.components"
}
}
maven {
url "https://maven.mozilla.org/maven2"
content {
// Never fetch components from here. We always want to use snapshots.
excludeGroup "org.mozilla.components"
}
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
plugins {
id "com.jetbrains.python.envs" version "0.0.26"
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: "androidx.navigation.safeargs.kotlin"
apply plugin: 'com.google.android.gms.oss-licenses-plugin'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.frobisher.netexplorer"
minSdkVersion 23
targetSdkVersion 29
versionCode 1
versionName "1.0"
// def buildDate = Config.generateBuildDate()
// buildConfigField 'String', 'BUILD_DATE', '"' + buildDate + '"'
buildConfigField 'String', 'SENTRY_TOKEN', 'null'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
def deepLinkSchemeValue = "net-explorer"
manifestPlaceholders = [
"isRaptorEnabled": "false",
"deepLinkScheme" : deepLinkSchemeValue
]
resValue "bool", "IS_DEBUG", "false"
buildConfigField "String", "AMO_COLLECTION", "\"16f6e5d9a40448b8955db57ced6d75\""
buildConfigField 'String', 'DIGITAL_ASSET_LINKS_TOKEN', 'null'
buildConfigField "String", "DEEP_LINK_SCHEME", "\"$deepLinkSchemeValue\""
buildConfigField 'boolean', 'CRASH_REPORTING', 'true'
buildConfigField 'String', 'ADJUST_TOKEN', 'null'
buildConfigField 'boolean', 'TELEMETRY', 'false'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
kotlinOptions {
jvmTarget = "1.8"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
android.applicationVariants.all { variant ->
try {
def token = new File("${rootDir}/.mls_token").text.trim()
buildConfigField 'String', 'MLS_TOKEN', '"' + token + '"'
println "(Added from .mls_token file)"
} catch (FileNotFoundException ignored) {
buildConfigField 'String', 'MLS_TOKEN', '""'
println("X_X")
}
try {
def parts = new File("${rootDir}/.leanplum_token").text.trim().split(":")
def id = parts[0]
def key = parts[1]
buildConfigField 'String', 'LEANPLUM_ID', '"' + id + '"'
buildConfigField 'String', 'LEANPLUM_TOKEN', '"' + key + '"'
println "(Added from .leanplum_token file)"
} catch (FileNotFoundException ignored) {
buildConfigField 'String', 'LEANPLUM_ID', 'null'
buildConfigField 'String', 'LEANPLUM_TOKEN', 'null'
println("X_X")
}
}
}
task buildTranslationArray {
def foundLocales = new StringBuilder()
foundLocales.append("new String[]{")
fileTree("src/main/res").visit { FileVisitDetails details ->
if (details.file.path.endsWith("/strings.xml")) {
def languageCode = details.file.parent.tokenize('/').last().replaceAll('values-', '').replaceAll('-r', '-')
languageCode = (languageCode == "values") ? "en-US" : languageCode
foundLocales.append("\"").append(languageCode).append("\"").append(",")
}
}
foundLocales.append("}")
def foundLocalesString = foundLocales.toString().replaceAll(',}', '}')
android.defaultConfig.buildConfigField "String[]", "SUPPORTED_LOCALE_ARRAY", foundLocalesString
}
// Generate Kotlin code and markdown docs for the Fenix Glean metrics.
ext.gleanGenerateMarkdownDocs = true
ext.gleanDocsDirectory = "$rootDir/docs"
apply plugin: "org.mozilla.telemetry.glean-gradle-plugin"
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.2.0'
// implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
def components_version = "43.0.20200520130058"
implementation "org.mozilla.components:browser-toolbar:$components_version"
implementation "org.mozilla.components:browser-engine-gecko-nightly:$components_version"
implementation "org.mozilla.components:browser-menu:$components_version"
implementation "org.mozilla.components:browser-awesomebar:$components_version"
implementation "org.mozilla.components:browser-domains:$components_version"
implementation "org.mozilla.components:browser-search:$components_version"
implementation "org.mozilla.components:browser-tabstray:$components_version"
implementation "org.mozilla.components:browser-menu:$components_version"
implementation "org.mozilla.components:browser-session:$components_version"
implementation "org.mozilla.components:browser-state:$components_version"
implementation "org.mozilla.components:browser-storage-sync:$components_version"
implementation "org.mozilla.components:browser-icons:$components_version"
implementation "org.mozilla.components:browser-thumbnails:$components_version"
implementation "org.mozilla.components:feature-toolbar:$components_version"
implementation "org.mozilla.components:feature-addons:$components_version"
implementation "org.mozilla.components:feature-app-links:$components_version"
implementation "org.mozilla.components:feature-awesomebar:$components_version"
implementation "org.mozilla.components:feature-contextmenu:$components_version"
implementation "org.mozilla.components:feature-customtabs:$components_version"
implementation "org.mozilla.components:feature-findinpage:$components_version"
implementation "org.mozilla.components:feature-media:$components_version"
implementation "org.mozilla.components:feature-sitepermissions:$components_version"
implementation "org.mozilla.components:feature-intent:$components_version"
implementation "org.mozilla.components:feature-search:$components_version"
implementation "org.mozilla.components:feature-session:$components_version"
implementation "org.mozilla.components:feature-tabs:$components_version"
implementation "org.mozilla.components:feature-downloads:$components_version"
implementation "org.mozilla.components:feature-prompts:$components_version"
implementation "org.mozilla.components:feature-push:$components_version"
implementation "org.mozilla.components:feature-pwa:$components_version"
implementation "org.mozilla.components:feature-qr:$components_version"
implementation "org.mozilla.components:feature-readerview:$components_version"
implementation "org.mozilla.components:feature-syncedtabs:$components_version"
implementation "org.mozilla.components:feature-webcompat:$components_version"
implementation "org.mozilla.components:feature-webnotifications:$components_version"
implementation "org.mozilla.components:feature-accounts:$components_version"
implementation "org.mozilla.components:feature-accounts-push:$components_version"
implementation "org.mozilla.components:feature-tab-collections:$components_version"
implementation "org.mozilla.components:feature-top-sites:$components_version"
implementation "org.mozilla.components:feature-share:$components_version"
implementation "org.mozilla.components:concept-engine:$components_version"
implementation "org.mozilla.components:concept-toolbar:$components_version"
implementation "org.mozilla.components:concept-tabstray:$components_version"
implementation "org.mozilla.components:concept-storage:$components_version"
implementation "org.mozilla.components:concept-push:$components_version"
implementation "org.mozilla.components:concept-sync:$components_version"
implementation "org.mozilla.components:ui-icons:$components_version"
implementation "org.mozilla.components:ui-colors:$components_version"
implementation "org.mozilla.components:ui-autocomplete:$components_version"
implementation "org.mozilla.components:ui-tabcounter:$components_version"
implementation "org.mozilla.components:service-firefox-accounts:$components_version"
implementation "org.mozilla.components:service-glean:$components_version"
implementation "org.mozilla.components:service-experiments:$components_version"
implementation "org.mozilla.components:service-sync-logins:$components_version"
implementation "org.mozilla.components:service-location:$components_version"
implementation "org.mozilla.components:support-utils:$components_version"
implementation "org.mozilla.components:support-ktx:$components_version"
implementation "org.mozilla.components:support-rustlog:$components_version"
implementation "org.mozilla.components:support-rusthttp:$components_version"
implementation "org.mozilla.components:support-webextensions:$components_version"
implementation "org.mozilla.components:support-locale:$components_version"
implementation "org.mozilla.components:support-migration:$components_version"
implementation "org.mozilla.components:lib-crash:$components_version"
implementation "org.mozilla.components:lib-push-firebase:$components_version"
implementation "org.mozilla.components:lib-publicsuffixlist:$components_version"
implementation "com.google.android.material:material:1.1.0"
implementation "androidx.constraintlayout:constraintlayout:2.0.0-beta6"
implementation "androidx.recyclerview:recyclerview:1.1.0"
implementation "androidx.paging:paging-runtime-ktx:2.1.2"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.2.0"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.2.0"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0"
implementation 'androidx.work:work-runtime-ktx:2.3.4'
implementation "androidx.preference:preference-ktx:1.1.1"
implementation "com.google.android:flexbox:2.0.1"
// Kotlin
implementation "androidx.navigation:navigation-fragment-ktx:2.2.2"
implementation "androidx.navigation:navigation-ui-ktx:2.2.2"
implementation "com.tencent.bugly:crashreport:3.1.8"
implementation 'com.tencent.bugly:nativecrashreport:3.7.1'
implementation 'com.airbnb.android:lottie:3.4.0'
implementation "com.google.android.gms:play-services-oss-licenses:17.0.0"
implementation "com.google.android.gms:play-services-ads-identifier:17.0.0"
implementation "io.sentry:sentry-android:1.7.10"
implementation "com.leanplum:leanplum-core:5.2.3"
implementation "com.leanplum:leanplum-fcm:5.2.3"
implementation "androidx.biometric:biometric:1.0.1"
// For the initial release of Glean 19, we require consumer applications to
// depend on a separate library for unit tests. This will be removed in future releases.
// testImplementation "org.mozilla.telemetry:glean-forUnitTests:${project.ext.glean_version}"
implementation"com.adjust.sdk:adjust-android:4.18.3"
}
下载了Mozilla的fenix的工程,然后自己新建了一个项目,但是没有办法生成APK,build的时候出现NullPointerException during IR Conversion,求各位大佬帮忙看看什么问题,谢谢