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

Creating from existing component block doesn't work anymore #38

Closed
ysfchn opened this issue Jan 8, 2021 · 2 comments
Closed

Creating from existing component block doesn't work anymore #38

ysfchn opened this issue Jan 8, 2021 · 2 comments
Labels
status: done Implemented already with a commit type: bug Something isn't working

Comments

@ysfchn
Copy link
Owner

ysfchn commented Jan 8, 2021

image

Related post

image

Image source

Possible Cause:

@SimpleFunction(description = "Creates a new dynamic component.")
public void Create(final AndroidViewComponent in, Object componentName, final String id) throws Exception {
componentName = componentName.toString().replaceAll("[^a-zA-Z0-9]", "");
if (!COMPONENTS.containsKey(id)) {
lastUsedId = id;
String mClassName = BASE + componentName;

Because of that, it appends the BASE value again even if the component name already includes the com.google.appinventor.components.runtime package name. It must delete this piece from the component name too if it already exists.

Possible Fix:

Add another replace method to remove com.google.appinventor.components.runtime. from component name.

@ysfchn ysfchn added the type: bug Something isn't working label Jan 8, 2021
@hammerhai
Copy link
Contributor

I will take care of this today. Thanks for reporting it.

ysfchn pushed a commit that referenced this issue Jan 8, 2021
* Fixes complications

Fixes issue #38 and Regex removing symbols from the class names that may be required to identify the component.

* Fixes build error

* Fixes improper class name

* Let's try again

* Modify invalid component error
@ysfchn
Copy link
Owner Author

ysfchn commented Jan 8, 2021

Fixed with #39

@ysfchn ysfchn closed this as completed Jan 8, 2021
@ysfchn ysfchn added the status: done Implemented already with a commit label Jan 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: done Implemented already with a commit type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants