I've recently created a package and I'm facing an unusual problem. Basically, in my development org, this works:
String report = String.valueOf([SELECT Id FROM Report WHERE DeveloperName = 'Report_Unique_Name' AND NamespacePrefix = 'MyPrefix'].id);
But now I've created my package and installed it in another normal org and this isn't working. The Reports and Reports Types are there and removing "AND NamespacePrefix = 'MyPrefix'" doesn't work either.
MyPrefix __Report_Unique_Name. The best way of debugging this issue is to use the Developer Console in the Org with the problem. Running SOQL such as
SELECT Id, DeveloperName, NamespacePrefix FROM Reportshould show why its not working