申请X尚未注册 - 根据其他答案尝试了建议

问题描述 投票:0回答:2

我们一直坚持这个错误几周,尝试从Stack Overflow上的相同问题的答案的所有建议之前。

enter image description here

我们已经尝试检查Index.js,MainActivity.js中的应用程序名称匹配以及我们维护的名为app.json的参数文件。

我们面临的问题是'npm start'被卡在加载依赖图,完成...消息,并且react-native运行android生成一个apk,给出'应用SmartMedi未注册'。

代码部分复制如下。

main activity.Java

package com.SmartMedi;

import com.facebook.react.ReactActivity;
import com.calendarevents.CalendarEventsPackage;
public class MainActivity extends ReactActivity {

    /**
     * Returns the name of the main component registered from JavaScript.
     * This is used to schedule rendering of the component.
     */
    @Override
    protected String getMainComponentName() {
        return "SmartMedi";
    }
    @Override
  public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
      CalendarEventsPackage.onRequestPermissionsResult(requestCode, permissions, grantResults);
      super.onRequestPermissionsResult(requestCode, permissions, grantResults);
  }

}

app.json

    {
  "name": "SmartMedi",
  "displayName": "SmartMedi"
}

index.js

    /** @format */

import {AppRegistry} from 'react-native';
import App from './src/components/Main';
//Registration,Main,SearchScreen

import {name as appName} from './app.json';
// type Props = {};


console.disableYellowBox = true;

AppRegistry.registerComponent(appName, () => App);

的package.json

{
  "name": "SmarMedi",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
...
    "babel-core": "^6.26.3",
    "babel-loader": "^7.1.5",
...
    "native-base": "^2.7.2",
    "react": "16.4.1",
....
    "react-native": "^0.55.4",
.....
}
android react-native apk
2个回答
0
投票

你的package.json有"name": "SmarMedi"SmartMedi缺少T.


0
投票

当您运行应用程序时会发生这种情况,但您忘记关闭之前项目打开的地铁捆绑包。在模拟器上卸载应用程序,重新启动终端并重新运行项目。

© www.soinside.com 2019 - 2024. All rights reserved.