Wie setze ich mehrere Spezifikationen für iOS -Turbomodule fest?IOS

Programmierung für iOS
Guest
 Wie setze ich mehrere Spezifikationen für iOS -Turbomodule fest?

Post by Guest »

Ich nehme eine Referenz aus dem offiziellen Dokument, es funktioniert. Aber wenn ich versuche, mehrere Spezifikationen für iOS festzulegen, erhalte ich den Fehler < /p>

Code: Select all

10 duplicate symbols
Linker command failed with exit code 1 (use -v to see invocation)
Hier ist, was ich versuche:
Schritt 1 npx @react-nativ-community/cli @neueste init FirstApp

Code: Select all

"react-native": "0.77.0",
< /code>
Schritt 2 Hinzufügen von CodeGen -Einstellung in 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"
}
}
]
},
Schritt 3 Datei hinzufügen Unter den Spezifikumsordnern (RN -Root -Projekt)
specs/nativebluetooth.ts

Code: Select all

import type { TurboModule } from 'react-native';
import { TurboModuleRegistry } from 'react-native';

export interface Spec extends TurboModule {
enableBluetooth(): void;
}

export default TurboModuleRegistry.getEnforcing('NativeBluetooth');
specs/natelocalstorage.ts

Code: Select all

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>
Schritt 4 TYPE -Terminalbefehl < /p>
cd ios

bundle install

bundle exec pod install
< /code>
und öffnen Sie Xcode Build Das Projekt Erhalten Sie den Fehler: < /p>
10 duplicate symbols

Linker command failed with exit code 1 (use -v to see invocation)
Was ist das Problem?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post