在应用程序中打开时,在android?metro packager上构建并安装singed apk错误
我正试图在我的手机上安装一个签名的apk,但一直失败。 当我在手机上安装了apk后,在加载之前,应用程序会一次又一次地关闭 然后我试着在应用程序中打开时,在android?metro packager上构建并安装singed apk错误,android,apk,Android,Apk,我正试图在我的手机上安装一个签名的apk,但一直失败。 当我在手机上安装了apk后,在加载之前,应用程序会一次又一次地关闭 然后我试着 react-native bundle --dev false --platform android --entry-file index.js --bundle-output ./android/app/build/intermediates/assets/debug/index.android.bundle -- assets
react-native bundle --dev false --platform android --entry-file index.js
--bundle-output
./android/app/build/intermediates/assets/debug/index.android.bundle --
assets-dest ./android/app/build/intermediates/res/merged/debug
及
然后,当我在手机上安装apk时,又出现了一个错误,说我缺少开发服务器
def enableSeparateBuildPerCPUArchitecture = true
def enableProguardInReleaseBuilds = false
android {
// because of firestore:
dexOptions {
javaMaxHeapSize "4g"
}
compileSdkVersion 27
defaultConfig {
applicationId "com.myapp"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
// ndk {
// abiFilters "armeabi-v7a", "x86"
// }
// because of firestore:
multiDexEnabled true
}
signingConfigs {
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"),
"proguard-rules.pro"
signingConfig signingConfigs.release
}
}
applicationVariants.all { variant ->
variant.outputs.each { output ->
def versionCodes = ["armeabi-v7a":1, "x86":2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-
release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 +
defaultConfig.versionCode
}
}
}
以及来自错误的日志:
0 info it worked if it ends with ok
1 verbose cli [ 'D:\\node.exe',
1 verbose cli 'D:\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm@5.6.0
3 info using node@v8.11.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle womencare@0.1.0~prestart: womencare@0.1.0
6 info lifecycle womencare@0.1.0~start: womencare@0.1.0
7 verbose lifecycle womencare@0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle womencare@0.1.0~start: PATH:
D:\node_modules\npm\node_modules\npm-lifecycle\node-gyp-
bin;C:\Users\thanos\womencare\react-native-firebase-
starter\node_modules\.bin;C:\Program Files (x86)\Common
Files\Oracle\Java\javapath;C:\WINDOWS\system32;
C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:
\WINDOWS\System32\WindowsPowerShell\v1.0\;C
:\WINDOWS\System32\OpenSSH\;D:\;D:\Git\cmd;C
:\Program Files
(x86)\Yarn\bin\;C:\Users\thanos\AppData\Local\Android\sdk\platform-
tools;;D:\Microsoft VS
Code\bin;C:\Users\thanos\AppData\Local\Microsoft
\WindowsApps;C:\Users\thanos\AppData\Roaming\npm;C:
\Users\thanos\AppData\Local\Yarn\bin;C:\Program Files
(x86)\Java\jdk1.8.0_171\bin;C:\Users\thanos\sdk-tools-windows-
4333796\tools\bin
9 verbose lifecycle womencare@0.1.0~start: CWD:
C:\Users\thanos\womencare\react-
native-firebase-starter
10 silly lifecycle womencare@0.1.0~start: Args: [ '/d /s /c', 'react-native
start' ]
11 silly lifecycle womencare@0.1.0~start: Returned: code: 11 signal: null
12 info lifecycle womencare@0.1.0~start: Failed to exec start script
13 verbose stack Error: womencare@0.1.0 start: `react-native start`
13 verbose stack Exit status 11
13 verbose stack at EventEmitter.<anonymous>
(D:\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess.<anonymous>
(D:\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:925:16)
13 verbose stack at Process.ChildProcess._handle.onexit
(internal/child_process.js:209:5)
14 verbose pkgid womencare@0.1.0
15 verbose cwd C:\Users\thanos\womencare\react-native-firebase-starter
16 verbose Windows_NT 10.0.17134
17 verbose argv "D:\\node.exe" "D:\\node_modules\\npm\\bin\\npm-cli.js"
"start"
18 verbose node v8.11.1
19 verbose npm v5.6.0
20 error code ELIFECYCLE
21 error errno 11
22 error womencare@0.1.0 start: `react-native start`
22 error Exit status 11
23 error Failed at the womencare@0.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional
logging output above.
24 verbose exit [ 11, true ]
0信息如果它以ok结尾,它就工作了
1详细cli['D:\\node.exe',
1详细cli'D:\\node\u modules\\npm\\bin\\npm cli.js',
1详细cli“开始”]
2信息使用npm@5.6.0
3信息使用node@v8.11.1
4详细的运行脚本['prestart','start','poststart']
5信息生命周期womencare@0.1.0~prestart:womencare@0.1.0
6信息生命周期womencare@0.1.0~start:womencare@0.1.0
7详细的生命周期womencare@0.1.0~start:生命周期中的不安全烫发为true
8详细的生命周期womencare@0.1.0~start:PATH:
D:\node\u modules\npm\node\u modules\npm lifecycle\node gyp-
箱子C:\Users\thanos\womencare\react native firebase-
启动器\节点\模块\.bin;C:\ProgramFiles(x86)\Common
Files\Oracle\Java\javapath;C:\WINDOWS\system32;
C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:
\WINDOWS\System32\WindowsPowerShell\v1.0\;C
:\WINDOWS\System32\OpenSSH\;D:\;D:\Git\cmd;C
:\程序文件
(x86)\artin\bin\;C:\Users\thanos\AppData\Local\Android\sdk\platform-
工具;;D:\Microsoft VS
代码\bin;C:\Users\thanos\AppData\Local\Microsoft
\Windows应用程序;C:\Users\thanos\AppData\Roaming\npm;C:
\Users\thanos\AppData\Local\Thread\bin;C:\程序文件
(x86)\Java\jdk1.8.0\u 171\bin;C:\Users\thanos\sdk工具windows-
4333796\tools\bin
9详细的生命周期womencare@0.1.0~start:CWD:
C:\Users\thanos\womencare\react-
天然火基起动器
10愚蠢的生命周期womencare@0.1.0~start:Args:['/d/s/c','react native
开始']
11愚蠢的生命周期womencare@0.1.0~start:Returned:code:11信号:null
12信息生命周期womencare@0.1.0~start:无法执行启动脚本
13详细堆栈错误:womencare@0.1.0start:`react native start`
13详细堆栈退出状态11
13 EventEmitter上的详细堆栈。
(D:\node\u modules\npm\node\u modules\npm lifecycle\index.js:285:16)
13 emitTwo上的详细堆栈(events.js:126:13)
13 EventEmitter.emit上的详细堆栈(events.js:214:7)
13子进程上的详细堆栈。
(D:\node\u modules\npm\node\u modules\npm lifecycle\lib\spawn.js:55:14)
13 emitTwo上的详细堆栈(events.js:126:13)
13 ChildProcess.emit上的详细堆栈(events.js:214:7)
13 maybeClose的详细堆栈(internal/child_process.js:925:16)
13 Process.ChildProcess.\u handle.onexit处的详细堆栈
(内部/子流程js:209:5)
14详细的pkgidwomencare@0.1.0
15详细cwd C:\Users\thanos\womencare\react本机firebase启动器
16详细窗口\u NT 10.0.17134
17详细argv“D:\\node.exe”“D:\\node\u模块\\npm\\bin\\npm cli.js”
“开始”
18详细节点v8.11.1
19详细的npm v5.6.0
20错误代码ELIFECYCLE
21错误11
22错误womencare@0.1.0start:`react native start`
22错误退出状态11
23发生错误时失败womencare@0.1.0开始脚本。
23错误这可能不是npm的问题。可能还有其他的问题
上面的日志输出。
24详细退出[11,正确]
安装失败时的错误消息是什么?使用adb install
查看错误消息。最初的错误出现在我的开发服务器上,显示为EPERM:operation not allowed,lstat C:\users\react native firebase starter\app\build\generated\fabric。然后,我手机中的错误如下:无法从assets index.android.bundle加载脚本。请确保您的捆绑包已正确打包。这是因为我克隆了react native firebase starter kit以安装新应用程序吗?(我没有运行npm重命名)
0 info it worked if it ends with ok
1 verbose cli [ 'D:\\node.exe',
1 verbose cli 'D:\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm@5.6.0
3 info using node@v8.11.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle womencare@0.1.0~prestart: womencare@0.1.0
6 info lifecycle womencare@0.1.0~start: womencare@0.1.0
7 verbose lifecycle womencare@0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle womencare@0.1.0~start: PATH:
D:\node_modules\npm\node_modules\npm-lifecycle\node-gyp-
bin;C:\Users\thanos\womencare\react-native-firebase-
starter\node_modules\.bin;C:\Program Files (x86)\Common
Files\Oracle\Java\javapath;C:\WINDOWS\system32;
C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:
\WINDOWS\System32\WindowsPowerShell\v1.0\;C
:\WINDOWS\System32\OpenSSH\;D:\;D:\Git\cmd;C
:\Program Files
(x86)\Yarn\bin\;C:\Users\thanos\AppData\Local\Android\sdk\platform-
tools;;D:\Microsoft VS
Code\bin;C:\Users\thanos\AppData\Local\Microsoft
\WindowsApps;C:\Users\thanos\AppData\Roaming\npm;C:
\Users\thanos\AppData\Local\Yarn\bin;C:\Program Files
(x86)\Java\jdk1.8.0_171\bin;C:\Users\thanos\sdk-tools-windows-
4333796\tools\bin
9 verbose lifecycle womencare@0.1.0~start: CWD:
C:\Users\thanos\womencare\react-
native-firebase-starter
10 silly lifecycle womencare@0.1.0~start: Args: [ '/d /s /c', 'react-native
start' ]
11 silly lifecycle womencare@0.1.0~start: Returned: code: 11 signal: null
12 info lifecycle womencare@0.1.0~start: Failed to exec start script
13 verbose stack Error: womencare@0.1.0 start: `react-native start`
13 verbose stack Exit status 11
13 verbose stack at EventEmitter.<anonymous>
(D:\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess.<anonymous>
(D:\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:925:16)
13 verbose stack at Process.ChildProcess._handle.onexit
(internal/child_process.js:209:5)
14 verbose pkgid womencare@0.1.0
15 verbose cwd C:\Users\thanos\womencare\react-native-firebase-starter
16 verbose Windows_NT 10.0.17134
17 verbose argv "D:\\node.exe" "D:\\node_modules\\npm\\bin\\npm-cli.js"
"start"
18 verbose node v8.11.1
19 verbose npm v5.6.0
20 error code ELIFECYCLE
21 error errno 11
22 error womencare@0.1.0 start: `react-native start`
22 error Exit status 11
23 error Failed at the womencare@0.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional
logging output above.
24 verbose exit [ 11, true ]