Android Question error due to "CreateResourceFromFile(Macro, Core.NetworkClearText)"

peacemaker

Expert
Licensed User
Longtime User
Hi, All

I'm making Appcompat Webview app.
Now it needs to use "CreateResourceFromFile(Macro, Core.NetworkClearText)" in the manifest editor.
But when i have added it - the app cannot be compiled. Without it complilation was and is OK.
Why ?

B4X:
java.lang.RuntimeException: Unable to start activity ComponentInfo{peacemaker.shell.vtk.monitor/peacemaker.shell.vtk.monitor.main}: java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.appcompat.widget.ContentFrameLayout.setId(int)' on a null object reference
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:193)
    at android.app.ActivityThread.main(ActivityThread.java:6669)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.appcompat.widget.ContentFrameLayout.setId(int)' on a null object reference
    at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:703)
    at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:518)
    at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:457)
    at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:145)
    at peacemaker.shell.vtk.monitor.main.onCreate(main.java:61)
    at android.app.Activity.performCreate(Activity.java:7136)
    at android.app.Activity.performCreate(Activity.java:7127)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
    ... 11 more

B4X:
B4A Version: 9.30
Java Version: 11
Parsing code.    (0.04s)
Building folders structure.    (0.03s)
Compiling code.    (0.24s)
Compiling layouts code.    (0.01s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Generating R file.    (0.00s)
Compiling debugger engine code.    (0.01s)
Compiling generated Java code.    (0.07s)
Convert byte code - optimized dex.    (3.85s)
Packaging files.    (1.67s)
Copying libraries resources    (0.10s)
    Found 8 resource files.
Signing package file (private key).    (1.53s)
ZipAlign file.    (0.10s)
Installing file to device.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Note that the spoiler buttons only make it more difficult to read your post.

I don't see any relation between CreateResourceFromFile(Macro, Core.NetworkClearText) and the error you posted.
Maybe you removed the AppCompat theme?

Do you get a similar error if you add this line to this example: https://www.b4x.com/android/forum/threads/79896/#content ?
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Hmmm, solved. I deleted "Objects" folder and it was re-compiled OK.
Strange, but solved.
 
Upvote 0
Top