Building modified AOSP throws error (Trying to change API) - api

out/target/common/obj/PACKAGING/public_api.txt:4316: error 5: Added public field android.app.admin.DevicePolicyManager.PASSWORD_QUALITY_MOVEMENT
******************************
You have tried to change the API from what has been previously approved.
To make these errors go away, you have two choices:
1) You can add "#hide" javadoc comments to the methods, etc. listed in the
errors above.
2) You can update current.txt by executing the following command:
make update-api
To submit the revised current.txt to the main Android repository,
you will need approval.
******************************
So i tried to add an #hide annotation to my member variable, but it will only give me another error:
frameworks/base/core/java/android/app/admin/DevicePolicyManager.java:233: cannot find symbol
symbol : class hide
location: class android.app.admin.DevicePolicyManager
#hide
How can I solve this problem?

I made the mistake of using #hide such as #Override, but you have to use it in a JavaDoc comment:
/**
* #hide
*/

Related

Grails Auto generated code is with warnings and errors

I am using Intellij IDEA Ultimate and have Grails plugin installed. When i auto generate, let's say controller i have warnings like so : "Cannot infer argument types " for this code :
multipartForm {
flash.message = message(code: 'default.created.message',
args: [message(code: 'tekEvent.label',
default: 'TekEvent'), tekEventInstance.id])//We need id to see in created message
redirect tekEventInstance //redirect will open show() view and populate it with instance's data
}
And an error for 'tekEvent.label' .
Have MANY errors in generated views as well. It's not just me. My 3 fellows in team have the same problem as well. Would like to get a "Light" from you and pass it to them as well . Thanks ^_^

Typo3 Extension: Injection of repository doesn't work anyway

I followed the official Guide from Typo3 for creating a new extension (https://docs.typo3.org/m/typo3/book-extbasefluid/9.5/en-us/4-FirstExtension/Index.html). But when I finished, the page with the plugin gives me only an ERROR 500. No Error-Log anyway.
When I enabled ErrorDisplay I found, that there was a problem with boolean values. So I deleted them and tried again. Again all I got was ERROR 500. ErrorDisplay said the constructor cannot have a return value - hu?? Found inline 7 - but the declaration is in line 22 -??
public function __construct(int $j = 0, int $n = 0, int $i = 0, int $p = 0, int $y = 0, int $a = 0): void {...}
So I tried to delete the return value. But then it told me, that the class couldn't be found. Next, I tried to find anything about that error but found even less than nothing.
I wasn't even able to find extensions that are implementing the way explained by the official guide. Is there anybody who can tell me, what is going wrong and where I can find a solution - I have no idea anymore.
After hours and hours trial and error I found the solution. The Problem is, that Typo3 doesn't give a proper error message due to failing with the exception handling. You have to enable normal PHP Errors to get a clue what is wrong. If there is any php error, Typo3 fails and gives an reflection error, because it thinks the class isn't available.
First Error was: following the official guide instructions for first extension. Compiler ist failing if you try to give the constructor a return value.
Second Error: Typo3 doesn't recognize if a parameter in constructor is missing. It tries to take the next parameter and fails by comparing the parameters type.
Third Error: If the class is missing the instructions for underlying symphony framework the reflection also fails with registering the class without giving any error message.
After I found and corrected all the errors, all worked fine.

Xtext: Customizing Error msg by unordered groups

I've defined an unordered group and it works like I expected. The only thing I would like to change is the error msg, which appears when an element of an unordered group isn't modelled yet. Is there an easy way to solve this? I tried already custom checks, but there I got an unexpected behaviour.
Following my rule for the unordered group and the error msg:
Element:
(name=ConfigurationName) &
(description=Description)? &
(tool=Tool) &
(model=Model) &
(interfaces=Interfaces)? &
(paramaters=Parameters)? &
(paramfile=ParamFile)?
;
rule ruleElement failed predicate: {getUnorderedGroupHelper().canLeave(grammarAccess.getElementAccess().getUnorderedGroup())}?
I want to change this error msg to something like: "The following elements are required in the configuration:...."
Xtext has a service called SyntaxErrorMessageProvider that is used to reword parser error messages. You have to define your messages on the parser level (so there will be no EMF model to use), but it is possible to get the original error message and the context, traverse it and provide your own error message.
To register this, open the «YourLanguage»RuntimeModule class, and add the following method:
public Class<? extends ISyntaxErrorMessageProvider> bindISyntaxErrorMessageProvider() {
return «YourLanguage»SyntaxErrorMessageProvider.class;
}
where «YourLanguage«SyntaxErrorMessageProvider is a class introduced by you, extending the class SyntaxErrorMessageProvider, where you can implement your custom function.
I works Automatic Validation customize,I create
public class MyDslLanguageSyntaxErrorMessageProvider extends SyntaxErrorMessageProvider {
}
And I Register it in the MyDslRuntimeModule:
public Class bindISyntaxErrorMessageProvider() {
return MyDslLanguageSyntaxErrorMessageProvider.class;}
But my problem is which package is used for this customization.I used org.xtext.example.mydsl.validation package for create java class .Also I do this customization with xtend class.I do not find enough source in the internet :(
You can use Java to write this Custom SyntaxErrorMessageProvider class, but to bind this you can bind in Runtime Module class. Also u can use any package to declare this class but declaring this class in same package where u have Runtime class makes sense

How to use a dependency of a module within a Play app

I am writing a Play Framework module in order to share some common logic among multiple Play apps. One of the things I would like my module to do is provide some frequently-used functionality by way of 3rd-party modules, for example the excellent Markdown module.
First of all, is it possible to do this? I want all the apps that include my module to be able to use the .markdown().raw() String extension without needing to explicitly declare the Markdown module as a dependency. The Play Framework Cookbook chapter 5 seems to imply that it is possible, unless I am reading it wrong.
Secondly, if it is possible, how does it work? I have created the following vanilla example case, but I'm still getting errors.
I created a new, empty application "myapp", and a new, empty module "mymod", both in the same parent directory. I then modified mymod/conf/dependencies.yml to:
self: mymod -> mymod 0.1
require:
- play
- play -> markdown [1.5,)
I ran play deps on mymod and it successfully downloaded and installed the Markdown module. Running play build-module also worked fine with no errors.
Then, I modified myapp/conf/dependencies.yml to:
# Application dependencies
require:
- play
- mymod -> mymod 0.1
repositories:
- Local Modules:
type: local
artifact: ${application.path}/../[module]
contains:
- mymod
I ran play deps on myapp and it successfully found mymod, and generated the myapp/modules/mymod file, containing the absolute path to mymod.
I ran myapp using play run and was able to see the welcome page on http://localhost:9000/. So far so good.
Next, I modified myapp/app/views/Application/index.html to:
#{extends 'main.html' /}
#{set title:'Home' /}
${"This is _MarkDown_, by [John Gruber](http://daringfireball.net/projects/markdown/).".markdown().raw()}
I restarted myapp, and now I get the following error.
09:03:23,425 ERROR ~
#6a6eppo46
Internal Server Error (500) for request GET /
Template execution error (In /app/views/Application/index.html around line 4)
Execution error occured in template /app/views/Application/index.html. Exception raised was MissingMethodException : No signature of method: java.lang.String.markdown() is applicable for argument types: () values: [].
play.exceptions.TemplateExecutionException: No signature of method: java.lang.String.markdown() is applicable for argument types: () values: []
at play.templates.BaseTemplate.throwException(BaseTemplate.java:86)
at play.templates.GroovyTemplate.internalRender(GroovyTemplate.java:257)
at play.templates.Template.render(Template.java:26)
at play.templates.GroovyTemplate.render(GroovyTemplate.java:187)
at play.mvc.results.RenderTemplate.<init>(RenderTemplate.java:24)
at play.mvc.Controller.renderTemplate(Controller.java:660)
at play.mvc.Controller.renderTemplate(Controller.java:640)
at play.mvc.Controller.render(Controller.java:695)
at controllers.Application.index(Application.java:13)
at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:548)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:502)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:478)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:473)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:161)
at Invocation.HTTP Request(Play!)
Caused by: groovy.lang.MissingMethodException: No signature of method: java.lang.String.markdown() is applicable for argument types: () values: []
at /app/views/Application/index.html.(line:4)
at play.templates.GroovyTemplate.internalRender(GroovyTemplate.java:232)
... 13 more
And just to confirm I'm not crazy, I tried adding the play -> markdown [1.5,) line to myapp/conf/dependencies.yml and restarted the app, and confirmed that it works.
I feel like I'm missing something obvious. Many thanks in advance to anyone who can help! :)
Yes I had the same problem, it seems that transitive dependencies through custom home made modules does not work

