Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The type or namespace name 'HmsPlugin' could not be found #490

Closed
PromanSEW opened this issue May 1, 2024 · 3 comments
Closed

The type or namespace name 'HmsPlugin' could not be found #490

PromanSEW opened this issue May 1, 2024 · 3 comments
Assignees

Comments

@PromanSEW
Copy link

Describe the bug & problem
When I try to build APK, Unity logs this error to console, but when I run in editor there is no error.
I enabled the plugin in settings

My code:

using HmsPlugin;
using HuaweiMobileServices.IAP;

public class BuyGoldAppGallery : BuyGoldDialog {

	protected override void Awake() {
		base.Awake();
		HMSIAPManager.Instance.OnBuyProductSuccess += OnPurchaseSuccess;
		HMSIAPManager.Instance.OnBuyProductFailure += OnPurchaseFailed;
	}

	private void OnDestroy() {
		HMSIAPManager.Instance.OnBuyProductSuccess -= OnPurchaseSuccess;
		HMSIAPManager.Instance.OnBuyProductFailure -= OnPurchaseFailed;
	}

	private void OnPurchaseSuccess(PurchaseResultInfo info) {
		OnPurchaseSuccess(int.Parse(info.InAppPurchaseData.ProductId[5..]));
	}

	private void OnPurchaseFailed(int error) {
		OnPurchaseFailed();
	}

	public void Purchase(string productId) {
		HMSIAPManager.Instance.PurchaseProduct(productId);
	}
}

Screenshots & Detailed log

Assets\Scripts\UI\Dialogs\BuyGoldAppGallery.cs(1,7): error CS0246: The type or namespace name 'HmsPlugin' could not be found (are you missing a using directive or an assembly reference?)

Environment (please complete the following information):

  • Unity Version: 2021.3.37f1
  • HMS Unity Plugin Version: V2.3.7

Smartphone (please complete the following information):

  • Device: [e.g. Huawei, Non-Huawei, Cloud Debugging]

Additional context

  • Are there any 3rd party solutions you use that may be linked to the problem?
Copy link

github-actions bot commented May 1, 2024

Thank you for reporting this issue/advice.

We will get back to you as soon as possible.
Would you like to star our plugin to support us? ✨

@PromanSEW
Copy link
Author

Fixed. Unity broke asmdef
photo_2024-05-01_23-01-47

Copy link

github-actions bot commented May 1, 2024

Thank you for using our repository! We're glad we could help solve your issue. If you found our repository helpful, please consider giving us a star ⭐ on GitHub: https://github.com/EvilMindDevs/hms-unity-plugin

Your support helps us continue to improve our repository and provide valuable resources for others.

@alihan98ersoy alihan98ersoy removed the new label May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants