• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps error on music app

unet

Newbie
Hello.
I got the source code of a music player but I am having problems running the app. When I try to run or build the app I get the error “AAPT: error: failed writing to ‘C:\Users\user\AndroidStudioProjects\Urban Music Player\UrbanMusicPlayer\project\app\build\generated\not_namespaced_r_class_sources\debug\r\com\iven\urbanmusicplayer\R.java’: The data is invalid. (13).” What is the solution? (problem solved)
 
Last edited:
Hello. I found a source code for a music player app but when I try to run it it gives me the following error
"error: method save in class Canvas cannot be applied to given types;
required: no arguments
found: int
reason: actual and formal argument lists differ in length"
 
That seems pretty obvious: something in the code is making a function call with the wrong number of arguments (in this case supplying an argument to a function that cannot accept one).

Unless you've modified it this also implies that the source code you found is buggy.
 
That seems pretty obvious: something in the code is making a function call with the wrong number of arguments (in this case supplying an argument to a function that cannot accept one).

Unless you've modified it this also implies that the source code you found is buggy.
I looked on the code and the line "final int save = canvas.save(Canvas.ALL_SAVE_FLAG);" has "Canvas.ALL_SAVE_FLAG" in red. The error says "save() in Canvas cannot be applied to (int)".
I did some research and I found out that "Canvas.save(int) has been removed from API 28. In was deprecated since 28, now it is fully removed and you should call Canvas.save() instead ." I did the changes but now the app crashes.
 
Can we ask why this particular app is so important?

There are sooooo many music apps that generally work well right out of the box, so to speak.

And a few that are downright excellent.
 
Can we ask why this particular app is so important?

There are sooooo many music apps that generally work well right out of the box, so to speak.

And a few that are downright excellent.
I want a app that I can publish to Play Store, and that is the only source code that I can find.
 
So you have found source code from somewhere else and want to make it work and publish the app. An obvious question: what is the license of the source code? For example, if it's public under something like the GPL then your use of that code must comply with the conditions of the license (e.g. any product you derive from it would have to be released on the same or equivalent licensing terms).

That doesn't solve your technical problem, just something to bear in mind if you don't want to add legal problems to the technical ones.

