gpt4 book ai didi

android - 成功安装Gradle后,Android Release APK崩溃

转载 作者:行者123 更新时间:2023-12-03 05:17:27 28 4
gpt4 key购买 nike

我将项目迁移到Android Studio。我可以轻松构建该应用程序并从Android Studio运行。我可以轻松运行Android“Generate Signed APK”选项生成的调试APK。当我要构建发行版APK时,我会运行

 gradle assembleRelease

Gradle完成了所有工作,并以BUILD SUCCESSFUL完成。

当我在设备上安装此发行版APK时,由于缺少(具有讽刺意味的是)Crashlytics的依赖关系,它立即崩溃。我已经按照他们的说明添加了Crashlytics jar。

我对为什么gradle似乎可以正常使用却不能正常发布感到非常困惑。任何建议都非常感谢!

这是主要的build.gradle
apply plugin: 'android'

dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile 'com.android.support:support-v4:19.0.+'
compile project(':stripe')

repositories {
mavenCentral()
}
compile 'com.github.chrisbanes.actionbarpulltorefresh:extra-abs:+'
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'

}

android {
compileSdkVersion 19
buildToolsVersion '19.0.0'

signingConfigs {

release {

storeFile file(****)
storePassword "****"
keyAlias "****"
keyPassword "****"
}
}

buildTypes {

release {

signingConfig signingConfigs.release
}
}

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
lib.srcDirs
}

// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')

// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}

这是stripe的build.gradle:
apply plugin: 'android-library'

dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}

android {
compileSdkVersion 17
buildToolsVersion "19.0.0"

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src/main/java','src/test/java']
resources.srcDirs = ['src/main/java','src/test/java']
aidl.srcDirs = ['src/main/java','src/test/java']
renderscript.srcDirs = ['src/main/java','src/test/java']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}

// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
}
}

最佳答案

来自Crashlytics的Hemal,我可以为此提供完全的帮助!继续并快速执行设置说明here。这样可以解决您看到的错误:)

关于android - 成功安装Gradle后,Android Release APK崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24018665/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com