MindscapeHQ / raygun4reactnative

ReactNative crash reporting SDK for Raygun
MIT License
3 stars 3 forks source link

No package name found #81

Closed RLangridge closed 1 month ago

RLangridge commented 3 months ago

Hi there,

I'm attempting to build my react-native app for iOS with raygun4reactnative. When I run

pod install --verbose

I get the following output:

error Failed to build the app: No package name found. We couldn't parse the namespace from neither your build.gradle[.kts] file at /Users/myuser/MyApp/node_modules/raygun4reactnative/android/build.gradle nor your package in the AndroidManifest at null.

 #  from /Users/myuser/MyApp/ios/Podfile:9
 #  -------------------------------------------
 #  target 'MyApp' do
 >    config = use_native_modules!
 #  
 #  -------------------------------------------

I'm using raygun4reactnative version 1.4.2, react-native 0.70.15.

Any ideas as to why I'm getting this error that seemingly has to do with Android when I'm attempting to do a build for iOS? When I don't have raygun in my project, iOS builds correctly. Thank you.

alainib commented 1 month ago

any fix please ?

dziter commented 1 month ago

Same issue after having to update to 1.4.2 to avoid crash on Xcode 16 (following recent iOS 18 release). Any help will be greatly appreciated, thanks.

BlakeHenry commented 1 month ago

I encountered the same issue when running RN 0.73.6. But after upgrading to RN 0.75.3 we now get a different error which only occurs if raygun4reactnative is installed.

[!] Invalid `Podfile` file: exit.

 #  from /Users/MyUser/MyApp/ios/Podfile:36
 #  -------------------------------------------
 #      end
 >      config = use_native_modules!
 #  
 #  -------------------------------------------

[!] The command: 'node -e process.argv=['', '', 'config'];require('@react-native-community/cli').run()' returned a status code of 1
nzcodarnoc commented 1 month ago

I'm here trying to get it working on Xcode 16 with the same problem. "raygun4reactnative": "^1.4.2" "react-native": "0.73.2",

[!] Invalid `Podfile` file: unexpected token at ''.

 #  from /Users/.../ios/Podfile:64
 #  -------------------------------------------
 #  target 'MyAppName' do
 >    config = use_native_modules!
 #
 #  -------------------------------------------
Pallesen01 commented 1 month ago

Hi Everyone,

Thanks for bringing this issue to our attention. We're looking into this now and will update when we have more info.

Cheers, Daniel

MathewGrayRev commented 1 month ago

You can patch-package this while the Raygun team resolves on their end by adding a namespace to the node_modules/raygun4reactnative/android/build.gradle file at this line. In my case, the android closure looks as follows:

android {
    compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
    buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
    namespace "com.raygun.react" // this is what was added
    defaultConfig {
        minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
        targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
        versionCode 1
        versionName "1.0"
    }
    lintOptions {
        abortOnError false
    }
}

Afterwards, Xcode 16 will likely throw an error on the Raygun_KSMachineContext file when you attempt to build, you need to include the following types file inside of the #ifdef - #include <sys/_types/_ucontext64.h>. While this isn't a solution as the raygun4apple Pod will need to be updated to include this, it will at least unblock development on Xcode 16.

Pallesen01 commented 1 month ago

Hi Everyone!

We've just released raygun4reactnative 1.4.3 to address this issue. That's for raising this! 🎉

dziter commented 1 month ago

@Pallesen01 : Hi,

There is a small typo on the last commit resulting in a build issue for React Native.

Please find the PR fixing it here: https://github.com/MindscapeHQ/raygun4reactnative/pull/83