The original name of the content provider authority that works fine with no errors:
public static final String AUTHORITY = com.dakotastream.cardiologger.CardioLoggerProvider12;
I want rename my authority to:
public static final String AUTHORITY = com.dakotastream.cardiologger.CardioLoggerProvider;
When I change the name to the above I get this error.
Caused by: java.lang.StringIndexOutOfBoundsException: length=68; index=70
public static final String AUTHORITY = com.dakotastream.cardiologger.CardioLoggerProvider1;
When I change the name to the above I get this error.
Caused by: java.lang.StringIndexOutOfBoundsException: length=69; index=70
If I rename the package to com.dakotastream.cardiologger12, then I can use the
public static final String AUTHORITY = com.dakotastream.cardiologger12.CardioLoggerProvider;
with no errors.
The Authority seems to require a string length greater than 69 characters.
I am using SDK Tools 22.6.3, API 19, ABS Library 4.4.0
I have tried creating a new Android Application Project and dropping the code in. I get the same error.
Entire LogCat Dump:
FATAL EXCEPTION: ModernAsyncTask #1
Process: com.dakotastream.cardiologger, PID: 1344
java.lang.RuntimeException: An error occured while executing doInBackground()
at android.support.v4.content.ModernAsyncTask$3.done(ModernAsyncTask.java:137)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
Caused by: java.lang.StringIndexOutOfBoundsException: length=68; index=70
at java.lang.String.indexAndLength(String.java:584)
at java.lang.String.substring(String.java:1449)
at com.dakotastream.cardiologger.DbContentProvider.query(DbContentProvider.java:279)
at android.content.ContentProvider.query(ContentProvider.java:857)
at android.content.ContentProvider$Transport.query(ContentProvider.java:200)
at android.content.ContentResolver.query(ContentResolver.java:461)
at android.content.ContentResolver.query(ContentResolver.java:404)
at android.support.v4.content.CursorLoader.loadInBackground(CursorLoader.java:49)
at android.support.v4.content.CursorLoader.loadInBackground(CursorLoader.java:35)
at android.support.v4.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:242)
at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:51)
at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:40)
at android.support.v4.content.ModernAsyncTask$2.call(ModernAsyncTask.java:123)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
In Eclipse I use Android Tools>Rename Application Package to change the name.
This is the error I get when I change the name.
Update the android:authorities tag accordingly for the provider in the manifest.
Related
I am using cmusphinx in android. First of all i executed demo project downloaded from Github. When i built my own dictionary created own keyPhrase it gives the following execption
FATAL EXCEPTION: AsyncTask #1
Process: edu.cmu.sphinx.pocketsphinx, PID: 5006
java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:300)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
Caused by: java.lang.RuntimeException: Decoder_setKeyphrase returned -1
at edu.cmu.pocketsphinx.PocketSphinxJNI.Decoder_setKeyphrase(Native Method)
at edu.cmu.pocketsphinx.Decoder.setKeyphrase(Decoder.java:155)
at edu.cmu.pocketsphinx.SpeechRecognizer.addKeyphraseSearch(SpeechRecognizer.java:259)
at edu.cmu.pocketsphinx.demo.PocketSphinxActivity.setupRecognizer(PocketSphinxActivity.java:203)
at edu.cmu.pocketsphinx.demo.PocketSphinxActivity.access$000(PocketSphinxActivity.java:51)
at edu.cmu.pocketsphinx.demo.PocketSphinxActivity$1.doInBackground(PocketSphinxActivity.java:91)
at edu.cmu.pocketsphinx.demo.PocketSphinxActivity$1.doInBackground(PocketSphinxActivity.java:85)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
here is my contents of cmudict-en-us.dict
HELLO HH AH L OW
HELLO(2) HH EH L OW
HIMANSHU HH AH M AE N SH UW
and i set my keyphrase as
private static final String KEYPHRASE = "hello himanshu";
Words are case-sensitive. Your keyphrase must be in uppercase as in the dictionary. Or words in the dictionary must be lowercase. Phonemes must be in uppercase.
To debug errors like this you can read logcat output, it provides detailed messages about the problem.
I am encountering the exception stated below in my android code where I am trying to parse an ODATA service using odata4j JAR library.
java.lang.IllegalArgumentException: Illegal datetime format 2015-05-07T00%3A00%3A00
I am getting the error at line below in Android code:
List list = c.getEntities("EntityName").execute().toList();
My entire stacktrace is stated below:
Caused by: java.lang.IllegalArgumentException: bad valueString [datetime'2015-05-07T00%3A00%3A00'] as part of keyString [*****='*****',*****='0',***='*****',date=datetime'2015-05-07T00%3A00%3A00',*****='*******']
at org.odata4j.core.OEntityKey.parse(OEntityKey.java:157)
at org.odata4j.format.xml.AtomFeedFormatParser.parseEntityKey(AtomFeedFormatParser.java:300)
at org.odata4j.format.xml.AtomFeedFormatParser.entityFromAtomEntry(AtomFeedFormatParser.java:431)
at org.odata4j.format.xml.AtomFeedFormatParser.parseEntry(AtomFeedFormatParser.java:349)
at org.odata4j.format.xml.AtomFeedFormatParser.parseFeed(AtomFeedFormatParser.java:169)
at org.odata4j.format.xml.AtomFeedFormatParser.parse(AtomFeedFormatParser.java:157)
at org.odata4j.format.xml.AtomFeedFormatParser.parse(AtomFeedFormatParser.java:45)
at org.odata4j.consumer.ConsumerQueryEntitiesRequest.doRequest(ConsumerQueryEntitiesRequest.java:67)
at org.odata4j.consumer.ConsumerQueryEntitiesRequest.getEntries(ConsumerQueryEntitiesRequest.java:50)
at org.odata4j.consumer.ConsumerQueryEntitiesRequest.execute(ConsumerQueryEntitiesRequest.java:40)
at *******.MyActivity$LoadSpinners.doInBackground(MyActivity.java:287)
at *******.MyActivity$LoadSpinners.doInBackground(MyActivity.java:202)
at android.os.AsyncTask$2.call(AsyncTask.java:287)
at java.util.concurrent.FutureTask.run(FutureTask.java:234)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:841)
Caused by: java.lang.IllegalArgumentException: Illegal datetime format 2015-05-07T00%3A00%3A00
at org.odata4j.internal.InternalUtil.parseDateTimeFromXml(InternalUtil.java:96)
at org.odata4j.expression.ExpressionParser.readExpression(ExpressionParser.java:462)
at org.odata4j.expression.ExpressionParser.parse(ExpressionParser.java:64)
at org.odata4j.core.OEntityKey.parse(OEntityKey.java:152)
There are ****** placed at certain sensitive information like not related properties and app package names.
I am building an Android Library. I kept the code as normal android project while I was developing it and now I converted it into library project (even made a new library project and copied all the code in there just to be sure). The library basically allows user to enter data into database using contentprovider and the library returns that data queried from the database. So whatever app uses the library does not need to use the contentprovider to access data since the library does it all.
I made a very basic app that uses the library, the moment that I make a call to the library the app crashes giving the error code:
FATAL EXCEPTION: AsyncTask #3
Process: com.example.testing, PID: 18991
java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:300)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
Caused by: java.lang.SecurityException: Permission Denial: opening provider thesis.thesis.contentprovider.UsersDataContentProvider from ProcessRecord{42a51b18 18991:com.example.testing/u0a272} (pid=18991, uid=10272) that is not exported from uid 10266
at android.os.Parcel.readException(Parcel.java:1465)
at android.os.Parcel.readException(Parcel.java:1419)
at android.app.ActivityManagerProxy.getContentProvider(ActivityManagerNative.java:2917)
at android.app.ActivityThread.acquireProvider(ActivityThread.java:4489)
at android.app.ContextImpl$ApplicationContentResolver.acquireUnstableProvider(ContextImpl.java:2330)
at android.content.ContentResolver.acquireUnstableProvider(ContentResolver.java:1441)
at android.content.ContentResolver.query(ContentResolver.java:448)
at android.content.CursorLoader.loadInBackground(CursorLoader.java:65)
at android.content.CursorLoader.loadInBackground(CursorLoader.java:43)
at android.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:312)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:69)
at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:57)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
... 3 more
I added permissions to testapp, but didnt change the error
<uses-permission android:name="thesis.thesis.contentprovider.READ_DATABASE" />
<uses-permission android:name="thesis.thesis.contentprovider.WRITE_DATABASE" />
The provider declared in library manifest:
<provider
android:name="thesis.thesis.contentprovider.UsersDataContentProvider"
android:authorities="thesis.thesis.contentprovider"
android:exported="true"
android:readPermission="thesis.thesis.contentprovider.READ_DATABASE"
android:writePermission="thesis.thesis.contentprovider.WRITE_DATABASE" />
At the moment I have exported="true" to see if that was the problem but no. Later I want it to be set false, since the data is sensitive.
Can anyone please direct me to where the problem might be. Also ask if additional information is needed.
I use android IAB, It work perfectly on Nexus 5 but on asus zenfone I encounter error with following stacktracke
java.lang.IllegalArgumentException: java.security.spec.InvalidKeySpecException: java.lang.RuntimeException: error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag
at com.miskatmobile.android.almishbah.util.Security.generatePublicKey(Security.java:86)
at com.miskatmobile.android.almishbah.util.Security.verifyPurchase(Security.java:66)
at com.miskatmobile.android.almishbah.util.IabHelper.queryPurchases(IabHelper.java:773)
at com.miskatmobile.android.almishbah.util.IabHelper.queryInventory(IabHelper.java:532)
at com.miskatmobile.android.almishbah.util.IabHelper.queryInventory(IabHelper.java:510)
at com.miskatmobile.android.almishbah.util.IabHelper$2.run(IabHelper.java:589)
at java.lang.Thread.run(Thread.java:841)
Caused by: java.security.spec.InvalidKeySpecException: java.lang.RuntimeException: error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag
at com.android.org.conscrypt.OpenSSLKey.getPublicKey(OpenSSLKey.java:101)
at com.android.org.conscrypt.OpenSSLRSAKeyFactory.engineGeneratePublic(OpenSSLRSAKeyFactory.java:47)
at java.security.KeyFactory.generatePublic(KeyFactory.java:171)
at com.miskatmobile.android.almishbah.util.Security.generatePublicKey(Security.java:81)
at com.miskatmobile.android.almishbah.util.Security.verifyPurchase(Security.java:66)
at com.miskatmobile.android.almishbah.util.IabHelper.queryPurchases(IabHelper.java:773)
at com.miskatmobile.android.almishbah.util.IabHelper.queryInventory(IabHelper.java:532)
at com.miskatmobile.android.almishbah.util.IabHelper.queryInventory(IabHelper.java:510)
at com.miskatmobile.android.almishbah.util.IabHelper$2.run(IabHelper.java:589)
at java.lang.Thread.run(Thread.java:841)
Caused by: java.lang.RuntimeException: error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag
at com.android.org.conscrypt.NativeCrypto.d2i_PUBKEY(NativeCrypto.java)
at com.android.org.conscrypt.OpenSSLKey.getPublicKey(OpenSSLKey.java:99)
at com.android.org.conscrypt.OpenSSLRSAKeyFactory.engineGeneratePublic(OpenSSLRSAKeyFactory.java:47)
at java.security.KeyFactory.generatePublic(KeyFactory.java:171)
at com.miskatmobile.android.almishbah.util.Security.generatePublicKey(Security.java:81)
at com.miskatmobile.android.almishbah.util.Security.verifyPurchase(Security.java:66)
at com.miskatmobile.android.almishbah.util.IabHelper.queryPurchases(IabHelper.java:773)
at com.miskatmobile.android.almishbah.util.IabHelper.queryInventory(IabHelper.java:532)
at com.miskatmobile.android.almishbah.util.IabHelper.queryInventory(IabHelper.java:510)
at com.miskatmobile.android.almishbah.util.IabHelper$2.run(IabHelper.java:589)
at java.lang.Thread.run(Thread.java:841)
any idea why it happened?
thanks
Hi , my app when runs on HWY320-U (Huawei) throws exception.
What may be reason of this?
java.lang.IllegalArgumentException: Invalid int: "Acc"
at android.os.Parcel.readException(Parcel.java:1429)
at android.os.Parcel.readException(Parcel.java:1379)
at afa.a(SourceFile:102)
at aer.a(SourceFile:174)
at aer.a(SourceFile:151)
at afw.run(SourceFile:14)
at afy.run(SourceFile:30)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:838)
If I look at the stacktrace, I would say that you use Integer.parseInt() somewhere and the input seems to be "Acc". This input cannot be parsed to an Integer as it is a String