Note that there are some explanatory texts on larger screens.

plurals
  1. POInflating view with Google Maps api v2 for Android
    primarykey
    data
    text
    <p>Please help. I have tried and implemented all other solutions, but still no luck integrating google maps in my app. </p> <p>The current problem is at inflating point in my fragment </p> <pre><code>05-21 00:17:24.629 26619-26619/com.wimedias12.orderr E/AndroidRuntime: FATAL EXCEPTION: main java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source) at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source) at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:279) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:676) at android.view.LayoutInflater.rInflate(LayoutInflater.java:746) at android.view.LayoutInflater.rInflate(LayoutInflater.java:749) at android.view.LayoutInflater.rInflate(LayoutInflater.java:749) at android.view.LayoutInflater.inflate(LayoutInflater.java:489) at android.view.LayoutInflater.inflate(LayoutInflater.java:396) at com.wimedias12.orderr.RestaurantFragments.RestaurantHomeFragment.onCreateView(RestaurantHomeFragment.java:66) </code></pre> <p>First thing that pops out as an answer is to reference the google services library the right way but that is set-up. </p> <p>So here is my current configuration and please help me if you can.</p> <p><strong>restaurant_home.xml</strong> - my fragment layout where I want the map to be displayed</p> <pre><code>... Other fragment layout XML code ... &lt;LinearLayout android:layout_width="match_parent" android:layout_height="200dp" android:id="@+id/mapMap" android:layout_marginLeft="5dp" android:layout_marginRight="5dp"&gt; &lt;fragment android:id="@+id/mapMapppp" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.SupportMapFragment" /&gt; &lt;/LinearLayout&gt; ... Rest of the fragment layout XML ... </code></pre> <p>I have tried with MapView but no luck eiter, I read that using fragment is easier.</p> <p><strong>RestaurantHomeFragment.java</strong> - fragment's code</p> <pre><code>public class RestaurantHomeFragment extends SherlockFragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.restaurant_home, container, false); //&lt;-- This line breakes .... } </code></pre> <p>This fragment is hosted in a SherlockFragmentActivity.</p> <p><strong>AndroidManifest.xml</strong> </p> <pre><code>&lt;uses-sdk android:minSdkVersion="8" android:targetSdkVersion="14" /&gt; &lt;permission android:name="com.wimedias12.orderr.MAPS_RECEIVE" android:protectionLevel="signature" /&gt; &lt;uses-permission android:name="android.permission.INTERNET" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt; &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /&gt; &lt;uses-permission android:name="com.wimedias12.orderr.MAPS_RECEIVE" /&gt; &lt;uses-feature android:glEsVersion="0x00020000" android:required="true"/&gt; &lt;application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/Theme.VPI" &gt; &lt;uses-library android:name="com.google.android.maps" /&gt; .... &lt;meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="AIzaXxXxXXXxXxxXx-WHmjbRpFz4eOqWBXdqUtQ" /&gt; &lt;/application&gt; </code></pre> <p>And here are my project properties, just to verify that the library well referenced. <img src="https://i.stack.imgur.com/07aEI.png" alt="enter image description here"></p> <p>Any help is much appreciated. Thanks! </p> <p><strong>UPDATE:</strong></p> <p>@CommonsWare answer is the right one. But because I'm using Android Studio i.e. IntelliJ Idea, I feel I need to answer how I make it work.</p> <p>I just removed all references from the Project Structure window and re added one by one again, and somehow it worked, the configuration is still the same as in the image shown above. I guess IntelliJ had some problems referencing the library.</p> <p>So right referencing of the library is the answer.</p> <p>P.S. I ended up using MapView in a SherlockFragment. Thx for the help.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload