Solana Anchor deploy error. bump targets should not be provided with init. please use bump without a target - deployment

When I run anchor deploy, I am getting this error.
bump targets should not be provided with init. please use bump without a target
How can I fix it?

What version of anchor you running ?
0.21.0 added breaking change with bumps
https://github.com/project-serum/anchor/blob/master/CHANGELOG.md
lang: Providing bump = targets with init will now error. On init only, it is required to use bump without a target and access the seed inside function handlers via ctx.bumps.get("<pda-account-name"). For subsequent seeds constraints (without init), it is recommended to store the bump on your account and use it as a bump = target to minimize compute units used

Related

How to make Tilt rebuild images that are installed using helm_resource()?

The problem with helm() function is that it does not respect pre- install/upgrade hooks of the services. However, the only usable replacement helm_resource() does not rebuild/republish images on local changes (because of it's notion of "remote" resource).
How to make service images to be rebuilt and republished when using helm_resource() automagically, just like the helm() did?

Getting started with Azure Spatial Anchors: CreateAzureAnchor() crash or taking a long time to load

I have been following this tutorial:
https://learn.microsoft.com/en-us/windows/mixed-reality/develop/unity/tutorials/mr-learning-asa-02
there were some necessary configurations and steps not included in the tutorial like:
it needed an ARCameraManager error log
it needed an ARSession error log
it needed an ARAnchorManager error log
which I configured as I keep getting errors and fixing it along the way
and was able to deploy, test and follow the in-device tutorial:
Move the cube to a different location
Start Azure Session
Create Azure Anchor (creates an anchor at the location of the cube).
......
but I got stuck in #3
when I tap for create Azure button, it just crash but when I check the Debug version, it didn't actually crash cause there were no actual errors, I think it just keeps loading and/or working on the current main thread because everything disappeared when I tap the create Azure Button.
I check the codes of its corresponding function and this is it:
as you may notice it has an error, this is the actual script from the package I download, but all I had to do to fix this is add ".Result" after ".GetPointer()"
I divided the script and added logs so I can see which part is the problem:
the very last to log is: "tastInpt" which means getting the result is the problem.
is this fixable? can anyone help me get through this?
Could you provide little more info about your environment? For example, Unity version, Azure Spatial Anchors (ASA) SDK version and OS version of your HoloLens 2 device.
Are you using the matching ASA SDK for your Unity? In the tutorial you mentioned above has a link to this page: https://learn.microsoft.com/en-us/azure/spatial-anchors/how-tos/setup-unity-project?tabs=unity-package-web-ui
Some common mistakes includes the version mismatch - Unity 2019 requires ASA SDK 2.7 or above and below 2.9, and Unity 2020 requires min version of 2.9.
Was able to fix this on my own by using this:
a github repository of Azure samples. I actually don't know why this worked but the samples from Microsoft didn't. but here you go:
https://github.com/Azure/azure-spatial-anchors-samples
I just realize my fix for that error:
gameObject.GetComponent<UnityEngine.XR.WSA.WorldAnchor>().SetNativeSpatialAnchorPtr(currentCloudAnchor.LocalAnchor);
is just to comment it out since I thought this won't be necessary, because I was yet to start development and as I understand (from reading the code) that this is just for loading the anchor not creating it, but I might be wrong. but anyway It's one of the things we must fix also in order to load. or create(if this does indeed help with the create anchor feature)
again this script is from:
MRTK.HoloLens2.Unity.Tutorials.Assets.AzureSpatialAnchors.2.5.3.unitypackage

Update android internal test app in developer console

We have an app launched in google playstore.I made some changes to the app and uploaded a new version to the internal test track. While doing the internal test, we identified an issue and i wanted to update internal test app "with the same version number". Since the app is not released to Alpha or beta test, is it possible to update it? If so how do i do that?
Just had the same problem, this is what I found out:
According to the Docs (https://support.google.com/googleplay/android-developer/answer/113476?hl=de) the version code must be higher for an update.
Just increment it, as it is not shown to the user anyways. The release-name, which is shown to the user, can stay the same.
So to update, I tried the following:
On the internal test track, click 'Manage'
Inside of this track, click 'Create Release'
Set everything up as you want (there is a copy from previous release option at the bottom), just make sure the version code has been incremented, so you can upload your apk. Then, check and release the app.
Once you are done, previous bundles are no longer provided, and existing testers should be able to update.
Hope this works for you.

SonarQube cloud for swift not showing any warning for force unwrap

We are trying SonarQube cloud for swift to verify if it's giving a warning for force unwrap.
Its showing other bugs, code smells properly but not showing anything for force unwrap.
So can anyone confirm if cloud version supports warning/bugs for force unwrap?
There is rule "Optionals should not be force-unwrapped" with key S2966. It's not activated in default profile. That's why probably you don't get any issue for it.
You should create your own profile extending default one and add this rule to it.

How to configure independent sets of runtime settings in Xcode

My iPhone application connects to three different servers, say: production, staging and testing. There is a bunch of configuration values that the application uses depending on to which server it connects to, e.g. Facebook App ID, TestFlight team key, etc.
I'd like to have all the settings in GIT and only select which configuration the application supposed to use when compiling or releasing. For example, when testing is selected, Product -> Run in Xcode runs the debug version of the app connecting to testing, and Product -> Archive creates the IPA file with the release version that also connects to testing.
I don't want to create more build configurations than debug and release (because that would mean 6 different combinations of build configurations/run-time configurations). The ideal solution, as I see it, would be that I have three schemes: production, testing and staging, and each scheme selects one of three Info.plist files to use with the application. That would allow me to not only define different run-time settings, but also different application versions or bundle identifiers depending on the back-end server. But it doesn't look like I can configure the Archive action in any other way apart from selecting a different build configuration. Any ideas if that could be achieved in any way?
Edit: To make it a bit more clear, production/staging/testing is the back-end server, not the version of the iOS application. The iOS app comes in two versions: debug/release. In other words I may want to run a debug version of the application connecting to the production server for example to debug a crash caused by JSON returned from that server. I could have named the servers as A, B and C for the sake of clarity.
A good way to do this would be with build configurations and C macros. This avoids having to create a separate target for every configuration which is not really the correct use of targets.
First you want to set up the configurations at the project level:
You can create different configurations for debugging, enterprise distribution, and any other type of special build you want.
Next you can define some macro flags for each configuration which will be passed to the compiler. You can then check for these flags at compile time. Find the "Preprocessor flags" build setting at the target level:
If you expand the triangle you can define different values for each of your configurations. You can define KEY=VALUE or just KEY macros here.
In your code, you can check for the existance of these macros, or their value (if there is one). For example:
#ifdef DISABLE_FEATURE_X
featureXButton.hidden = YES;
#endif
// ...
#if FOOBAR_VISIBLE == 0
foobarView.hidden = YES;
#elif FOOBAR_VISIBLE == 1
foorbarView.hidden = NO;
#else
#error Invalid value for FOOBAR_VISIBLE
#endif
You can pass in string values as well, which must be wrapped with single quotes in the build setting, e.g. DEFAULT_LOCALIZATION_NAME='#"en"'.
You can also configure which configuration is used during Debug and Archive time using the Schemes editor. If you choose "Run" or "Archive" in the Schemes editor you can select the appropriate configuration.
If you need to parameterize entries in the Info.plist file, you can define their value using a custom build setting. Add a custom build setting for your target:
And then give it an appropriate value for your different configurations:
Then in the Info.plist file you can reference this setting:
Note that the one limitation of this approach is that you cannot change the following items:
Settings.bundle
Additionally, in older versions of Xcode without asset catalog support, you cannot change the following items:
Icon.png
Default.png
These cannot be explicitly defined in the Info.plist file or anywhere else, which means you need different targets to change them.
I would suggest using different build targets for each environment. I successfully used this model before. In your project's settings you can duplicate the current target and change the build settings as needed. There's an Info.plist File property that will let you change the default plist for that target.
After that, you can create a scheme for each environment that will use the according target.
You can get a step further and use different bundle id for each target and different names. That will allow you to install both the staging and the production builds on the same device for example.
The only downside in this is that you have more work when you want to update provisioning profiles.
Here's a much easier solution if the concerned libs allow to set the keys in code, meaning that you can have production value in your plist file, but change them in your AppDelegate (or whichever file they are first used in).
Works with facebook, twitter and google sdk at the moment.
Ex:
#ifdef DEBUG
// Facebook
[FBSettings setDefaultAppID:#"SandboxID"];
// Fabric / TwitterKit - must be called above [Fabric with:#[TwitterKit]];
[[Twitter sharedInstance] startWithConsumerKey:#"SandboxKey" consumerSecret:#"SandboxIDSecret"];
#endif
Same in Swift, just use #if instead of #ifdef.
Note about Facebook This worked with version 3 of their SDK, I'm not sure it's possible with later versions.
It is probably very low tech but I just have a method called apiURL() that returns the URL of the API I want. I have localhost, stage, and production and I simply uncomment the one I want. It's worked well for me so far. I've only forgotten to switch it back a few times. Oops.