• 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
Aug 13, 2018
19
4
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:
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.
 
Upvote 0
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:
Upvote 0
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
 
  • Like
Reactions: Hadron
Upvote 0
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.
 
Upvote 0
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?
 
  • Like
Reactions: Dannydet
Upvote 0
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;)
 
  • Like
Reactions: Hadron
Upvote 0
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.
 
Upvote 0
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).
 
  • Like
Reactions: codesplice
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones