Build Fails

210 views
Skip to first unread message

RobNCD

unread,
Jul 2, 2014, 2:39:01 PM7/2/14
to app-inventor-o...@googlegroups.com
I am trying to ad support for Google Play services, which requires the addition of this in the manifest

<meta-data
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />

When i try to build the server I then get the following error.

     [java]     (new resource id zoom_exit_reverse from C:\Users\Owner\AppData\Local\Temp\1404322247
840_0.36066347666430554-0\youngandroidproject\..\build\res\anim\zoom_exit_reverse.xml)
     [java] C:\Users\Owner\AppData\Local\Temp\1404322247840_0.36066347666430554-0\youngandroidprojec
t\..\build\AndroidManifest.xml:57: error: Error: No resource found that matches the given name (at '
value' with value '@integer/google_play_services_version').
     [java] Jul 02, 2014 12:33:06 PM com.google.appinventor.buildserver.Compiler runAaptPackage
     [java] WARNING: YAIL compiler - AAPT execution failed.

BUILD FAILED
C:\AILC_Dev\AppInventor\build.xml:16: The following error occurred while executing this line:
C:\AILC_Dev\AppInventor\build-common.xml:292: The following error occurred while executing this line
:
C:\AILC_Dev\AppInventor\buildserver\build.xml:219: Java returned: 1


It is checking for the version info located here: google-play-services_lib/res/values/version.xml

I have added the google-play-services.jar to the project, however that doesnt bring the res folders etc.  Can this also be added to the server?

Thanks in advance for any suggestions.
Robert

Jos Flores

unread,
Jul 2, 2014, 4:26:29 PM7/2/14
to app-inventor-open-source-dev
Adding play services is rather complicated. Depending on what you want
to do, you could simply substitute that reference for the integer
value that appears in the resources (that do not get mashed in, as you
said).

Also note that play services need at least a minSDK of 9 IIRC, or
adding extra jars for Froyo, you could use level 8.

The whole thing is complicated cause Google does not provide a full
jar with all the things needed, but they make you add an extra project
with sources and resources in your IDE. I'm sure there's a way to add
that to the tree of AI sources, but it would need some ant work. If
you get around to doing it, that would be an awesome contribution.

cheers,
José
> --
> You received this message because you are subscribed to the Google Groups
> "App Inventor Open Source Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to app-inventor-open-so...@googlegroups.com.
> To post to this group, send email to
> app-inventor-o...@googlegroups.com.
> Visit this group at
> http://groups.google.com/group/app-inventor-open-source-dev.
> For more options, visit https://groups.google.com/d/optout.

RobNCD

unread,
Jul 2, 2014, 4:37:23 PM7/2/14
to app-inventor-o...@googlegroups.com
Hi Jos
I did try the substitution 
<meta-data android:name="com.google.android.gms.version" android:value="4452000" />

Maybe this version of Google  play services plugged that hole, as it gives me an error within the app that the manifest needs to have the 

<meta-data
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />

unless I am missing something.....

Jos Flores

unread,
Jul 2, 2014, 4:39:52 PM7/2/14
to app-inventor-open-source-dev
I have done that in the past and it worked, but that was many
play-services versions ago.

Are you upping the minSDK?

How are you adding the meta-data to the manifest?

cheers,
José

RobNCD

unread,
Jul 2, 2014, 4:49:30 PM7/2/14
to app-inventor-o...@googlegroups.com
Yes since I need full tablet support, I use minSDK of 9.  I have modified the compiler long ago to add the functions for specific things.  It adds the lines to the manifest depending on what components are in place. Same as  the ListActivity, webview etc...  I also added the permissions nec for tablet support.

 
I have been all over the internet searching....  I think if I used the older version of the play services that may work, however that is just a guess.. and would be a very short term solution as things are changing at the end of the month.

Any ideas are welcome.
Robert 

Jos Flores

unread,
Jul 2, 2014, 4:51:37 PM7/2/14
to app-inventor-open-source-dev
out of ideas here; check for typos and make sure that the strings are
properly escaped.

cheers,
José

RobNCD

unread,
Jul 2, 2014, 4:54:05 PM7/2/14
to app-inventor-o...@googlegroups.com
copy of my code

      // GoogleAdActivity
      if (componentTypes.contains("GoogleBA")){
      out.write("    <activity android:name=\"com.google.android.gms.ads.AdActivity\" " +
          "android:configChanges=\"keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize\" " +
          "android:screenOrientation=\"behind\">\n");
      out.write("<meta-data android:name=\"com.google.android.gms.version\" " +
      "android:value=\"4452000\" /> \n");
   // TODO: Figure out how to read the Google Play version on the fly from the google-play-services_lib>res>values>version.xml
      //"android:value=\"@integer/google_play_services_version\" /> \n");
      out.write("    </activity>\n");
      } 

this is specifically for the Google Ads, however should be the same for any of the of Google play services available.

Jos Flores

unread,
Jul 2, 2014, 5:21:10 PM7/2/14
to app-inventor-open-source-dev
the meta-data tag should be located inside the activity tag? I think I
put the meta before all activities, but can't recall.

cheers,
José

RobNCD

unread,
Jul 2, 2014, 5:27:34 PM7/2/14
to app-inventor-o...@googlegroups.com
Actually you are correct.  It should appear at the top right after the application tag ie:

<application android:debuggable="false" android:label="SampleApp" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" android:icon="@drawable/ya" > <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> 

RobNCD

unread,
Jul 2, 2014, 7:34:51 PM7/2/14
to app-inventor-o...@googlegroups.com
I was able to get the force version read to work. I moved this part of the manifest changes here and left the rest intact.  Example in place follows:

      if (isForWireless) {              // This is to hook into ACRA
        out.write("android:name=\"com.google.appinventor.components.runtime.ReplApplication\" ");
      }
      out.write(">\n");
      
            // GoogleAdActivity
      if (componentTypes.contains("GoogleBA")){
      out.write("<meta-data android:name=\"com.google.android.gms.version\" " +
      "android:value=\"4452000\" /> \n");
   // TODO: Figure out how to read the Google Play version on the fly from the google-play-services_lib>res>values>version.xml
      //"android:value=\"@integer/google_play_services_version\" /> \n");
      }
      

      for (Project.SourceDescriptor source : project.getSources()) {


This seems to work for now, at least with this version of the Play services.

Thanks José  for letting me bounce this off of you.

Robert

M. Hossein Amerkashi

unread,
Jul 19, 2014, 9:33:25 PM7/19/14
to app-inventor-o...@googlegroups.com
Rob,

Were you able to get this working? It seems that the companion app (.apk) will be missing the entire package of com.google.android.gms.ads
The interesting think is that the com.google.android.gms.internal does get into the companion, but the com.google.android.gms.ads does not. I even tried building a sample .apk (not on companion), and same result


--

RobNCD

unread,
Jul 20, 2014, 4:10:22 AM7/20/14
to app-inventor-o...@googlegroups.com
Hi Hossein

Yes I have been able to get everything working.  I am just finalizing a mediated version, that supports multiple ads networks, allows you to select the priority network then falls back automatically to backup networks, ie Start with AdMob then fall back to Amazon. (but should be expandable to MobFox, and others.

It seems to work fine on the companion app and on the emulator.

The standalone adMob component is done, along with the standalone Amazon component.

Interstitials are almost complete.

M. Hossein Amerkashi

unread,
Jul 20, 2014, 11:00:10 AM7/20/14
to app-inventor-o...@googlegroups.com
Did you have to do anything with the proguard? It seems like this would be the reason that some .jar file classes get missing.

-Hossein.


--

M. Hossein Amerkashi

unread,
Jul 20, 2014, 11:14:59 AM7/20/14
to app-inventor-o...@googlegroups.com, Jos Flores
Jose, There is a proguard reference in DexeExec. Do you know what the usage for this should be if I want to include all the classes in the com.google.android.gms.ads ?

-Hossein

Jos Flores

unread,
Jul 20, 2014, 11:53:35 AM7/20/14
to M. Hossein Amerkashi, app-inventor-open-source-dev

I've never looked into that; can't be of much help, I'm afraid.

--------------------------------------------
mobile. brevity.typos.cheers

RobNCD

unread,
Jul 20, 2014, 12:48:26 PM7/20/14
to app-inventor-o...@googlegroups.com
You might be onto something there.  I dont use Proguard.  Also, FYI, I am using your AiLiveComplete Classic.

I did find this....    

To safely use ProGuard with Google Mobile Ads, add the following to your ProGuard config:

-keep public class com.google.android.gms.ads.** {
    public *;
}

-keep public class com.google.ads.** {
    public *;
}

    This will prevent all public methods on public classes from being obfuscated.

    If you use AdMob Mediation with other ad networks, you should keep public methods from public classes for each SDK and adapter library as well.

also here

Create a Proguard Exception

To prevent ProGuard from stripping away required classes, add the following lines in the <project_directory>/proguard-project.txt file:

-keep class * extends java.util.ListResourceBundle {
    protected Object[][] getContents();
}

-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
    public static final *** NULL;
}

-keepnames @com.google.android.gms.common.annotation.KeepName class *
-keepclassmembernames class * {
    @com.google.android.gms.common.annotation.KeepName *;
}

-keepnames class * implements android.os.Parcelable {
    public static final ** CREATOR;

M. Hossein Amerkashi

unread,
Jul 20, 2014, 1:23:52 PM7/20/14
to app-inventor-o...@googlegroups.com
Yes, had seen it, but still same issue.
I'll try with the classic to see if same issue still persists.




--

M. Hossein Amerkashi

unread,
Jul 20, 2014, 3:54:57 PM7/20/14
to app-inventor-o...@googlegroups.com

Which version of play do you use?
Also what is the .apk size impact?  The play jar that I see is about 2.6mb.

RobNCD

unread,
Jul 20, 2014, 4:41:09 PM7/20/14
to app-inventor-o...@googlegroups.com
4.4.52 which I believe is the newest version

A completed test apk with both Google ads and Amazon ads (libraries) included comes in a 2.01 Mb

I working published apk with both libraries is at 2.17Mb
that one resides here
https://play.google.com/store/apps/details?id=appinventor.ai_dev_mcics.FlashNewsLR, just a simple new app with ads in place

M. Hossein Amerkashi

unread,
Jul 20, 2014, 6:37:40 PM7/20/14
to app-inventor-o...@googlegroups.com
Confirmed.
If using the classic version, the app is packaged properly. The com.google.android.gms.ads package / classes ARE NOT skipped.
However, in AI2, they get skipped!! What could be difference, I don't know and don't see why they get skipped.

-Hossein.


--

孟神通

unread,
Sep 20, 2016, 10:04:53 AM9/20/16
to App Inventor Open Source Development
hi , your really active and kind people ,but how to install a 32 bit compilitable package on 64 bit system

在 2014年7月3日星期四 UTC+8上午4:51:37,Jos写道:
out of ideas here; check for typos and make sure that the strings are
properly escaped.

cheers,
José



On 2 July 2014 16:49, RobNCD <rob...@gmail.com> wrote:
>> Yes since I need full tablet support, I use minSDK of 9.  I have modified
>> the compiler long ago to add the functions for specific things.  It adds the
>> lines to the manifest depending on what components are in place. Same as
>> the ListActivity, webview etc...  I also added the permissions nec for
>> tablet support.
>
>
>
>>
>> I have been all over the internet searching....  I think if I used the
>> older version of the play services that may work, however that is just a
>> guess.. and would be a very short term solution as things are changing at
>> the end of the month.
>
>
> Any ideas are welcome.
> Robert
>
> --
> You received this message because you are subscribed to the Google Groups
> "App Inventor Open Source Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
Reply all
Reply to author
Forward
0 new messages