Which AndroidManifest.xml to edit in Flutter project? - android-studio

I notice there are several AndroidManifest.xmls under android/app/src, debug, main, and profile folders all contain one. Which one to edit?

Main AndroidManifest.xml file is located at 'Project' > app > src > main > AndroidManifest.xml.
Other AndroidManifest.xml which are in debug folder and profile folder are systems generated when you are running a flutter app directly to mobile it will generate or while creating a flutter project. E.g: It is used for hot reload when the device is connected.

Press cmd + shift + o and enter androidmanifest.xml, now open the one located at android/app/src/main.

To change your App name, Package name / different permissions you want in your app you have to edit the AndroidManifest.xml which is inside the main folder

Related

Sencha Architect 4.3.2.19 - Directory *** does not contain a valid framework

I installed and registered Sencha Architect 4.3.2.19. However, after I created a new classic ExtJs 7.6.0 project, it doesn't initialize Cmd properly, and in the command output I see:
Exception in thread "Thread-15"
com.sencha.exceptions.BasicException: com.sencha.exceptions.ExState: Directory C:\Users\costa\Documents\Architect\frameworks/ext76/7.6.0.41/commercial does not contain a valid framework.
at com.sencha.tools.server.service.tasks.DispatchTask.execute(DispatchTask.java:55)
at com.sencha.tools.server.service.tasks.BaseServiceTask$1.run(BaseServiceTask.java:42)
at com.sencha.util.ThreadUtil$1.run(ThreadUtil.java:65)
at com.sencha.util.ThreadUtil$2.run(ThreadUtil.java:162)
at java.base/java.lang.Thread.run(Thread.java:1589)
Caused by: com.sencha.exceptions.ExState: Directory C:\Users\costa\Documents\Architect\frameworks/ext76/7.6.0.41/commercial does not contain a valid framework.
at com.sencha.command.app.AppCommands$InitCommand.validateEnvironment(AppCommands.java:1874)
at com.sencha.command.app.AppCommands$InitCommand.execute(AppCommands.java:1750)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:578)
at com.sencha.util.MethodInvoker$Arguments.invoke(MethodInvoker.java:175)
at com.sencha.cli.Command.dispatch(Command.java:43)
at com.sencha.command.BasePluginCommands$BasePluginCommand.dispatch(BasePluginCommands.java:289)
at com.sencha.cli.Commands.dispatch(Commands.java:64)
at com.sencha.cli.Commands.dispatch(Commands.java:64)
at com.sencha.command.Sencha.dispatch(Sencha.java:80)
at com.sencha.cli.AbstractCommand.dispatch(AbstractCommand.java:124)
at com.sencha.tools.server.service.tasks.DispatchTask.execute(DispatchTask.java:52)
... 4 more
The Cmd base directory is set to: C:\Users\costa\bin\Sencha\Cmd which contains the subdirectory 7.6.0.87.
Any idea on how to fix the exception? Time to open a ticket?
Edit: I've got the previous error on Windows 2016. I just gave SA 4.3.2.19 for macosx a try. It has a different problem. I created a blank ExtJs 7.6.0 Modern project. When I save the project in the folder I get (I set the app name to App) :
/Users/costa/bin/Sencha/Cmd/7.6.0.87/extensions/sencha-service/shell-wrapper.sh: line 41: cordova: command not found
/Users/costa/bin/Sencha/Cmd/7.6.0.87/extensions/sencha-service/shell-wrapper.sh: line 41: phonegap: command not found
[INF] Initializing empty workspace at /Users/costa/Documents/development/javascript/TestAppModern01
[INF] Copying framework to /Users/costa/Documents/development/javascript/TestAppModern01/ext
[INF] Added framework ext to workspace.json
[ERR] The specified string cannot be converted into a valid namespace identifier
Exception in thread "Thread-61" com.sencha.exceptions.BasicException: com.sencha.exceptions.ExState: Invalid namespace : App
at com.sencha.tools.server.service.tasks.DispatchTask.execute(DispatchTask.java:55)
at com.sencha.tools.server.service.tasks.BaseServiceTask$1.run(BaseServiceTask.java:42)
at com.sencha.util.ThreadUtil$1.run(ThreadUtil.java:65)
at com.sencha.util.ThreadUtil$2.run(ThreadUtil.java:162)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: com.sencha.exceptions.ExState: Invalid namespace : App
at com.sencha.util.NameUtil.stringToNamespace(NameUtil.java:76)
at com.sencha.command.generator.GeneratorCommands$AppCommand.validateAppName(GeneratorCommands.java:680)
at com.sencha.command.generator.GeneratorCommands$AppCommand.execute(GeneratorCommands.java:420)
at com.sencha.command.app.AppCommands$InitCommand.execute(AppCommands.java:1819)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at com.sencha.util.MethodInvoker$Arguments.invoke(MethodInvoker.java:175)
at com.sencha.cli.Command.dispatch(Command.java:43)
at com.sencha.command.BasePluginCommands$BasePluginCommand.dispatch(BasePluginCommands.java:289)
at com.sencha.cli.Commands.dispatch(Commands.java:64)
at com.sencha.cli.Commands.dispatch(Commands.java:64)
at com.sencha.command.Sencha.dispatch(Sencha.java:80)
at com.sencha.cli.AbstractCommand.dispatch(AbstractCommand.java:124)
at com.sencha.tools.server.service.tasks.DispatchTask.execute(DispatchTask.java:52)
... 4 more
An identical error occurs when I save a classic project.
What am I missing? There seems to be something wrong overall with SA 4.3.2, or maybe it's missing something.
Both versions, windows & macosx, don't allow me to set Build Tools to Enabled. I click Save, I come back to the dialog and Build Tools is set to Disabled.
More than that, I downloaded ExtJs 7.6.0 and unzipped in a local folder, then in the above dialog I chose Complete or Custom Path, I entered the folder where I unzipped ExtJs, clicked Save, came back to the dialog and Build Tools is Disabled again.
Thank you
ok, I found a workaround for the first problem I had on windows. I installed Sencha Cmd from the installer - I don't know if that made a difference or not.
After creating the classic app, and saving it in SA, I went to the command line and I ran inside the project folder: C:\Users\costa\bin\Sencha\Cmd\7.6.0.87\sencha.exe app init -n App -e ..\..\ext760 --classic
You'd have to adjust the parameters according to your needs. I re-opened the project in SA, and it got its brains back. In my case I used a workspace, and the folder for the workspace was 2 levels up from the project folder. I placed the 7.6.0 ExtJs files in the ext760 directory.
Update: I created a ticket with Sencha and they came back with the fix.
The framework code has been incorrectly installed by SA 4.3.2 in this folder: C:\Users\<UserName>\Documents\Architect\frameworks\ext76\7.6.0.41\commercial\ext-7.6.0. The solution is to copy the files in this folder one level up, i.e. in C:\Users\<UserName>\Documents\Architect\frameworks\ext76\7.6.0.41\commercial, and then it's going to work.

How do I exclude a folder from the sidebar in Sublime Text permanently, specifying it relative to the open folder?

I've already read this related question (How do I exclude a folder from search in sublime text 3 permanently?) but my question is different since I want to specify only the folder at the open folder's root, not a generic pattern to match at any level in the folder tree.
In Sublime Text 4 I have an open project folder via File --> "Open Folder...".
Let's say my folder layout is this:
mainapp
├── microapp
│ └── node_modules <== don't exclude this (keep it)
├── microapp2
│ └── node_modules <== don't exclude this (keep it)
├── index
├── node_modules <=== exclude this only
├── config
└── assets
I'd like to exclude mainapp/node_modules only, NOT mainapp/microapp/node_modules nor mainapp/microapp2/node_modules. How do I do that?
I'm guessing I need to specify a "folder_exclude_patterns" in the settings.
Side note: why do I need to do this?
Because that folder has so much build content in it (which is constantly-changing as builds occur) that it's actually causing Sublime Text to freeze and lock up and become unusable.
Tested on Linux Ubuntu 18.04.
Through sheer dumb luck and persistence with guessing, I figured it out. // refers to the "open folder root", apparently.
If you want to see this info about // added to the official Sublime Text documentation and default settings file, please upvote my open issue on it here.
Update
I found some official documentation on this: https://www.sublimetext.com/docs/file_patterns.html. The // feature was added as of Sublime Text 4:
If pattern begins with //, it will be compared as a relative path from the project root [added in version 4.0]
My testing, however, proves that the // actually means "path" root, as defined below, however. So, my examples below are still correct.
1. If you have a folder open via File --> "Open Folder...", do this:
Preferences --> Settings --> add this "folder_exclude_patterns" entry to your user settings JSON file:
{
// other user settings here
// exclude only the "mainapp/node_modules" dir
"folder_exclude_patterns": ["//node_modules"],
// other user settings here
}
Again, // means the "open folder's root".
NOTE: Changing your user settings above will apply globally to all of your Sublime Text instances, which may not be what you want. So, it may be better to use a "Project" instead, as described below:
2. If you have the folder open and saved as part of a project, do this:
Project --> Edit Project --> add this "folder_exclude_patterns" entry to your Project settings JSON file:
{
"folders":
[
{
// path to an open folder in a project
"path": "/path/to/mainapp",
// exclude only the "mainapp/node_modules" dir
"folder_exclude_patterns": ["//node_modules"],
}
],
}
You can see in the official project settings file example here (https://www.sublimetext.com/docs/projects.html) that the "folder_exclude_patterns" entry must be at the same level in the JSON settings file as the "path" entry.
I also first learned this from #smhg's comment here. Thank you!
To open another folder in your project, go to Project --> "Add Folder to Project...". Once you have multiple folders open in your project, you'll have to add multiple entries of "folder_exclude_patterns", as desired, like this:
{
"folders":
[
{
// **absolute path** to open a folder in a project
"path": "/path/to/mainapp",
// exclude only the "mainapp/node_modules" dir
"folder_exclude_patterns": ["//node_modules"],
},
{
// or **relative path** to open another folder in the project;
// the path is relative to the location of the
// "project_name.sublime-project" project file itself
"path": "some_dir",
// exclude only the "some_dir/path/to/excluded_folder" dir
"folder_exclude_patterns": ["//path/to/excluded_folder"],
},
],
}
Bonus: How to create a project in Sublime Text:
To create a Project from an open folder, the steps are like this:
Open a folder: File --> "Open Folder..."
Save it as part of a project: Project --> "Save Project As..."
Now you can choose where to save your project_name.sublime-project file. This is the file you are editing when you go to Project --> "Edit Project" above. To open a project go to Project --> "Open Project...".
See also:
Issue I opened: https://github.com/sublimehq/sublime_text/issues/5234
Comment I wrote on the Sublime Text forum: https://forum.sublimetext.com/t/a-way-to-specify-root-in-project-settings/7756/4?u=ercaguy
Official Project settings documentation: https://www.sublimetext.com/docs/projects.html. This includes:
Each object must have a "path" key, which may be relative to the project directory, or a fully qualified path.
How do I exclude a folder from search in sublime text 3 permanently? - answer which explains how to exclude a file or folder from the side bar in Sublime Text, versus excluding a file or folder from search, such as Goto Anything or Find in Files.

Related custom theming OF OPEN EDX

i am using devstack hawthorn problem i am facing is , i created a folder parallel to open-edx project where i cloned it. folder structure i created is edx/app/edxapp/edx-platform/themes/my-theme inside my-theme lms and cms is there and further static files in both and i put o studio-logo.png in cms images folder to check custom theme is working or not and in studio-shell cmd edx/etc directory opened studio.yml and changed variable
COMPREHENSIVE_THEME_DIRS: [
“/edx/app/edxapp/edx-platform/themes”
]
ENABLE_COMPREHENSIVE_THEMING: true
DEFAULT_SITE_THEME: “my-theme”
and run cmd paver update_assets
’
Build failed running pavelib.assets.update_assets: Subprocess return code: 1’
please help#BbrSofiane or please tell i created wrong structure or file inside cms and lms not correctenter image description here

Getting "No file or variants found for asset" found error on my asset

I am getting this attached error when I try and run my app. Any ideas?
(Below)
Launching lib\main.dart on SM J200Y in debug mode...
Running Gradle task 'assembleDebug'...
√ Built build\app\outputs\apk\debug\app-debug.apk.
Error detected in pubspec.yaml:
No file or variants found for asset: assets/credentials.json.
I have checked the yaml file and the formatting seems to be fine. I am at a loss as want the issue is. (Also, below)
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/credentials.json
In my case, the problem was that I was missing slash /.
At first, I have added my icons path as below.
assets:
- assets/icons
I solve the issue by adding as slash / to the end of the path as below:
assets:
- assets/icons/
Check identation of assets. Generally it should have 3 spaces from start of new line.
assets:
- assets/credentials.json // <-- count three spaces from start
I was facing the same problem, and I had two mistakes:
I created the "images" folder inside the "lib" folder, and it should be outside the lib folder, it should be in the app root folder.
It should be three spaces from the starter line as #Darshan said
-assets/credentials.json // <-- count three spaces from start
It should appear a grey line, like this
there are 2 possibility
Folder/file missing in your project directory
Missing "/" in the end of folder/file name in pubspec.yaml file
try copying the file manually not using VS-Code or Android studio. don't use drag/drop.
You need mention as
assets:
- assets/icons/
in pubspec.yaml
I had this same problem, I was able to fix it by using only the name of directory created in the projects root folder, instead of also including the file i was trying to point to.
assets:
- images/
is what worked for me instantly, just point to the whole dir and specify the file name in ImageAssets object.
Sometimes you need to enter filename as such:
flutter: assets:
- lib/assets/logo.png
I was facing the same problem, and I had two mistakes:
When I add lib in assets then I solve my problem.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- lib/images/background.jpg

java.io.FileNotFoundException: Resource not found: /credentials.json on Java QuickStart for Classroom API

I have implemented the Java QuickStart for the Classroom API and am getting an error message "java.io.FileNotFoundException: Resource not found: /credentials.json" at run-time. I copied my credentials.json file to the Project res directory, but continue to get this error. Any suggestions?
I tried it in a different way than I found on other websites, and it worked for me.
replace below code:
InputStream in = GoogleSheetAPIHandler.class.getClass().getResourceAsStream(CREDENTIALS_FILE_PATH);
With this code:
InputStream in = new FileInputStream(CREDENTIALS_FILE_PATH);
You need to import credential.json file into the src/main/resources folder in eclipse. You may be included in the project folder. But you need to import it into eclipse.
locate your credentials.json file in the folder.
click and drag it
drop it in src/main/resource and click ok.
After importing into eclipse it should show like the below image.
There are two steps needed to find the resource in Eclipse:
To have the file in the resources folder
Create the resource folder (if it does not exist): src/main/resouces
Add the credential file to the resource folder: src/main/resouces/credential.json
To have the resources folder in the Source Java Build Path
Go to Eclipse Path Source: Project > Properties > Java Build Path > Source (tab)
Add resources folder: Add Folder ... (button) > resources (check box) > OK (button)
https://stackoverflow.com/a/46950488/10850340
The name of your file has to be credentials only, if you have credentials.json as the name of your file in your folder you will get this error.

Resources