Appcenter build successful but can't find APK file - React Native - react-native

We are facing issues with React-Native in AppCenter. We are Once I run the build, everything goes well but at end we are facing below issue.
No addition pre or post script added in AppCenter.
Execution optimizations have been disabled for 12 invalid unit(s) of work during this build to ensure correctness.
Please consult deprecation warnings for more details.
**BUILD SUCCESSFUL** in 11m 32s
362 actionable tasks: 351 executed, 11 up-to-date
##[section]Finishing: Gradle Task
##[section]Starting: Android Postprocess
==============================================================================
Task : Shell script
Description : Run a shell script using Bash
Version : 2.212.0
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/shell-script
==============================================================================
[command]/bin/bash /Users/runner/runners/2.214.1/scripts/android-postprocess.sh /Users/runner/work/1/s/android/app/build/outputs/apk
Removing all ABI or density dependent APKs…
Found 0 APK file(s)
Found 0 unaligned APK file(s)
~/work/1/s/android/app/build/outputs ~/runners/2.214.1/scripts
~/runners/2.214.1/scripts
##[section]Async Command Start: Add Build Tag
Build '16' has following tags now: normal, android-app-bundle, javascript, android, manual, signed, mapping, distribution
##[section]Async Command End: Add Build Tag
##[section]Finishing: Android Postprocess
##[section]Starting: Sign APK
==============================================================================
Task : Android signing
Description : Sign and align Android APK files
Version : 3.201.0
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/android-signing
==============================================================================
##****[error]Error: No matching files were found with search pattern: ****/Users/runner/work/1/s/android/app/build/**/*.apk
##[section]Finishing: Sign APK
##[section]Starting: Sign APK
==============================================================================
Task : Android signing
Description : Sign and align Android APK files
Version : 3.201.0
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/android-signing
==============================================================================
##[section]Finishing: Sign APK
##[section]Starting: Checkout XXXXXXX#development to s
==============================================================================
Task : Get sources
Description : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version : 1.0.0
Author : Microsoft
Help : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
Cleaning any cached credential from repository: XXXXXXX (ExternalGit)
##[section]Finishing: Checkout XXXXXXX#development to s
##[section]Starting: Finalize Job
Cleaning up task key
Start cleaning up orphan processes.
Terminate orphan process: pid (23181) (java)
Terminate orphan process: pid (22867) (java)
Terminate orphan process: pid (11113) (java)
Terminate orphan process: pid (7987) (java)
##[section]Finishing: Finalize Job
##[section]Finishing: Build
I tried with all the options but unable to resolve the issues.

I got the answer of my own question. As per Appcenter document you need to set universalApk to true. This is the only way in Appcenter weather you plan to make multiple apk to reduce the size.

Related

Command PhaseScriptExecution failed with a nonzero exit code. Bugsnag source map upload connection timed out

I am trying to white label this github repo.
https://github.com/RocketChat
Here is the white label guide that the RocketChat has provided.
https://developer.rocket.chat/mobile-app/mobile-app-white-labelling/ios-app-white-labelling
This library is for react native. I am facing this issue when I try to run the project.
The project is failing the build process with this error.
> PhaseScriptExecution Upload\ source\ maps\ to\ Bugsnag
> /Users/macbook/Library/Developer/Xcode/DerivedData/RocketChatRN-adkttzebukwzincfwduuaihsdgwi/Build/Intermediates.noindex/RocketChatRN.build/Debug-iphoneos/RocketChatRN.build/Script-88055964DAAE45B1A4886C27.sh
> (in target 'RocketChatRN' from project 'RocketChatRN')
> cd /Users/macbook/Rocket.Chat.ReactNative-develop/ios
> /bin/sh -c /Users/macbook/Library/Developer/Xcode/DerivedData/RocketChatRN-adkttzebukwzincfwduuaihsdgwi/Build/Intermediates.noindex/RocketChatRN.build/Debug-iphoneos/RocketChatRN.build/Script-88055964DAAE45B1A4886C27.sh
>
> ℹ Preparing upload of React Native source map (dev / ios) › Reading
> source map
> "/var/folders/sz/jj5jd6j54kd505vxsyxvlk1h0000gn/T//bcd7e9d7452d009ff844f5acf22fb2f3-main.jsbundle.map"
> › Reading bundle file
> "/Users/macbook/Library/Developer/Xcode/DerivedData/RocketChatRN-adkttzebukwzincfwduuaihsdgwi/Build/Products/Debug-iphoneos/main.jsbundle"
> ℹ Applying transformations to source map › Ensuring sourcesContent
> field is populated › Stripping project root from sources › Initiating
> upload to "https://upload.bugsnag.com/react-native-source-map"
ERROR The request timed out.
Connection timed out
at ClientRequest.<anonymous> (/Users/macbook/Rocket.Chat.ReactNative-develop/node_modules/#bugsnag/source-maps/dist/Request.js:190:21)
at Object.onceWrapper (node:events:641:28)
at ClientRequest.emit (node:events:527:28)
at TLSSocket.emitRequestTimeout (node:_http_client:771:9)
at Object.onceWrapper (node:events:641:28)
at TLSSocket.emit (node:events:539:35)
at TLSSocket.Socket._onTimeout (node:net:516:8)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7)
I have tried to remove the source map upload. See Screen Shot 1
It keeps on giving the same error still.
It says bugsnag source map failed to upload and is timing out. I have no prior experience with React Native and I am just trying to white label their code. So any help will be appreciated.
Would you be able to check your package.json file for which version of #bugsnag/source-maps you are using? If you are using anything prior to v2.3.0 of #bugsnag/source-maps you could try updating as it has now increased the default timeout and made some other improvements.
Try this, (M1 Mac only I guess)
Go to the target you want to archive
Build settings ---> Architectures ---> Excluded Architectures
Delete arm64
Also another possible reason could be that Xcode is using an outdated version of Node
By default, Xcode will use the Node binary located at /usr/local/bin/node. Check its version by running:
/usr/local/bin/node -v
node -v
If the first command outputs an older version of Node, simply delete it and replace it with a symlink to the newer one:
rm -rf /usr/local/bin/node
ln -s $(which node) /usr/local/bin/node

