React Native CLI Android APK - react-native

I am building APK for android in React Native CLI but during the building process. I am getting errors:
Execution failed for task ':app:processBugsnagE2eFossReleaseManifest'.
Bugsnag: Your AndroidManifest.xml is missing one or more of
apiKey/versionCode/buildUuid/versionName/package, which are required to upload to bugsnag.
apiKey=null
versionCode=999999999
buildUUID=beab08fe-8a94-4edf-bb62-ff84eef7bd8f
versionName=4.24.0
applicationId=botx7.Chat
Anyone please guide

https://github.com/RocketChat/Rocket.Chat.ReactNative/issues/3422#issuecomment-957513622
android/app/src/main/AndroidManifest.xml
....
<meta-data android:name="com.bugsnag.android.API_KEY" android:value="${BugsnagAPIKey}" />
</application>

Related

React native problem with android:exported="true" in other library

React native application. Despite having entered in the manifest android:exported="true" i still have this problem in the build phase. It almost seems that some installed plugins did not insert it.
I read in some posts that proposed as a temporary solution to downgrade to version 30 of the android SDK, but i cannot because with that version it does not allow me to compile.
React Native 0.68
Android SDK version 33
Android Gradle Plugin version 7.3.0
From Merged Manifest
Error: android:exported needs to be explicitly specified for element <activity#androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity>. Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. mobile_app.app debug manifest, line 26 Error: android:exported needs to be explicitly specified for element <activity#androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity>. Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. mobile_app.app debug manifest, line 33
Based on the response from Aleja Duque-Torres, here's a temporary solution by adding the following code segment to your AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="...your package name"
xmlns:tools="http://schemas.android.com/tools"> <!-- ADD THIS LINE -->
<!-- Other Content -->
<application
.../>
<!-- ADD STARTS HERE -->
<activity
android:name="androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity"
android:exported="false"
tools:replace="android:exported"/>
<activity
android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity"
android:exported="false"
tools:replace="android:exported"/>
<activity
android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity"
android:exported="false"
tools:replace="android:exported"/>
<!-- ADD ENDS HERE -->
</application>
</manifest>
Then do a build folder clean and run the project again. Hope this helps!
P.s. my guess is that this problem is due to some dependency package getting messed up. If someone else has any insight please feel free to shed some light on it!
solution:
In Git-bash run: * ./gradlew assembleDebug --stacktrace --info | tee my-logs.txt
Search "InstrumentationActivityInvoker"
Open file and add android:exported="true" on activity
Same issue, But I can't know the reason for it. It happens when I have updated macos, Do you have any information?

Expo Apple Pay Stripe Merchant Identifier Issue

I am trying to implement Apple Pay on my Expo managed app.
I followed the documentation here https://stripe.com/docs/apple-pay except adding the capability in XCode (because it's an Expo app and it doesn't use Expo).
I have included my merchant ID in the plugins folder in my app.json.
And I have also wrapped my whole app in the <StripeProvider /> and included the merchantIdentifier there.
<StripeProvider merchantIdentifier="merchant.xxx.xxx.xxx" >
<App />
</StripeProvider>
enter code here
I believe that I've followed the documentation laid out by Expo and Stripe.
If I run expo config --type introspect I can see the entitlement there:
ios: {
entitlements: {
'aps-environment': 'development',
'com.apple.developer.in-app-payments': [
'merchant.com.xxx.xxx'
]
},
I then run eas build -p ios and create an ipa file. I then upload that to TestFlight to give the functionality a test on a real device.
But as soon as I try to call presentApplePay(), I get the error You must provide merchantIdentifier.
What am I missing here? Any help would be greatly appreciated.
You must include the publishableKey as well.

appcenter error build for reactnative, looking for index.ios.js

I have a react native project that I want to use appcenter with,
when building the project, I get the following error:
========================== Starting Command Output ===========================
[command]/bin/bash --noprofile --norc /Users/vsts/agent/2.155.1/work/_temp/4371836d-ad98-4059-84bc-f7bc51688d63.sh
Found index.ios.js for ReactNative index.
warning: the transform cache was reset.
error The resource /Users/vsts/agent/2.155.1/work/1/s/index.ios.js was not found.. Run CLI with --verbose flag for more details.
[error]Bash exited with code '1'.
But my react native project was created with expo, and in new schema after ejecting there is no index.ios.js or index.js
I also found this entry talking about it,
but dont understand yet how to add the index.js script
https://github.com/microsoft/appcenter/issues/189
thanks
This is a known issue and being track in GitHub. There is also a documented workaround on the GitHub Issue.
https://github.com/microsoft/appcenter/issues/189

Detox field CFBundleIdentifier not found inside Info.plist

Following Expo usage guide for detox and getting error below when running detox test.
Using:
"detox": "^10.0.10",
"detox-expo-helpers": "^0.6.0",
"expo-detox-hook": "^1.0.10"
IPA made with :
xcode v 9.4.1
expo v 31.0.6
Also tried IPAs built with xcode v10 and expo v 32.0.0, same error.
Error:
Error: field CFBundleIdentifier not found inside Info.plist of app binary at /Users/admin/Desktop/expo-test/bin/gogonow.app
at SimulatorDriver.getBundleIdFromBinary (/Users/admin/Desktop/expo-test/node_modules/detox/src/devices/drivers/SimulatorDriver.js:70:13)
Try with in the detox configuration
you should take care of .app path, xcodeproj path, Scheme[The app name] and the info.plist path.
This should work..

React Native and Facebook SDK on Android

I can't seem to get React Native FBSDK work on Android. I completed all the steps from registering the app to configuring the manifest file (can be found on this page: https://developers.facebook.com/docs/react-native/configure-android-current)
When I run the app I get the error: The SDK has not been initialized, make sure to call FacebookSdk.sdkInitialize() first. I am using the latest version of react-native-fbsdk so the method above is deprecated. Also if I put the call into the main application class, the app crashes on startup.
So I'm kind of stuck here. Everything runs smooth on iOS but Android gives me headaches.
As you haven't shown code it's hard to know, but make sure you have:
#Override
public void onCreate() {
super.onCreate();
FacebookSdk.sdkInitialize(getApplicationContext());
// If you want to use AppEventsLogger to log events:
AppEventsLogger.activateApp(this);
SoLoader.init(this, /* native exopackage */ false);
}
in your MainApplication class (MainApplication.java)--at least, I didn't see that mentioned in the link you provided. Good luck
I have the same issue and I realize that I have to complete all steps to configure the native facebook sdk for android. Its mean you need to have a facebook account for this work.
What you need to do next is:
In your project open yourapp/android/build.gradle
Add the Maven Central Repository to build.gradle before dependencies:
repositories {
mavenCentral()
}
Add compile 'com.facebook.android:facebook-android-sdk:[4,5)'to your build.gradle dependencies
Build project
Open your strings.xml file, for example: /app/src/main/res/values/strings.xml.and add <string name="facebook_app_id">xxxxxxxxx</string>
Open your AndroidManifest.xml and add <uses-permission android:name="android.permission.INTERNET"/>
Add meta to application element <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="#string/facebook_app_id"/>
Generate a development key hash
You can see detail in quick start of developer facebook page (developers.facebook.com/quickstarts)