zoukankan      html  css  js  c++  java
  • react-native打包apk常见错误收集

    react-native 0.59打包报错,信息如下,根据错误信息是因为react-native-cookies的sdk版本问题导致的

     1 ./gradlew assembleRelease
     2 
     3 > Configure project :react-native-cookies
     4 WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
     5 It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
     6 WARNING: The specified Android SDK Build Tools version (25.0.2) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.3.1.
     7 Android SDK Build Tools 28.0.3 will be used.
     8 To suppress this warning, remove "buildToolsVersion '25.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
     9 
    10 > Configure project :react-native-webview
    11 :react-native-webview:reactNativeAndroidRoot F:WorkSpaceCP_HY
    ode_modules
    eact-nativeandroid
    12 
    13 > Task :app:bundleReleaseJsAndAssets
    14 warning: the transform cache was reset.
    15 Loading dependency graph, done.
    16 info Writing bundle output to:, F:WorkSpaceCP_HYandroidappuildgeneratedassets
    eact
    eleaseindex.android.bundle
    17 info Done writing bundle output
    18 info Copying 50 asset files
    19 info Done copying assets
    20 
    21 > Task :react-native-cookies:verifyReleaseResources FAILED
    22 
    23 FAILURE: Build failed with an exception.
    24 
    25 * What went wrong:
    26 Execution failed for task ':react-native-cookies:verifyReleaseResources'.
    27 > java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
    28   error: resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found.
    29   error: resource android:style/TextAppearance.Material.Widget.Button.Colored not found.

    根据错误信息,我们找到react-native-cookies下的andorid/build.gradle,修改skd版本如下

    android {
        compileSdkVersion 28 // 23 ->28
        buildToolsVersion "28.0.3" // 25.0.2 -> 28.0.3
    
        defaultConfig {
            minSdkVersion 16
            targetSdkVersion 22
            versionCode 1
            versionName "1.0"
        }
        lintOptions {
            abortOnError false
        }
    }

    重新打包即可;

    一般打包react-native应用时,最常见的错误就是第三方插件的sdk版本和react-native中android中的sdk版本不一致导致,这个时候不要慌,修改版本依赖,重新打包即可

  • 相关阅读:
    iOS内购开发(也许是最全的介绍)
    React Native 学习(三)之 FlexBox 布局
    React Native组件解析(二)之Text
    苹果开发者账号(个人、公司、企业)的区别
    React Native学习(二)之View
    搭建React Native开发环境
    iOS 提交AppStore不出现构建的版本
    Python使用Mysql过程中一些错误
    数据分析之漏斗模型
    项目管理之敏捷方式(我们的方式)
  • 原文地址:https://www.cnblogs.com/songdongdong/p/10978859.html
Copyright © 2011-2022 走看看