Hi Tom,
Sorry for my late reply but it takes quite a long time to find a minimal test case that reproduces my error.
Actually, your class compile fine and I’ve discovered that also mine works well if transpiled alone. Instead I experience this strange behavior only when the classes become 2.
Probably I’m missing something very stupid…here is a dummy minimal example
Case 1:
Just one minimal class where I use @J2ObjCIncompatible to avoid transpile a var. This one, as stated, works well
==========
import com.google.j2objc.annotations.J2ObjCIncompatible;
import android.net.Uri;
public class POIContract {
@J2ObjCIncompatible
public static final Uri BASE_CONTENT_URI = Uri.parse("content://" + "DUMMY-DUMMY");
public static final String TABLE_NAME="myTable";
}
==========
Case 2:
I add another file with another class in the same package that simply uses the TABLE_NAME var
==========
public class POIDbHelperGeneric {
static final String SQL_CREATE_LOCATION_TABLE = "CREATE TABLE " + POIContract.TABLE_NAME;
}
==========
If I try to compile both I got the error related to the unknown android.net.Uri class. But actually, the strangest thing is that the error is thrown when processing the second class. (So, processing POIDbHelperGeneric.java but the error is thrown on POIContract.java)
This the full error:
Mar 16, 2021 6:28:47 PM com.google.devtools.j2objc.pipeline.GenerationBatch processSourceFile
FINEST: processing /Users/simo/Desktop/XCodeProjects/J2OBJCBase-test-rw2/it/xxxxx/app/data/POIDbHelperGeneric.java
Mar 16, 2021 6:28:48 PM com.google.devtools.j2objc.pipeline.FileProcessor processBatch
FINEST: Processing batch of size 1
error: ./it/xxxxx/app/data/POIContract.java:10: cannot find symbol
symbol: method parse(java.lang.String)
location: class android.net.Uri
Command RuleScriptExecution emitted errors but did not return a nonzero exit code to indicate failure
I’m sorry but I cannot understand what’s wrong…
Hope it is a trivial mistake ;)
Simone