8.0 KiB
Troubleshooting
Solutions for common issues when developing Mosis apps.
Build Errors
"Invalid manifest: missing required field"
Your manifest.json is missing a required field.
Solution: Check these required fields:
{
"id": "com.example.app",
"name": "App Name",
"version": "1.0.0",
"version_code": 1,
"entry": "assets/main.rml",
"author": {
"name": "Your Name",
"email": "you@example.com"
},
"icons": {
"128": "icon.png"
}
}
"Invalid package ID format"
Package IDs must follow reverse domain notation.
Valid:
com.example.myappcom.yourname.calculatorio.github.user.app
Invalid:
myapp(needs domain prefix)Com.Example.App(must be lowercase)com..app(no double dots)com.app.(can't end with dot)
"Entry point not found"
The entry file specified in manifest doesn't exist.
Solution: Verify the path:
"entry": "assets/main.rml"
Check that assets/main.rml exists relative to your manifest file.
"Icon not found"
An icon file specified in manifest doesn't exist.
Solution:
- Check file paths are correct
- Ensure files exist
- Use forward slashes in paths
"icons": {
"128": "icons/icon-128.png"
}
"Package too large"
Package exceeds the 10MB limit.
Solutions:
- Compress images (use TGA or optimized PNG)
- Remove unused assets
- Move large files to external CDN
- Check for accidentally included files
Runtime Errors
"attempt to index nil value"
You're accessing a property on a nil variable.
Common causes:
- Element not found:
-- Bad
local elem = document:GetElementById("typo")
elem.inner_rml = "Hello" -- Error: elem is nil
-- Good
local elem = document:GetElementById("correct-id")
if elem then
elem.inner_rml = "Hello"
end
- Table key doesn't exist:
-- Bad
local data = json.decode(response.body)
print(data.user.name) -- Error if user is nil
-- Good
if data and data.user then
print(data.user.name)
end
"attempt to call nil value"
You're calling a function that doesn't exist.
Common causes:
- Typo in function name:
-- Bad: navigateto (lowercase t)
navigateto("settings")
-- Good
navigateTo("settings")
- Missing permission:
-- Error if 'network' permission not declared
http.get(url, callback)
"Permission denied"
You're using an API without the required permission.
Solution: Add permission to manifest:
"permissions": ["storage", "network"]
"Network request failed"
HTTP request couldn't complete.
Common causes:
- No network permission:
"permissions": ["network"]
- Invalid URL:
-- Bad: missing protocol
http.get("api.example.com/data", callback)
-- Good
http.get("https://api.example.com/data", callback)
- HTTP not allowed (HTTPS only):
-- Bad
http.get("http://example.com/data", callback)
-- Good
http.get("https://example.com/data", callback)
- CORS error: The server doesn't allow cross-origin requests. Contact the API provider or use a CORS proxy.
"Storage quota exceeded"
You've exceeded the 5MB storage limit.
Solution:
- Clear unnecessary data:
storage.clear() - Use selective removal:
storage.remove("large-key") - Store only essential data
- Consider using network storage for large data
UI Issues
Element not displaying
Check:
- Display not set to none:
/* Element might be hidden */
.element {
display: none; /* Remove this */
}
- Size is zero:
.element {
width: 0; /* Add dimensions */
height: 0;
}
- Element is off-screen:
.element {
position: absolute;
left: -1000dp; /* Move to visible area */
}
- Z-index issues:
.element {
z-index: 1; /* Bring to front */
}
Click events not working
Check:
- Function exists:
<button onclick="handleClick()">Click</button>
-- Make sure function is defined
function handleClick()
print("Clicked!")
end
-
Element is overlapped: Another element might be blocking clicks. Check z-index and position.
-
Element has pointer-events: none:
.element {
/* Remove this */
pointer-events: none;
}
Styles not applying
Check:
- Stylesheet is linked:
<head>
<link type="text/rcss" href="styles.rcss"/>
</head>
- Selector is correct:
/* Class selector needs dot */
.my-class { }
/* ID selector needs hash */
#my-id { }
/* Tag selector has no prefix */
button { }
- Specificity issues: More specific selectors override less specific ones:
/* Less specific */
button { color: blue; }
/* More specific - wins */
.btn.primary { color: red; }
- Units are correct:
/* Use dp units */
padding: 12dp;
/* Not px on mobile */
padding: 12px; /* May not work correctly */
Layout breaks on different screens
Solutions:
- Use dp units instead of px:
padding: 16dp; /* Scales properly */
- Use flexbox:
.container {
display: flex;
flex-direction: column;
}
- Use percentage widths:
.card {
width: 90%;
max-width: 400dp;
}
Text is cut off
Solutions:
- Allow wrapping:
.text {
word-break: break-word;
}
- Add overflow scrolling:
.container {
overflow: auto;
}
- Use ellipsis (if supported):
.text {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
Designer Issues
Hot reload not working
Solutions:
- Save the file - Changes only reload on save
- Check file is in watch path
- Restart designer - Sometimes needed after many changes
- Check for syntax errors - Invalid files may not reload
Designer crashes on startup
Solutions:
- Check file paths:
# Make sure path exists
mosis-designer.exe ../assets/main.rml
- Try a simple file first:
<rml>
<head><title>Test</title></head>
<body><p>Hello</p></body>
</rml>
-
Check for missing assets: Images or fonts that don't exist can cause crashes.
-
Update graphics drivers: The designer uses OpenGL which requires up-to-date drivers.
Rendering looks different on device
Common causes:
- Font differences - Ensure fonts are bundled
- DPI scaling - Use dp units consistently
- Color profiles - Use standard sRGB colors
Submission Issues
"Version code must be higher"
Each new version needs a higher version_code.
Solution:
{
"version": "1.0.1",
"version_code": 2 // Increment from previous
}
"Signature verification failed"
Your package signature is invalid.
Solutions:
- Rebuild the package:
mosis build
- Check signing key is registered:
mosis keys list
- Re-register your key if needed:
mosis keys register ~/.mosis/keys/production.pub
"Review rejected"
Check the rejection reason in your dashboard. Common issues:
| Reason | Solution |
|---|---|
| Inappropriate content | Remove violating content |
| Misleading description | Update description to match functionality |
| Crashes on launch | Fix startup errors |
| Missing privacy policy | Add privacy policy for data-collecting apps |
| Impersonation | Don't copy other apps |
Getting More Help
Check Logs
Designer logs:
mosis-designer.exe app.rml --log debug.log
Lua errors:
-- Add error handling
local success, err = pcall(function()
-- Your code
end)
if not success then
print("Error:", err)
end
Search Issues
Check if others have encountered the same issue:
- Developer forum
- GitHub issues
- Stack Overflow (tag: mosis)
Contact Support
If you're still stuck:
- Gather error messages and logs
- Create minimal reproduction case
- Submit through developer portal support
See Also
- FAQ - Frequently asked questions
- Lua API Reference - API documentation
- UI Design Guide - Styling reference