我想使用base64url模块。当我安装它时,它需要缓冲区。所以,我从npm安装缓冲区。但是在添加缓冲区模块后,我的应用程序错误与以下消息。
我已经使用npm install buffer --save
安装了它,请帮忙。
java.lang.RuntimeException: Unable to start activity ComponentInfo{org.nativescript.kcdm/com.tns.NativeScriptActivity}: com.tns.NativeScriptException:
Calling js method onCreate failed
Error calling module function
Error calling module function
TypeError: Cannot assign to read only property 'from' of function Buffer(arg, encodingOrOffset, length) {
// Common case.
if (typeof arg === 'number') {
if (typ...<omitted>...
}
File: "/data/data/org.nativescript.kcdm/files/app/tns_modules/buffer/index.js, line: 127, column: 12
StackTrace:
Frame: function:'', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/buffer/index.js', line: 127, column: 13
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'/data/data/org.nativescript.kcdm/files/app/views/login/login3.js', line: 6, column: 14
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'global.loadModule', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/globals/globals.js', line: 29, column: 31
Frame: function:'resolvePageFromEntry', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/ui/frame/frame-common.js', line: 79, column: 40
Frame: function:'Frame.navigate', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/ui/frame/frame-common.js', line: 165, column: 20
Frame: function:'ActivityCallbacksImplementation.onCreate', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/ui/frame/frame.js', line: 690, column: 19
Frame: function:'NativeScriptActivity.onCreate', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/ui/frame/activity.js', line: 12, column: 25
TypeError: Cannot assign to read only property 'from' of function Buffer(arg, encodingOrOffset, length) {
// Common case.
if (typeof arg === 'number') {
if (typ...<omitted>...
}
File: "<unknown>, line: 1, column: 265
StackTrace:
Frame: function:'', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/buffer/index.js', line: 127, column: 13
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'/data/data/org.nativescript.kcdm/files/app/views/login/login3.js', line: 6, column: 14
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'global.loadModule', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/globals/globals.js', line: 29, column: 31
Frame: function:'resolvePageFromEntry', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/ui/frame/frame-common.js', line: 79, column: 40
Frame: function:'Frame.navigate', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/ui/frame/frame-common.js', line: 165, column: 20
Frame: function:'ActivityCallbacksImplementation.onCreate', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/ui/frame/frame.js', line: 690, column: 19
Frame: function:'NativeScriptActivity.onCreate', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/ui/frame/activity.js', line: 12, column: 25
TypeError: Cannot assign to read only property 'from' of function Buffer(arg, encodingOrOffset, length) {
// Common case.
if (typeof arg === 'number') {
if (typ...<omitted>...
}
File: "<unknown>, line: 1, column: 265
StackTrace:
Frame: function:'', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/buffer/index.js', line: 127, column: 13
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'/data/data/org.nativescript.kcdm/files/app/views/login/login3.js', line: 6, column: 14
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'global.loadModule', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/globals/globals.js', line: 29, column: 31
Frame: function:'resolvePageFromEntry', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/ui/frame/frame-common.js', line: 79, column: 40
Frame: function:'Frame.navigate', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/ui/frame/frame-common.js', line: 165, column: 20
Frame: function:'ActivityCallbacksImplementation.onCreate', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/ui/frame/frame.js', line: 690, column: 19
Frame: function:'NativeScriptActivity.onCreate', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/ui/frame/activity.js', line: 12, column: 25
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: com.tns.NativeScriptException:
Calling js method onCreate failed
Error calling module function
Error calling module function
TypeError: Cannot assign to read only property 'from' of function Buffer(arg, encodingOrOffset, length) {
// Common case.
if (typeof arg === 'number') {
if (typ...<omitted>...
}
File: "/data/data/org.nativescript.kcdm/files/app/tns_modules/buffer/index.js, line: 127, column: 12
StackTrace:
Frame: function:'', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/buffer/index.js', line: 127, column: 13
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'/data/data/org.nativescript.kcdm/files/app/views/login/login3.js', line: 6, column: 14
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'global.loadModule', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/globals/globals.js', line: 29, column: 31
Frame: function:'resolvePageFromEntry', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/ui/frame/frame-common.js', line: 79, column: 40
Frame: function:'Frame.navigate', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/ui/frame/frame-common.js', line: 165, column: 20
Frame: function:'ActivityCallbacksImplementation.onCreate', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/ui/frame/frame.js', line: 690, column: 19
Frame: function:'NativeScriptActivity.onCreate', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/ui/frame/activity.js', line: 12, column: 25
TypeError: Cannot assign to read only property 'from' of function Buffer(arg, encodingOrOffset, length) {
// Common case.
if (typeof arg === 'number') {
if (typ...<omitted>...
}
File: "<unknown>, line: 1, column: 265
StackTrace:
Frame: function:'', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/buffer/index.js', line: 127, column: 13
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'/data/data/org.nativescript.kcdm/files/app/views/login/login3.js', line: 6, column: 14
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'global.loadModule', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/globals/globals.js', line: 29, column: 31
Frame: function:'resolvePageFromEntry', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/ui/frame/frame-common.js', line: 79, column: 40
Frame: function:'Frame.navigate', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/ui/frame/frame-common.js', line: 165, column: 20
Frame: function:'ActivityCallbacksImplementation.onCreate', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/ui/frame/frame.js', line: 690, column: 19
Frame: function:'NativeScriptActivity.onCreate', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/ui/frame/activity.js', line: 12, column: 25
TypeError: Cannot assign to read only property 'from' of function Buffer(arg, encodingOrOffset, length) {
// Common case.
if (typeof arg === 'number') {
if (typ...<omitted>...
}
File: "<unknown>, line: 1, column: 265
StackTrace:
Frame: function:'', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/buffer/index.js', line: 127, column: 13
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'', file:'/data/data/org.nativescript.kcdm/files/app/views/login/login3.js', line: 6, column: 14
Frame: function:'require', file:'', line: 1, column: 266
Frame: function:'global.loadModule', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/globals/globals.js', line: 29, column: 31
Frame: function:'resolvePageFromEntry', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/ui/frame/frame-common.js', line: 79, column: 40
Frame: function:'Frame.navigate', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/ui/frame/frame-common.js', line: 165, column: 20
Frame: function:'ActivityCallbacksImplementation.onCreate', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/ui/frame/frame.js', line: 690, column: 19
Frame: function:'NativeScriptActivity.onCreate', file:'/data/data/org.nativescript.kcdm/files/app/tns_modules/ui/frame/activity.js', line: 12, column: 25