Syntax error: Unterminated quoted string

by Daniel Mack » Fri, 20 May 2011 09:30:35 GMT


Sponsored Links
 I'm following the basic instructions for setting up an Android
application with Eclipse and just after creating a new project,
without modifying any sources, I get the following error when I try to
run it in the emulator:

[2011-05-20 00:02:13 - bla] Device API version is 10 (Android 2.3.3)
[2011-05-20 00:02:13 - bla] Uploading bla.apk onto device
'emulator-5554'
[2011-05-20 00:02:13 - bla] Installing bla.apk...
[2011-05-20 00:02:13 - bla] Success!
[2011-05-20 00:02:13 - bla] Starting activity com.bla.bla.bla on
device emulator-5554
[2011-05-20 00:02:13 - bla] ActivityManager: am: 1: Syntax error:
Unterminated quoted string

I fail to see any problem in any of the sources, and my attempts to
find that unterminated string anywhere in the generated sources have
failed so far. This happens to me with the following version:

Eclipse Eclipse IDE for Java Developers
Version: Helios Service Release 2
Build id: 20110218-0911

SDK Platform Android 2.3.3, API 10, revision 1
Android SDK Tools, revision 11

Mac OS X 10.6.7

Can anyone explain that error? If you need more information, please
let me know.

And please Cc: my on answers.

Thanks,
Daniel

-- 



Re: Syntax error: Unterminated quoted string

by DanH » Fri, 20 May 2011 10:06:56 GMT


 Did you, perhaps, put a quote symbol into one of the configuration
fields when you were setting things up?




-- 


Sponsored Links


Re: Syntax error: Unterminated quoted string

by Brill Pappin » Fri, 20 May 2011 12:17:37 GMT


 What it means is that the runtime (not the compiler this time) thinks it has 
found a string that's not complete (which I'm sure you already surmised).

The fact that its at runtime means that there is nothing obvious in your 
code itself, or the compiler would have caught it.
I've seen something similar to that caused by an encoding problem in some 
file (i'd check the XML files). Essentially there was to different charsets 
in a single file or a unicode char not expected etc... this can happen if 
you copy and paste content from one place to another.

Note: I don't *know* thats what the problem is, just that I've seen 
something in the past that makes my think you might want to check for that 
kind of problem.

Finding it is harder... but if you can load your file in an basic editor 
that doesn't understand unicode, you should see it right away.

-- 



Re: Syntax error: Unterminated quoted string

by Brill Pappin » Fri, 20 May 2011 12:19:25 GMT


 adding a quote symbol in the XML might cause it, although I'm surprised that 
the editor doesn't escape things as needed :)


-- 



Re: Syntax error: Unterminated quoted string

by Daniel Mack » Fri, 20 May 2011 14:01:05 GMT


 


Well, as I said, all the code is auto-created by Eclipse (and the
Android plugin), and I can't see anything that is syntactically wrong
with it. FWIW, I uploaded the package, so you can have a look at it:
 http://zonque.org/android-bla.zip 

Thanks for your help.

Daniel

-- 



Re: Re: Syntax error: Unterminated quoted string

by Dianne Hackborn » Fri, 20 May 2011 15:09:13 GMT


 "am" is the shell command that is run to launch an application.  So a bad
character got in that command line somehow...  though I'm not sure how that
could be, I think the main thing that is used there that comes from the app
at all is the manifest package name.








-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 



Re: Syntax error: Unterminated quoted string

by Daniel Mack » Fri, 20 May 2011 17:11:58 GMT


 


I can't find that binary, otherwise I would debug and wrap it and dump
the arguments it has to deal with. Any hint where this binary is
located? Any other debugging options I can possibly enable to nail
this down?


As you can see from the package I uploaded, the AndroidManifest.xml
seems to be alright.

Thanks,
Daniel





-- 



Other Threads

1. SOLD ! WTS: HTC Desire BNIB only 1 unit

Udah terjual ya sama seorang boss besar di berbagai milis :)

-------Original Email-------
Subject :WTS: HTC Desire BNIB only 1 unit
Date  :Tue May 04 16:24:23 Asia/Bangkok 2010


Ada kelebihan 1 unit HTC Desire status BNIB SEALED, harga Japri aja

Bagi yg belum tau, specs Desire ini mirip N1 dengan kelebihan:

- HTC Sense UI, keren banget deh
- Optical Trackpad
- Radio FM
- Internet bisa flash (buat main game facebook farmville, poker, mobwars dll) 

Kelengkapan dus, charger, kabel data, earphone, MicroSD 4GB, manual

Lokasi di Palembang

japri: angga.arians...@gmail.com 

Thanks,

-- 
"Indonesian Android Community [id-android]" 

2. Odp: A simplest Application access "Content Provider"

Why are you posting this on Android-kernel not on android-platform?

W dniu 2010-05-05 13:57 uytkownik <linlo...@gmail.com> napisa:

hi,

Usually, we can inherit class "Activity" to access "Content Provider", such
as SMS/Contacts with following codes:
===========================
public class ActivityTest extends Activity {
...
    private void insertSms(String str_address, String content){
        ContentResolver contentResolver = getContentResolver();
        String strUriInbox = "content://sms/inbox";
        ContentValues values = new ContentValues();
        values.put("address", str_address);
        values.put("date", Calendar.getInstance().getTime().getTime());
        values.put("protocol", "0");
        values.put("status", "-1");
        values.put("type", "1");
        values.put("body", content);
        Uri uriSms = Uri.parse(strUriInbox);
        contentResolver.insert(uriSms, values);
    }
}
===========================

However, I don't want to show a activity if write SMS database. So, I design
a simplest application without Activity with following codes:
===========================
package com.xxx.NoActivityTest;

public class NoActivityTest {
    public NoActivityTest(){
    }

    private void insertSms(String str_address, String content){
        ContentResolver contentResolver = *getContentResolver*();
*//"NoActivityTest"
don't inherit from "Activity", so, don't recongnize "getContentResolver()",
so, can't get "ContentResolver" instance.*
        String strUriInbox = "content://sms/inbox";
        ContentValues values = new ContentValues();
        values.put("address", str_address);
        values.put("date", Calendar.getInstance().getTime().getTime());
        values.put("protocol", "0");
        values.put("status", "-1");
        values.put("type", "1");
        values.put("body", content);
        Uri uriSms = Uri.parse(strUriInbox);
        contentResolver.insert(uriSms, values);
    }

    public static void main(String[] args) {
        NoActivityTest ex = new NoActivityTest();
        ex.insertSms("13912345678", "test0001");
    }
}
===========================

As you seen from comments, can't get "ContentResolver" instance because
don't recongnize "getContentResolver()".
How to overcome this issue?

Thanks.



-- 
unsubscribe: 
android-kernel+unsubscr...@googlegroups.com<android-kernel%2bunsubscr...@googlegroups.com>
website: 

3. Title bar display

4. troubles reading other apps config files

5. When I override Adapter.isEnabled() the ListView divider isn't displayed

6. webview touch problem

7. FroYo and PDF