Could not load wrapper properties in android studio - java

please help me, when i create a new project in android studio there is an error
Could not load wrapper properties from Could not load wrapper properties from 'C:\Users\baren\AndroidStudioProjects\ToyaGarage\gradle\wrapper\gradle-wrapper.properties'.
1
enter image description here

In my case, I have a blank space at the end of "distributionUrl" row

I Searched for your problem and i found this,maybe this solution can help you https://stackoverflow.com/a/64439711/15805169

Delete the wrapper properties file in your app that is having the problem and copy the wrapper property file from your working apps to the same place where you deleted that file.
this is like the basic path to get to that file
C:\Users\TT Virtual\AndroidStudioProjects\KotlinFirebaseAuth\gradle\wrapper
remember this here is my path to that file

Related

how to solve java file can't recognize its xml file

when I start a new activity in android studio java can't recognize the xml file.
for instance, the java file: register.java
setContentView(R.layout.activity_register)
error shown on activity_register , which said that JVM can't find its corresponding file
I tried to produce java file and xml file separately, but had no luck
the name of xml file is correct, i think.
Please help me how to solve the problem,
thanks!
File -> Invalidate Caches / Restart... -> Select Invalidate and Restart

Adding audio file to my android application

I want to add .mp3 file and I don't have res/row folder in my eclipse and I tried to add it but it doesn't appear in R.java
you have to create raw folder manually in the following path. res/raw/yourfile.mp3. Then clean and Build your project. Now you will get the reference to that mp3 by R.raw.yourfile;
kindly let me know the feedback.
Just right click on your res folder and add a new folder by the name of 'raw'. Here copy and paste your .mp3 file. Make sure that the name of your file is totally lower case as it creates problem later.
Just clean your project and build it again. You will find your file there.
Try using raw instead of row. it will create in R.java
create a raw folder in res. paste the mp3 file in this and use path code as follows
String uriPath = "android.resource://Package name/"+ R.raw.MP3file;
I hope you get help from this.
If you face again problem then comment

processing for android: AssetManager and list() not working

I've been developing for android using processing but have come to a halt when I wanted to retrieve a list of files within a given directory. Below is a screenshot of the code I have been trying.
I have tried different variations of this (such as getbaseContext().getAssets();) and nothing seems to work. Whenever the code tries to execute the list() part it has an error and there is nothing in 'fileNames'.
Am I missing anything? Is this a problem with processing?
Thanks
EDIT: The direction I am trying to access is "assets/Levels/" which I can see from my project view in eclipse.
I experienced a similar issue because I used folder names with a trailing / character.
So for others experiencing this issue, you need to make sure the folder name you use are just the folder name with no trailing / (so "movies" instead of "movies/")
You do not need any additional permissions in order to run the code that you have. I just compiled it on my device and it works fine. You mention you are attempting to list the files in a given directory. What you are doing is listing the files in the Levels folder, which should be a sub folder of assets. What you will get back is an array of all file names in that folder.
If you are actually looking to get a list of files from a given directory, it has nothing to do with the assets folder and I suggest you check out a tutorial on Android external and internal storage. The information directly on the android page was very helpful to me.
http://developer.android.com/guide/topics/data/data-storage.html
If that's not what you are looking for though, I suggest rewording your question.
So I got it to work!
Turns out it was a problem with where I was placing the 'String[] fileNames;' code before trying to put data into it. The below code works fine:
Thanks for the help!
*Note : Individual folder should not empty.. It will return zero for folder with no files. *
void getFolderDetais(String folder_name)
{
// pass folder_name empty to get detail of root that means assets folder details
String[] filelistInSubfolder = assetManager.list(folder_name);
Log.v("Floder Details ----- >", " Length --- "
+ filelistInSubfolder.length);
}

How to use JavaCv's cvSaveImage in android

I have created an app using javaCv and
I'm trying to save an image in android using
cvSaveImage("/storage/sdcard0/watermarked/test.jpg", yCrCb);
cvSaveImage("/storage/extSdCard/test.jpg",yCrCb);
where yCrCb is an IplImage.
There is no exception error and the program runs smoothly but the files are not saved into the path as mentioned above.
I would like to ask what might be the possible problems ? is it the naming convention of the file name ?
If it helps, I have a java application counterpart of this app and the java version works fine when i use the line
cvSaveImage("C:\\testing123.jpg", yCrCb);
Hi I have used same thing for storing the image.
For getting the path to sdcard, I have used the Environment.getExternalStorageDirectory().toString();
append the folder name to this path where you want to store the image
try this and also make sure that you have written permission in the xml file.

Reading Assets in Eclipse

I am developing a little game where I use some pictures for the sprites etc etc.
It works just fine when I load it from the disc like this
Image image = new Image("C:\\AppleMan.png");
but how can I load it from a foloder within the project. I am using eclipse as IDE and the language is Java :)
I took a screenshot of a sample project so you can see how I have importet the picture
So I want to load the picture from that resource folder like this pseudo code
Image image = getResource("Resources/AppleMan.png");
but that simply doesn't work.
Any help appreciated :)
1) You should add Resources folder to classpath
2) You should locate file absolutely, i.e. "/Resources/AppleMan.png"
P.S.
3) Sorry, also note that getResource returns URL: http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html#getResource%28java.lang.String
You're passing a relative path when you were passing a absolute path before. Add the path of the Eclipse workspace.
For example, if your workspace is at C:\Workspace, you need to put
Image image = getResource("C:\\Workspace\\HowToGetResources\\Resources\\AppleMan.png");

Categories

Resources