简体   繁体   English

React Native 构建成功但没有发布 apk

[英]React native build success but there is no release apk

I was working on this project since few months and everything was alright.几个月以来我一直在研究这个项目,一切都很好。 We had several production builds using ./gradlew bundleRelease我们有几个使用./gradlew bundleRelease生产构建

But since few days I am not able to take production build using ./gradlew bundleRelease .但是几天以来我无法使用./gradlew bundleRelease进行生产构建。 I mean the log says eveything is success.我的意思是日志说一切都是成功的。 Here is the log:这是日志:

> $ ./gradlew bundleRelease WARNING: Configuration 'compile' is obsolete
> and has been replaced with 'implementation' and 'api'. It will be
> removed at the end of 2018. For more information see:
> http://d.android.com/r/tools/update-dependency-c                      
> onfigurations.html WARNING: Configuration 'compile' is obsolete and
> has been replaced with 'implementation' and 'api'. It will be removed
> at the end of 2018. For more information see:
> http://d.android.com/r/tools/update-dependency-c                      
> onfigurations.html WARNING: Configuration 'compile' is obsolete and
> has been replaced with 'implementation' and 'api'. It will be removed
> at the end of 2018. For more information see:
> http://d.android.com/r/tools/update-dependency-c                      
> onfigurations.html WARNING: The specified Android SDK Build Tools
> version (23.0.1) is ignored, as it is below the minimum supported     
> version (27.0.3) for Android Gradle Plugin 3.1.4. Android SDK Build
> Tools 27.0.3 will be used. To suppress this warning, remove
> "buildToolsVersion '23.0.1'" from your build.gradle file, as each
> version of the                                                        
> Android Gradle Plugin now has a default version of the build tools.
> WARNING: Configuration 'compile' is obsolete and has been replaced
> with 'implementation' and 'api'. It will be removed at the end of
> 2018. For more information see: http://d.android.com/r/tools/update-dependency-c                      
> onfigurations.html :react-native-ble-manager:preBuild UP-TO-DATE
> :react-native-ble-manager:preReleaseBuild UP-TO-DATE
> :react-native-ble-manager:compileReleaseAidl UP-TO-DATE
> :react-native-ble-manager:compileReleaseRenderscript UP-TO-DATE
> :react-native-ble-manager:checkReleaseManifest UP-TO-DATE
> :react-native-ble-manager:generateReleaseBuildConfig UP-TO-DATE
> :react-native-ble-manager:generateReleaseResValues UP-TO-DATE
> :react-native-ble-manager:generateReleaseResources UP-TO-DATE
> :react-native-ble-manager:packageReleaseResources UP-TO-DATE
> :react-native-ble-manager:platformAttrExtractor UP-TO-DATE
> :react-native-ble-manager:processReleaseManifest UP-TO-DATE
> :react-native-ble-manager:generateReleaseRFile UP-TO-DATE
> :react-native-ble-manager:prepareLintJar UP-TO-DATE
> :react-native-ble-manager:generateReleaseSources UP-TO-DATE
> :react-native-ble-manager:javaPreCompileRelease UP-TO-DATE
> :react-native-ble-manager:compileReleaseJavaWithJavac UP-TO-DATE
> :react-native-ble-manager:extractReleaseAnnotations UP-TO-DATE
> :react-native-ble-manager:mergeReleaseConsumerProguardFiles UP-TO-DATE
> :react-native-ble-manager:mergeReleaseShaders UP-TO-DATE
> :react-native-ble-manager:compileReleaseShaders UP-TO-DATE
> :react-native-ble-manager:generateReleaseAssets UP-TO-DATE
> :react-native-ble-manager:packageReleaseAssets UP-TO-DATE
> :react-native-ble-manager:packageReleaseRenderscript NO-SOURCE
> :react-native-ble-manager:processReleaseJavaRes NO-SOURCE
> :react-native-ble-manager:transformResourcesWithMergeJavaResForRelease
> UP-TO-DATE
> :react-native-ble-manager:transformClassesAndResourcesWithSyncLibJarsForRelease
> UP-TO-DATE :react-native-ble-manager:compileReleaseNdk NO-SOURCE
> :react-native-ble-manager:mergeReleaseJniLibFolders UP-TO-DATE
> :react-native-ble-manager:transformNativeLibsWithMergeJniLibsForRelease
> UP-TO-DATE
> :react-native-ble-manager:transformNativeLibsWithSyncJniLibsForRelease
> UP-TO-DATE :react-native-ble-manager:bundleRelease UP-TO-DATE
> :react-native-datawedge-intents:preBuild UP-TO-DATE
> :react-native-datawedge-intents:preReleaseBuild UP-TO-DATE
> :react-native-datawedge-intents:compileReleaseAidl UP-TO-DATE
> :react-native-datawedge-intents:compileReleaseRenderscript UP-TO-DATE
> :react-native-datawedge-intents:checkReleaseManifest UP-TO-DATE
> :react-native-datawedge-intents:generateReleaseBuildConfig UP-TO-DATE
> :react-native-datawedge-intents:generateReleaseResValues UP-TO-DATE
> :react-native-datawedge-intents:generateReleaseResources UP-TO-DATE
> :react-native-datawedge-intents:packageReleaseResources UP-TO-DATE
> :react-native-datawedge-intents:platformAttrExtractor UP-TO-DATE
> :react-native-datawedge-intents:processReleaseManifest UP-TO-DATE
> :react-native-datawedge-intents:generateReleaseRFile UP-TO-DATE
> :react-native-datawedge-intents:prepareLintJar UP-TO-DATE
> :react-native-datawedge-intents:generateReleaseSources UP-TO-DATE
> :react-native-datawedge-intents:javaPreCompileRelease UP-TO-DATE
> :react-native-datawedge-intents:compileReleaseJavaWithJavac UP-TO-DATE
> :react-native-datawedge-intents:extractReleaseAnnotations UP-TO-DATE
> :react-native-datawedge-intents:mergeReleaseConsumerProguardFiles
> UP-TO-DATE :react-native-datawedge-intents:mergeReleaseShaders
> UP-TO-DATE :react-native-datawedge-intents:compileReleaseShaders
> UP-TO-DATE :react-native-datawedge-intents:generateReleaseAssets
> UP-TO-DATE :react-native-datawedge-intents:packageReleaseAssets
> UP-TO-DATE :react-native-datawedge-intents:packageReleaseRenderscript
> NO-SOURCE :react-native-datawedge-intents:processReleaseJavaRes
> NO-SOURCE
> :react-native-datawedge-intents:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
> :react-native-datawedge-intents:transformClassesAndResourcesWithSyncLibJarsForRelease
> UP-TO-DATE :react-native-datawedge-intents:compileReleaseNdk NO-SOURCE
> :react-native-datawedge-intents:mergeReleaseJniLibFolders UP-TO-DATE
> :react-native-datawedge-intents:transformNativeLibsWithMergeJniLibsForRelease
> UP-TO-DATE
> :react-native-datawedge-intents:transformNativeLibsWithSyncJniLibsForRelease UP-TO-DATE :react-native-datawedge-intents:bundleRelease UP-TO-DATE
> :react-native-device-info:preBuild UP-TO-DATE
> :react-native-device-info:preReleaseBuild UP-TO-DATE
> :react-native-device-info:compileReleaseAidl UP-TO-DATE
> :react-native-device-info:compileReleaseRenderscript UP-TO-DATE
> :react-native-device-info:checkReleaseManifest UP-TO-DATE
> :react-native-device-info:generateReleaseBuildConfig UP-TO-DATE
> :react-native-device-info:generateReleaseResValues UP-TO-DATE
> :react-native-device-info:generateReleaseResources UP-TO-DATE
> :react-native-device-info:packageReleaseResources UP-TO-DATE
> :react-native-device-info:platformAttrExtractor UP-TO-DATE
> :react-native-device-info:processReleaseManifest UP-TO-DATE
> :react-native-device-info:generateReleaseRFile UP-TO-DATE
> :react-native-device-info:prepareLintJar UP-TO-DATE
> :react-native-device-info:generateReleaseSources UP-TO-DATE
> :react-native-device-info:javaPreCompileRelease UP-TO-DATE
> :react-native-device-info:compileReleaseJavaWithJavac UP-TO-DATE
> :react-native-device-info:extractReleaseAnnotations UP-TO-DATE
> :react-native-device-info:mergeReleaseConsumerProguardFiles UP-TO-DATE
> :react-native-device-info:mergeReleaseShaders UP-TO-DATE
> :react-native-device-info:compileReleaseShaders UP-TO-DATE
> :react-native-device-info:generateReleaseAssets UP-TO-DATE
> :react-native-device-info:packageReleaseAssets UP-TO-DATE
> :react-native-device-info:packageReleaseRenderscript NO-SOURCE
> :react-native-device-info:processReleaseJavaRes NO-SOURCE
> :react-native-device-info:transformResourcesWithMergeJavaResForRelease
> UP-TO-DATE
> :react-native-device-info:transformClassesAndResourcesWithSyncLibJarsForRelease
> UP-TO-DATE :react-native-device-info:compileReleaseNdk NO-SOURCE
> :react-native-device-info:mergeReleaseJniLibFolders UP-TO-DATE
> :react-native-device-info:transformNativeLibsWithMergeJniLibsForRelease
> UP-TO-DATE
> :react-native-device-info:transformNativeLibsWithSyncJniLibsForRelease
> UP-TO-DATE :react-native-device-info:bundleRelease UP-TO-DATE
> :react-native-vector-icons:preBuild UP-TO-DATE
> :react-native-vector-icons:preReleaseBuild UP-TO-DATE
> :react-native-vector-icons:compileReleaseAidl UP-TO-DATE
> :react-native-vector-icons:compileReleaseRenderscript UP-TO-DATE
> :react-native-vector-icons:checkReleaseManifest UP-TO-DATE
> :react-native-vector-icons:generateReleaseBuildConfig UP-TO-DATE
> :react-native-vector-icons:generateReleaseResValues UP-TO-DATE
> :react-native-vector-icons:generateReleaseResources UP-TO-DATE
> :react-native-vector-icons:packageReleaseResources UP-TO-DATE
> :react-native-vector-icons:platformAttrExtractor UP-TO-DATE
> :react-native-vector-icons:processReleaseManifest UP-TO-DATE
> :react-native-vector-icons:generateReleaseRFile UP-TO-DATE
> :react-native-vector-icons:prepareLintJar UP-TO-DATE
> :react-native-vector-icons:generateReleaseSources UP-TO-DATE
> :react-native-vector-icons:javaPreCompileRelease UP-TO-DATE
> :react-native-vector-icons:compileReleaseJavaWithJavac UP-TO-DATE
> :react-native-vector-icons:extractReleaseAnnotations UP-TO-DATE
> :react-native-vector-icons:mergeReleaseConsumerProguardFiles
> UP-TO-DATE :react-native-vector-icons:mergeReleaseShaders UP-TO-DATE
> :react-native-vector-icons:compileReleaseShaders UP-TO-DATE
> :react-native-vector-icons:generateReleaseAssets UP-TO-DATE
> :react-native-vector-icons:packageReleaseAssets UP-TO-DATE
> :react-native-vector-icons:packageReleaseRenderscript NO-SOURCE
> :react-native-vector-icons:processReleaseJavaRes NO-SOURCE
> :react-native-vector-icons:transformResourcesWithMergeJavaResForRelease
> UP-TO-DATE
> :react-native-vector-icons:transformClassesAndResourcesWithSyncLibJarsForRelease
> UP-TO-DATE :react-native-vector-icons:compileReleaseNdk NO-SOURCE
> :react-native-vector-icons:mergeReleaseJniLibFolders UP-TO-DATE
> :react-native-vector-icons:transformNativeLibsWithMergeJniLibsForRelease
> UP-TO-DATE
> :react-native-vector-icons:transformNativeLibsWithSyncJniLibsForRelease
> UP-TO-DATE :react-native-vector-icons:bundleRelease UP-TO-DATE
> 
> BUILD SUCCESSFUL in 2s 92 actionable tasks: 92 up-to-date

Here is my target SDK and other information:这是我的目标 SDK 和其他信息:

build.gradle:

buildToolsVersion = "27.0.3"
minSdkVersion = 16
compileSdkVersion = 27
targetSdkVersion = 26
supportLibVersion = "27.1.1"

I found a solution: Instead of running ./gradlew bundleRelease run ./gradlew app:assemblerelease .我找到了一个解决方案:而不是运行./gradlew bundleRelease运行./gradlew app:assemblerelease It generated the APK properly.它正确生成了APK。

Search the .apk file.搜索 .apk 文件。 It usually lies in build folder它通常位于构建文件夹中

Try running this code "cd android && ./gradlew assembleRelease && open './app/build/outputs/apk/'尝试运行此代码"cd android && ./gradlew assembleRelease && open './app/build/outputs/apk/'

只需运行以下命令

 cd android && ./gradlew app:assembleRelease && cd ..

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM