Код: Выделить всё
10 duplicate symbols
Linker command failed with exit code 1 (use -v to see invocation)
Шаг 1 npx @React-community/cli @andal init firstapp
Код: Выделить всё
"react-native": "0.77.0",
< /code>
Шаг 2 Добавить настройку codegen в package.json < /p>
"codegenConfig": {
"libraries": [
{
"name": "NativeLocalStorageSpec",
"type": "modules",
"jsSrcsDir": "specs",
"android": {
"javaPackageName": "com.nativelocalstorage"
}
},
{
"name": "NativeBluetoothSpec",
"type": "modules",
"jsSrcsDir": "specs",
"android": {
"javaPackageName": "com.nativebluetooth"
}
}
]
},
specs/nativebluetooth.ts
Код: Выделить всё
import type { TurboModule } from 'react-native';
import { TurboModuleRegistry } from 'react-native';
export interface Spec extends TurboModule {
enableBluetooth(): void;
}
export default TurboModuleRegistry.getEnforcing('NativeBluetooth');
Код: Выделить всё
import type {TurboModule} from 'react-native';
import {TurboModuleRegistry} from 'react-native';
export interface Spec extends TurboModule {
setItem(value: string, key: string): void;
getItem(key: string): string | null;
removeItem(key: string): void;
clear(): void;
}
export default TurboModuleRegistry.getEnforcing('NativeLocalStorage');
< /code>
Шаг 4 Тип команды терминала < /p>
cd ios
bundle install
bundle exec pod install
< /code>
, а затем откройте xcode Создайте проект. Получить ошибку: < /p>
10 duplicate symbols
Linker command failed with exit code 1 (use -v to see invocation)
Подробнее здесь: https://stackoverflow.com/questions/794 ... urbomodule
Мобильная версия