React Native, AzureDevops and Fastlane ipa build failing

I'm actually new to AzureDevOps and its been two days I can't seem to find a solution for building my app on AzureDevOps.
Here's what I've done so far:
p12 certificated uploaded and applied in pipeline following this guide Install Apple Certificate
provisioning certificate uploaded and applied in pipeline Install Apple Provisioning Certificate
Now when I try to build my iOS app using fastlane:
cd ios
bundle install
fastlane beta
setup_ci(force=true)
gym(scheme: 'app', workspace: './ios/workspace', verbose: true)
I'm looking for a way to use the p12 and provisioning profiles certificate from Azure DevOps to my gym build. After looking a lot, I found that setup_ci does that automatically for me.
Here is my Fastlane file
platform :ios do
lane :beta do
setup_ci(force=true)
gym(
scheme: 'AlfaCarpeting', workspace: './ios/AlfaCarpeting', verbose: true
)
end
end
And here's my Azure pipeline yml file:
# Node.js with React
# Build a Node.js project that uses React.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://learn.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- master
pool:
vmImage: 'macOS-10.15'
variables:
- group: React Native Variables
steps:
- task: InstallAppleCertificate#2
inputs:
certSecureFile: Certificates.p12
certPwd: $(P12Password)
keychain: 'temp'
deleteCert: true
displayName: Install Apple Certificate
- task: InstallAppleProvisioningProfile#1
inputs:
provisioningProfileLocation: 'secureFiles'
provProfileSecureFile: 'alfaCarpetingBeta.mobileprovision'
displayName: 'Install Apple Provisioning Profile'
- task: NodeTool#0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: |
cd ios
bundle install
fastlane ios beta
displayName: 'Build iOS'
The Logs from AzureDevops
[05:38:20]: $ set -o pipefail && xcodebuild -workspace ./AlfaCarpeting.xcworkspace -scheme AlfaCarpeting -destination 'generic/platform=iOS' -archivePath /Users/runner/Library/Developer/Xcode/Archives/2020-03-21/AlfaCarpeting\ 2020-03-21\ 05.38.20.xcarchive archive | tee /Users/runner/Library/Logs/gym/AlfaCarpeting-AlfaCarpeting.log | xcpretty
[05:38:22]: ▸ ❌ error: /Users/runner/runners/2.165.2/work/1/s/ios/Pods/Target Support Files/Pods-AlfaCarpeting/Pods-AlfaCarpeting.release.xcconfig: unable to open file (in target "AlfaCarpeting" in project "AlfaCarpeting") (in target 'AlfaCarpeting' from project 'AlfaCarpeting')
[05:38:22]: ▸ ❌ error: /Users/runner/runners/2.165.2/work/1/s/ios/Pods/Target Support Files/Pods-AlfaCarpeting/Pods-AlfaCarpeting.release.xcconfig: unable to open file (in target "AlfaCarpeting" in project "AlfaCarpeting") (in target 'AlfaCarpeting' from project 'AlfaCarpeting')
[05:38:22]: ▸ ❌ error: /Users/runner/runners/2.165.2/work/1/s/ios/Pods/Target Support Files/Pods-AlfaCarpeting/Pods-AlfaCarpeting.release.xcconfig: unable to open file (in target "AlfaCarpeting" in project "AlfaCarpeting") (in target 'AlfaCarpeting' from project 'AlfaCarpeting')
[05:38:22]: ▸ ❌ error: No profiles for 'com.AlfaCarpeting' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.AlfaCarpeting'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'AlfaCarpeting' from project 'AlfaCarpeting')
[05:38:22]: ▸ ** ARCHIVE FAILED **
If you open the project in xcode and goto Build Settings -> Signing you'll want to adjust the "Code Signing Style" to Manual. Here's the settings I ended up with (note - I am using fastlane match for cert and profile management):

