React native 反应本机-无app-release.apk
我正在尝试为我的react本机应用程序生成发布apk。我使用的是react native 0.29。我在按照你的指示做 这是我的终端的输出:React native 反应本机-无app-release.apk,react-native,apk,react-native-android,React Native,Apk,React Native Android,我正在尝试为我的react本机应用程序生成发布apk。我使用的是react native 0.29。我在按照你的指示做 这是我的终端的输出: → cd android && ./gradlew assembleRelease :app:preBuild UP-TO-DATE :app:preReleaseBuild UP-TO-DATE :app:checkReleaseManifest :app:preDebugBuild UP-TO-DATE :app:prepareComA
→ cd android && ./gradlew assembleRelease
:app:preBuild UP-TO-DATE
:app:preReleaseBuild UP-TO-DATE
:app:checkReleaseManifest
:app:preDebugBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72301Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42321Library UP-TO-DATE
:app:prepareComFacebookFrescoDrawee0110Library UP-TO-DATE
:app:prepareComFacebookFrescoFbcore0110Library UP-TO-DATE
:app:prepareComFacebookFrescoFresco0110Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipeline0110Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipelineBase0110Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipelineOkhttp30110Library UP-TO-DATE
:app:prepareComFacebookReactReactNative0291Library UP-TO-DATE
:app:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE
:app:prepareReleaseDependencies
:app:compileReleaseAidl UP-TO-DATE
:app:compileReleaseRenderscript UP-TO-DATE
:app:generateReleaseBuildConfig UP-TO-DATE
:app:generateReleaseAssets UP-TO-DATE
:app:mergeReleaseAssets
:app:generateReleaseResValues UP-TO-DATE
:app:generateReleaseResources UP-TO-DATE
:app:mergeReleaseResources
AAPT: /home/shoumma/Workspace/ReactNativeWorkspace/notesApp/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
AAPT: /home/shoumma/Workspace/ReactNativeWorkspace/notesApp/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
AAPT: /home/shoumma/Workspace/ReactNativeWorkspace/notesApp/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
AAPT: /home/shoumma/Workspace/ReactNativeWorkspace/notesApp/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
:app:bundleReleaseJsAndAssets
[11:36:55 AM] <START> Building Dependency Graph
[11:36:55 AM] <START> Crawling File System
[11:36:56 AM] <START> find dependencies
[11:36:59 AM] <END> Crawling File System (4208ms)
[11:36:59 AM] <START> Building in-memory fs for JavaScript
[11:37:00 AM] <END> Building in-memory fs for JavaScript (350ms)
[11:37:00 AM] <START> Building in-memory fs for Assets
[11:37:00 AM] <END> Building in-memory fs for Assets (251ms)
[11:37:00 AM] <START> Building Haste Map
[11:37:00 AM] <START> Building (deprecated) Asset Map
[11:37:00 AM] <END> Building (deprecated) Asset Map (123ms)
[11:37:00 AM] <END> Building Haste Map (485ms)
[11:37:00 AM] <END> Building Dependency Graph (5337ms)
[11:37:24 AM] <END> find dependencies (28446ms)
bundle: start
bundle: finish
bundle: Writing bundle output to: /home/shoumma/Workspace/ReactNativeWorkspace/notesApp/android/app/build/intermediates/assets/release/index.android.bundle
bundle: Done writing bundle output
bundle: Copying 5 asset files
bundle: Done copying assets
:app:processReleaseManifest UP-TO-DATE
:app:processReleaseResources UP-TO-DATE
:app:generateReleaseSources UP-TO-DATE
:app:processReleaseJavaRes UP-TO-DATE
:app:compileReleaseJavaWithJavac UP-TO-DATE
:app:compileReleaseNdk UP-TO-DATE
:app:compileReleaseSources UP-TO-DATE
:app:lintVitalRelease
:app:preDexRelease UP-TO-DATE
:app:dexRelease UP-TO-DATE
:app:packageRelease UP-TO-DATE
:app:assembleRelease
BUILD SUCCESSFUL
Total time: 57.742 secs
然后我在android/app/build.gradle
中添加了singingConfigs
:
signingConfigs {
release {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
然后,我从我的项目文件夹中运行命令
cd android&./gradlew assembleerelease
。但是运气不好,我没有任何应用程序realease.apk
。我有什么遗漏吗?我真是个白痴。我感到非常沮丧,以至于我没有注意到,我不得不在android/app/build.gradle中再添加一行。我错过的是在buildTypes
中添加以下行:
MYAPP_RELEASE_STORE_FILE="my-release-key.keystore" [i also tried without double-quotes]
MYAPP_RELEASE_KEY_ALIAS="my-store-alias"
MYAPP_RELEASE_STORE_PASSWORD="******" [added my password]
MYAPP_RELEASE_KEY_PASSWORD="******" [added my password]
buildTypes {
release {
...
signingConfig signingConfigs.release
}
}
MYAPP_RELEASE_STORE_FILE=my-release-key.keystore
MYAPP_RELEASE_KEY_ALIAS=my-store-alias
MYAPP_RELEASE_STORE_PASSWORD=******
MYAPP_RELEASE_KEY_PASSWORD=******
我还必须删除~/.gradle/gradle.properties
中的双引号:
MYAPP_RELEASE_STORE_FILE="my-release-key.keystore" [i also tried without double-quotes]
MYAPP_RELEASE_KEY_ALIAS="my-store-alias"
MYAPP_RELEASE_STORE_PASSWORD="******" [added my password]
MYAPP_RELEASE_KEY_PASSWORD="******" [added my password]
buildTypes {
release {
...
signingConfig signingConfigs.release
}
}
MYAPP_RELEASE_STORE_FILE=my-release-key.keystore
MYAPP_RELEASE_KEY_ALIAS=my-store-alias
MYAPP_RELEASE_STORE_PASSWORD=******
MYAPP_RELEASE_KEY_PASSWORD=******
是的,我终于得到了我的
应用realease.apk
-D如果在正式发布后成功生成,请运行以下命令
npx react本机运行android--变量=发布
成功后,您可以在这里找到apk android/app/build/outputs/apk/release
这对我很有用谢谢你的帖子。完全忽略了
signingConfig signingConfigs.release
我拥有所有这些,但在/gradlew bundleRelease
之后仍然没有app-release.apk。只有应用程序调试。编辑:运行npx react原生运行android--variant=release