gpt4 book ai didi

android - native Checkout Paypal 按钮未在 android 中为发布 apk 呈现

转载 作者:行者123 更新时间:2023-12-05 06:01:44 26 4
gpt4 key购买 nike

我已经实现了 Native Checkout SDK使用 kotlin 进行 flutter 。该应用程序适用于调试应用程序。它显示这样的屏幕。

for debug app

但是当我使用“flutter build apk --release”命令构建发布 apk 时,它不会呈现。它显示加载栏然后消失。我也使用了互联网许可。那么这是什么原因,我该如何解决呢?

enter image description here enter image description here

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with
flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 30

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

lintOptions {
disable 'InvalidPackage'
checkReleaseBuilds false
}

defaultConfig {
// TODO: Specify your own unique Application ID
(https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.flutterkotlinpypl"
minSdkVersion 21
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}

buildTypes {
release {
debuggable true
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release`
works.
signingConfig signingConfigs.debug
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = "1.8"
}
}

flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation('com.paypal.checkout:android-sdk:0.1.0')
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.amplitude:android-sdk:2.31.0'
implementation 'com.squareup.okhttp3:okhttp:4.2.2'
}

最佳答案

我通过在 android/app/build.xml 中添加 shrinkResources falseminifyEnabled false 解决了这个问题。 buildTypes 下的 gradle 文件。希望对大家有所帮助。

buildTypes {
release {
// Signing with the debug keys for now, so `flutter run --release` works.
shrinkResources false
minifyEnabled false
signingConfig signingConfigs.debug
}
}

关于android - native Checkout Paypal 按钮未在 android 中为发布 apk 呈现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67105914/

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