Android emulator tear down during tests run

guys!
I run my Android tests with Appium on Android emulator. Where I run my tests in sequence emulator sometimes tear down and remaining tests are ignored.
In Appium logs i see this error:
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command 'C:\\Users\\Username\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe -P 5037 -s emulator-5554 shell settings delete global hidden_api_policy_pre_p_apps' exited with code 20'; Stderr: 'cmd: Can't find service: settings'; Code: '20'
Is there anybody face with such problem?
You are trying to run an adb-shell command which is not allowed.
Appium has some in-secure commands that normally it will not allow them to be used.
You can see the commands here: Appium Insecure Features
The adb-shell commands (to change the system settings) is one of them.
Follow the link to how to prevent appium checking this.
How to resolve:
At the beginning of test setup, run this commnad: appium --relaxed-security with command line. Then the appium let you using the insecure feautures during the test.
for example in pyhton you should run os.system(appium --relaxed-security (while having appium directory in the system environment variables path.

Getting BlazeInfoException in IntelliJ from the Bazel plugin

I just installed the Bazel plugin for IntelliJ, and I keep getting this exception:
com.google.idea.blaze.base.command.info.BlazeInfoException: blaze info failed with exit code: -1
java.util.concurrent.ExecutionException:
com.google.idea.blaze.base.command.info.BlazeInfoException: blaze info failed with exit code: -1
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:502)
[...]
at com.google.idea.blaze.base.async.FutureUtil$Builder.lambda$run$0(FutureUtil.java:93)
[...]
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:170)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:548)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:493)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:94)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:157)
at com.google.idea.blaze.base.async.executor.BlazeExecutor$3.call(BlazeExecutor.java:108)
at com.google.idea.blaze.base.async.executor.BlazeExecutor$3.call(BlazeExecutor.java:105)
[...]
Caused by: com.google.idea.blaze.base.command.info.BlazeInfoException: blaze info failed with exit code: -1
at com.google.idea.blaze.base.command.info.BlazeInfoRunnerImpl.runBlazeInfo(BlazeInfoRunnerImpl.java:105)
at com.google.idea.blaze.base.command.info.BlazeInfoRunnerImpl.lambda$runBlazeInfo$2(BlazeInfoRunnerImpl.java:75)
... 6 more
Edit: I am using IntelliJ 2017.3 on MacOS El Capitan 10.11.6, Java JRE 1.8.0, and the Bazel version is 0.8.1-homebrew (the plugin version is 2017.11.20.0.4). I get this error when I try to setup a new Java project (an Hello World with only one class and one BUILD file containing a java_binary similar to this tutorial), and it appears when I click on the Bazel sync button.
The output in the Bazel console is:
Syncing project: Sync (incremental)...
Updating VCS...
Running Bazel info...
Command: info --tool_tag=ijwb:IDEA:community --curses=no --color=no --experimental_ui=no --progress_in_terminal_title=no --
==== TIMING REPORT ====
Sync: 47ms
BazelInfo: 4ms
Timing summary:
BlazeInvocation: 4ms
Sync failed
Command: git diff --name-status --no-renames abc8913346474d12ad45226503438848011929ae
Does anybody have an idea about what is it and/or how to fix it? Thanks!
I found my answer, thanks to this post.
In IntelliJ > Settings > Other Settings > Bazel Settings, the field "Bazel binary location" was empty. For my case, I entered /usr/local/bin/bazel and now it works!

sencha build giving error stbuild exited with non-zero code : 7

I wanted to create .apk file of my sencha application so I executed below command
sencha package build packager.json
but when I executed above command,it generates error as given below.
'C:\Program' is not recognized as an internal or external command,operable program or batch file.
""D:/Android/AndroidSDKr15\tools\android" create project --target android-16 --name chartDemoApp --activity STActivity --path "../build/" --package triumphsys. mobility.chartDemoApp"
Could not run ant with error: 1
Failed to package application
[ERR] stbuild exited with non-zero code : 7
even I have attached my command prompt here and packager.json here.
please help me to resolve it.
I was able to solve the problem by uninstalling "C:\Program files\Sencha Cmd" and again re-installing it at "C:\Sencha" without any spaces in folder name. and it worked for me.