Magento - Trouble with setting up Model Read Adapter

I was following through on Alan Storm's tutorial on Magento's Model and ORM basics and I've run into a bit of a problem. When I get to the portion where I load from the Model for the first time I get this error "Fatal error: Call to a member function load() on a non-object...". I've reset everything already and tried again from scratch but I still get the same problem. My code looks like this:
$params = $this->getRequest()->getParams();
$blogpost = Mage::getModel('weblog/blogpost');
var_dump($blogpost);
echo("Loading the blogpost with an ID of ".$params['id']);
$blogpost->load($params['id']);
As you can see I dumped the contents of $blogpost and it shows that it is just a boolean false. My guess is that there's either a problem with the connection to the database or, for some reason, the code for Mage::getModel() didn't get installed correctly.
EDIT - Adding Code
There's so many that I just decided to pastebin them lol
app/code/local/Ahathaway/Weblog/controllers/IndexController.php
app/code/local/Ahathaway/Weblog/etc/config.xml
app/code/local/Ahathaway/Weblog/Model/Blogpost.php
app/etc/modules/Ahathaway_Weblog.xml
Your Model/Blogpost.php file should actually be Model/Mysql4/Blogpost.php, and you are missing the real Model/Blogpost.php.
My guess is that Mage cannot find your model class. Double check the module/model name and also verify if the model is in a correct place in the filesystem (it should be in app/code/local/Weblog/Model/Blogpost.php).
You also need to check if your config.xml correctly defines your model classes. It would be best if you could past your config.xml and your model class...
A quick glance reveals you're missing the model resource. Go back to the section around the following code example
File: app/code/local/Alanstormdotcom/Weblog/Model/Mysql4/Blogpost.php
class Alanstormdotcom_Weblog_Model_Mysql4_Blogpost extends Mage_Core_Model_Mysql4_Abstract{
protected function _construct()
{
$this->_init('weblog/blogpost', 'blogpost_id');
}
}