Mintoris Forum

Author Topic: Compiling and Signing Your APK  (Read 10189 times)

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Compiling and Signing Your APK
« on: Sep 28, 2015, 12:29 AM »
Here is a quick video that walks you through the steps of compiling and signing your app using Android Studio.

Compiling and Signing Video

RTBasic

  • Jr. Member
  • **
  • Posts: 4
Re: Compiling and Signing Your APK
« Reply #1 on: Oct 15, 2015, 10:56 PM »
So at the end of attempting to generate a signed APK per instructions, the Android Studio 1.4 doesn't finish out but instead gives the same error message twice: No resource found that matches the given name (at 'label' with value '@string/setting_title').  Two of the five lines in the AndroidManifest.xml tab that are highlighted in red are android:label="string/run_screen_name" and android:label="string/settings_title" > . If I put the cursor over the last of these two then I get a pop-up that says  "Cannot resolve symbol 'string/setting_title'" and "validates resource references inside Android XML files". I am stuck. Any suggestions ??

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Compiling and Signing Your APK
« Reply #2 on: Oct 16, 2015, 03:00 AM »
So at the end of attempting to generate a signed APK per instructions, the Android Studio 1.4 doesn't finish out but instead gives the same error message twice: No resource found that matches the given name (at 'label' with value '@string/setting_title').  Two of the five lines in the AndroidManifest.xml tab that are highlighted in red are android:label="string/run_screen_name" and android:label="string/settings_title" > . If I put the cursor over the last of these two then I get a pop-up that says  "Cannot resolve symbol 'string/setting_title'" and "validates resource references inside Android XML files". I am stuck. Any suggestions ??

Try going to Build->Clean Project, the when it finishes, Build->Gen Signed APK.

This is the first time someone has reported a problem creating an APK, so I will keep helping till we get this working. Cleaning will probably work. I just reviewed the code and can't see any problems.

Actually, if cleaning doesn't fix the problem email the project.zip file to support@mintoris.com and I'll take a look at it.

Also, I don't know if you mis-typed this or it's a problem but,

android:label="string/run_screen_name"

should have an @ sign

android:label="@string/run_screen_name"

If the @ sign is missing, put it in and let me know. The manifest is a generated file and it's possible it's dropping @'s somehow.

-Chuck
« Last Edit: Oct 16, 2015, 04:40 PM by Chuck »

Juke

  • Jr. Member
  • **
  • Posts: 2
Re: Compiling and Signing Your APK
« Reply #3 on: Oct 16, 2015, 06:16 AM »
Hello  :) I made the app-release.apk program.It starts my phone, but crashes when i press select in my program.
What can be wrong? gradle.build or something else setting ?

Best regards Jukka

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Compiling and Signing Your APK
« Reply #4 on: Oct 16, 2015, 06:38 AM »
Hello  :) I made the app-release.apk program.It starts my phone, but crashes when i press select in my program.
What can be wrong? gradle.build or something else setting ?

Best regards Jukka

I think that you may be using a feature that requires a permission. What happens when you press select in your program? Does it vibrate? Vibrate requires a permission to be set. (sorry this is all guess work). But, go back to the Export screen in Basic and check to see if all the permissions you need are checked. Then re-export your project and recompile it on your PC.

Hope this solves your problem.
« Last Edit: Oct 16, 2015, 04:37 PM by Chuck »

RTBasic

  • Jr. Member
  • **
  • Posts: 4
Re: Compiling and Signing Your APK
« Reply #5 on: Oct 16, 2015, 06:49 PM »
It does say android:label="@string/run_screen_name"

I don’t see a Build -> Clean Project as one of the options under the “Build” menu in Android Studio 1.4

The Build menu only gives three options:

•   Make Module ‘main’ Ctrl+Shift+F9
•   Generate Signed APK
•   Deploy Module to App Engine

I've sent the zip file. Thank you.

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Compiling and Signing Your APK
« Reply #6 on: Oct 16, 2015, 08:42 PM »
It does say android:label="@string/run_screen_name"

I don’t see a Build -> Clean Project as one of the options under the “Build” menu in Android Studio 1.4

The Build menu only gives three options:

•   Make Module ‘main’ Ctrl+Shift+F9
•   Generate Signed APK
•   Deploy Module to App Engine

I've sent the zip file. Thank you.

Sorry, I didn't get your email. It sounds like the problem is with the Android Studio setup somehow. Did you do the Java JDK install and add the JAVA_HOME environmental variable?

RTBasic

  • Jr. Member
  • **
  • Posts: 4
Re: Compiling and Signing Your APK
« Reply #7 on: Oct 16, 2015, 11:36 PM »
Your email rejected the attachment; "Remote host said: 552-5.7.0 This message was blocked because its content presents a potential
552-5.7.0 security issue." I resent an email to you with a link to download the zip drive. Maybe this will help.

In Android 1.4 Help > About it says
Build #AI-141.2288178 Built on Sep 25, 2015.
JRE: 1.80_60-b-27 amd64.
JVM: Java Hotspot(TM) 64-Bit server VM by Oracle Corporation.

I followed your video link to install Android Studio step by step. Yes, I do have Java JDK installed and added the JAVA_HOME environmental variable in the advanced system settings. I am running Windows 10 Pro.