On the technical problem, it's very hard to debug from error messages alone without seeing the code. The first case here was exceptionally simple, so much so that you didn't even need any android development experience to see it (I have no android development experience at all, I'm mainly a C++ programmer). But in general you'll need to provide the code for anyone to have a chance.

And are you planning to add anything to this project, or just take the code you found and publish it as "your" app? I ask because I get the impression that you don't have much coding experience (not knowing what FOSS means, the level of some of the questions you ask). Of course there are apps out there that are just "continuations" by someone else of projects that the original developer no longer supports, so taking the code, making minimal changes (at least initially) and publishing is allowed by many open source licenses. It just "feels better" to use someone else's code as a starting point to add your own ideas rather than simply publishing someone else's work (which your earlier post gave the impression might be the plan).

P.S. FOSS = Free Open Source Software, typically released under a license such as the GPL which imposes some terms and conditions on how you may use it, such as those I mentioned above. Some such licenses include restrictions on whether you can use the code in commercial projects, or forbid you from releasing a closed-source project using any of the code, so it's important to know exactly what terms the code is made available to you under - there are many different open source licenses out there.
 
Last edited:
So you have found source code from somewhere else and want to make it work and publish the app. An obvious question: what is the license of the source code? For example, if it's public under something like the GPL then your use of that code must comply with the conditions of the license (e.g. any product you derive from it would have to be released on the same or equivalent licensing terms).

That doesn't solve your technical problem, just something to bear in mind if you don't want to add legal problems to the technical ones.

On the technical problem, it's very hard to debug from error messages alone without seeing the code. The first case here was exceptionally simple, so much so that you didn't even need any android development experience to see it (I have no android development experience at all, I'm mainly a C++ programmer). But in general you'll need to provide the code for anyone to have a chance.

And are you planning to add anything to this project, or just take the code you found and publish it as "your" app? I ask because I get the impression that you don't have much coding experience (not knowing what FOSS means, the level of some of the questions you ask).

P.S. FOSS = Free Open Source Software, typically released under a license such as the GPL which imposes some terms and conditions on how you may use it, such as those I mentioned above.


Does that make it any more strange that I don't know any code or programming, but I DO know what FOSS is?

lol
 
So you have found source code from somewhere else and want to make it work and publish the app. An obvious question: what is the license of the source code? For example, if it's public under something like the GPL then your use of that code must comply with the conditions of the license (e.g. any product you derive from it would have to be released on the same or equivalent licensing terms).

That doesn't solve your technical problem, just something to bear in mind if you don't want to add legal problems to the technical ones.

On the technical problem, it's very hard to debug from error messages alone without seeing the code. The first case here was exceptionally simple, so much so that you didn't even need any android development experience to see it (I have no android development experience at all, I'm mainly a C++ programmer). But in general you'll need to provide the code for anyone to have a chance.

And are you planning to add anything to this project, or just take the code you found and publish it as "your" app? I ask because I get the impression that you don't have much coding experience (not knowing what FOSS means, the level of some of the questions you ask).

P.S. FOSS = Free Open Source Software, typically released under a license such as the GPL which imposes some terms and conditions on how you may use it, such as those I mentioned above.
Well I am familiar with GPL, many Linux distros and open source software use it. Usually you can use the source code, make changes, and make money if you want to, the free is of freedom. I wasn't sure what the term meant because I haven't seen in a wile, I just was trying to make sure.
The site says that is open source, it does not mention any licence. I am a beginner in Android but I already have 5 apps on Play Store.
 
Does that make it any more strange that I don't know any code or programming, but I DO know what FOSS is?

lol
Well the ability to code does not make one all knowing... I knew the term since around 2007, but I was not sure if we were talking about the same thing.
 
Well I am familiar with GPL, many Linux distros and open source software use it. Usually you can use the source code, make changes, and make money if you want to, the free is of freedom. I wasn't sure what the term meant because I haven't seen in a wile, I just was trying to make sure.
The site says that is open source, it does not mention any licence. I am a beginner in Android but I already have 5 apps on Play Store.

And I hope that you are aware that you are supposed to give credit to whomever created the original app?

Just because it is 'free' and 'open source' does not mean that it is legal to just copy it, include ads, and then put it onto the PlayStore without giving credit to the people/person that created the original app?
 
Well I am familiar with GPL, many Linux distros and open source software use it. Usually you can use the source code, make changes, and make money if you want to, the free is of freedom. I wasn't sure what the term meant because I haven't seen in a wile, I just was trying to make sure.
The site says that is open source, it does not mention any licence. I am a beginner in Android but I already have 5 apps on Play Store.

Good programmers copy. Excellent programmers steal :D;)
 
And I hope that you are aware that you are supposed to give credit to whomever created the original app?

Just because it is 'free' and 'open source' does not mean that it is legal to just copy it, include ads, and then put it onto the PlayStore without giving credit to the people/person that created the original app?
I am aware of that. First i have to make it work before I worry about that. I had to do a lot of updates to the app and changes, but it finally is working at least on the emulator, but the app still crushes on my phone.
 
Well I am familiar with GPL, many Linux distros and open source software use it. Usually you can use the source code, make changes, and make money if you want to, the free is of freedom. I wasn't sure what the term meant because I haven't seen in a wile, I just was trying to make sure.
The site says that is open source, it does not mention any licence. I am a beginner in Android but I already have 5 apps on Play Store.
It would be a little surprising for a site or a project not to define what is meant by "open source" somewhere, since there are many different "open source" licenses with different conditions. Some allow you to do anything, including using the code in proprietary (closed source) apps, some require that any project using them is open source under an equivalent license, some forbid commercial use. The term "open source" by itself is not specific enough to tell you what usage is allowed.

(Of course if there really is no mention of a license on the developer's site nor in any of the code that could be read as a sign that it's using the fully permissive license. But I'd never put anything other than the most trivial code out there without specifying somewhere).
 
Back
Top Bottom