2015년 1월 1일 목요일

ERROR: duplicate declaration of ...


I have problem with my App. When i want to bild APK file it writes:

ERROR: appinventor/ai_fausekmatej1/KvadratickeRovnice/Screen3.yail line 261: duplicate declaration of 'X1'
ERROR: appinventor/ai_fausekmatej1/KvadratickeRovnice/Screen3.yail line 197: (this is the previous declaration of 'X1')

I tried to renamed all my blocks. But it is still here. AppInventor doesn't show me any mistakes.

What I can do with it? Or how I can see what is on line X ?

--
find the red warning in your blocks and fix the problem before building the app probably there is a duplicate definition of a global variable named X1?

--
If possible, use local variables for X1 in your blocks.

Then delete your global X1 declarations.

Though AI2 has no search capability, the Chrome browser's Ctrl-F Find capability can highlight visible instances of text like X1. You might need to shrink your view using Ctrl-- and squint to see them all.

Collapsing your blocks in place might help shift your hay stack.

--
Thank you both. But there are not any red warnings ...

--
ok, let' s guess a little bit...

did you define a global variable named X1 in Screen3?
probably you forgot about it?
just right click onto the background of the blocks editor and select "Collapse Blocks" and then "Arrange blocks vertically" to get a better overview about your blocks

also It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

--
I tried to renamed all blocks and all global variables. The ERROR dissapear. But there are new ERRORS ... on 10 lines in screen3. It is: call to 'set-and-coerce-property!' has too many arguments (5; must be 4) ... What does it mean ?? Im begginer in App Inventor. My app is about Quadratic equations. On Screen 3 I only constitute right numbers to formulary. I use labels for it. I also use TinyDB for keeping numbers from Screen2 where are the all things what I need for calculating.

--




Ok, these are screenshots of my App. I tried make new App, but witjout doing anything with blocks. So, there was same errors. I renamed my labels with using _. And 1st error disappeared. But now i have errors: set and coerce property. I looked on internet and I found it can be because a lot of Arrangement .. I have 15 Vertical and Horizontal Arrangements.

Do you think it can be because it ?? 

--
On close examination of your Designer screen shot, I see commas in the component names.

I'll bet a nickel that's poisoning the JSON and XML representation of your app in AI2.

Go through the Designer, and remove all those commas in the component names. Also go through the Blocks Editor after that and remove commas from all variable names.

Let us know if that helped. If that doesn't work, you might have to start all over or do risky surgery on your .aia file, using 7ip and Notepad.

--
When I wrote there the commas the ERROR (duplicate of declaration) disapears. Do you think it is the reason of ERROR - set-and-coerce-property ??

--
Eliminating all your commas in names is necessary.
Is it sufficient?
That I do not know.

Eliminate all the commas in the names.

--
It works :). Thank you so much ;)

--
Export an .aia file and put it somewhere safe.

Storm clouds follow you.

--
What? What does it mean ?? (Sorry im not expert for AppInventor) And what can I do with file .aia ??

--
Save a .aia file:
http://appinventor.mit.edu/explore/ai2/share.html

I apologize for the storm cloud reference - You discovered a rare gap in App Inventor's armor. I extrapolated from that a capacity for bad luck. Does lightning strike twice in the same place  http://en.wikipedia.org/wiki/Joe_Btfsplk

--
What is the Storm Cloud Reference ??

--
OK, So what i can do for you ? 

--
And what can I do with file .aia ??
it is advisable to make backups of your project frequently, to be prepared for a second lightning strike ;-) as ABG said... see also Enis' tips here http://twodogapps.com/?page_id=686

--

댓글 없음:

댓글 쓰기