It does feel like an Android Studio 1.4 problem. Not sure how to solve it.

The first entire error is "Error:(25, -1) android-apt-compiler: [main] C:\Users\Trent\Documents\Studio APK Projects\SP mass balance\app\src\main\AndroidManifest.xml:25: error: Error: No resource found that matches the given name (at 'label' with value '@string/run_screen_name')."  The second error is a duplicate except that 25 is replaced with 36 and says 'settings_title' instead of 'run_screen_name'.

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Compiling and Signing Your APK
« Reply #8 on: Oct 16, 2015, 11:57 PM »
I unzipped your project file and Android Studio compiled and ran it without complaint.

* Solved *

You might not have Android SDK API 19 installed.

Press the SDK Manager Button



Then on the manager window make sure API 19 is checked. Otherwise check it and install it.



If API 19 is installed, Close out of the project back to the Studio launcher screen. Then go to your StudioProjects folder and delete your project folder. Then unzip it again, go back to Android Studio and see if that fixes it. Like I said above, it compiled for me.

-Chuck
« Last Edit: Oct 17, 2015, 07:52 AM by Chuck »

RTBasic

  • Jr. Member
  • **
  • Posts: 4
Re: Compiling and Signing Your APK
« Reply #9 on: Oct 17, 2015, 12:29 AM »
I did not have API 19 installed. I installed it and now have an APK file.  Thank you :)

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Compiling and Signing Your APK
« Reply #10 on: Oct 17, 2015, 12:32 AM »
Ah, I will have to include that step in the install instructions. Sorry, so hard to anticipate these kinds of problems.

-Chuck

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Compiling and Signing Your APK
« Reply #11 on: Oct 17, 2015, 07:36 AM »
Remember to keep your keystore safe. You should only every have to create the keystore once. After the first time you will use the same keystore to sign all your apps and your upgrades. I set my keystore to expire in 100 years. Well, 95 now.
« Last Edit: Oct 17, 2015, 07:40 AM by Chuck »

Juke

  • Jr. Member
  • **
  • Posts: 2
Re: Compiling and Signing Your APK
« Reply #12 on: Oct 18, 2015, 09:58 AM »
Hello  :) I made the app-release.apk program.It starts my phone, but crashes when i press select in my program.
What can be wrong? gradle.build or something else setting ?

Best regards Jukka

I think that you may be using a feature that requires a permission. What happens when you press select in your program? Does it vibrate? Vibrate requires a permission to be set. (sorry this is all guess work). But, go back to the Export screen in Basic and check to see if all the permissions you need are checked. Then re-export your project and recompile it on your PC.




Hope this solves your problem.

Yes,now it works.Vibrating is missing.

Thanks :-)


mosh

  • Full Member
  • ***
  • Posts: 36
Re: Compiling and Signing Your APK
« Reply #13 on: Nov 18, 2015, 02:42 PM »
Hi Chuk,
Im trying to creat the apk file with the android studio but it tells me that it doesnt find the android manifest file,?

By "it" i assume that Android Studio can't find the manifest. Did you unzip the project zip file on your PC?
« Last Edit: Nov 18, 2015, 04:27 PM by Chuck »

mosh

  • Full Member
  • ***
  • Posts: 36
Re: Compiling and Signing Your APK
« Reply #14 on: Nov 18, 2015, 04:55 PM »
I unzipped it on my cellphone and moved the file to the pc, should I unzip it on my pc?

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Compiling and Signing Your APK
« Reply #15 on: Nov 18, 2015, 05:09 PM »
Yes, move your project.zip file to your pc then unzip the contents to the Android Studio projects folder. That will create a project directory.

The project.zip file can be found in the iCode directory right next to your project.iCode file.
« Last Edit: Nov 18, 2015, 05:12 PM by Chuck »

mosh

  • Full Member
  • ***
  • Posts: 36
Re: Compiling and Signing Your APK
« Reply #16 on: Nov 18, 2015, 05:39 PM »
I moved the zip file to the computer, but I dont find the android studios prohects folder, I unzipped it on my desktop and when opened it from there but when i try to build it still doesnt find the manifest.

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Compiling and Signing Your APK
« Reply #17 on: Nov 18, 2015, 08:22 PM »
I assume you went through Android Studio install and loaded the API 19 Library as described in this thread above.

If so, rename your zip file to something like project.dat and email it to support@mintoris.com. I will take a look at it.

mosh

  • Full Member
  • ***
  • Posts: 36
Re: Compiling and Signing Your APK
« Reply #18 on: Nov 18, 2015, 10:06 PM »
I managed to make the apk file and install it on my phone, but then I receive a message that sais that it doesnt find the audio files I added to the program, when I exported the project from mintorris I added the audio file as data dir. Is there anything else I had to do?

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Compiling and Signing Your APK
« Reply #19 on: Nov 18, 2015, 11:16 PM »
It is best to create one directory where you will put all your data. Even if you only have one file. Then you zip up that dir during export. This is to guarantee that the path is the same when you test as when you install the apk.

so

mydir/audio.mp3

will work as your path. I'm sure you've read the Preparing your data to make an APK post on this board.